Fork me on GitHub
#om
<
2016-08-03
>
akiel11:08:42

are there already some real-world open source om.next projects from which I can learn?

anmonteiro14:08:33

just published Oriens, a Lein / Boot template to scaffold a Compassus application: https://github.com/compassus/oriens run boot -d seancorfield/boot-new new -t oriens -n your-app or lein new oriens your-app to generate a compassus app from this template

akiel14:08:17

@anmonteiro: if I create a project with lein new oriens your-app, I only get a boot project - no leiningen project.clj 😟

anmonteiro14:08:41

I meant Boot template because you can run boot -d seancorfield/boot-new new -t oriens -n your-app

anmonteiro14:08:06

Boot is the build tool for the generated project

anmonteiro14:08:11

it’s right there in the README 🙂

anmonteiro14:08:55

I’m not going to spend any time working on a Lein setup for the generated project, sorry

akiel14:08:08

okok - but you know, I’m on Cursive and like leiningen projects for that reason

akiel14:08:21

no figwheel?

anmonteiro14:08:01

nope, boot-reload does the same thing

anmonteiro14:08:10

and is composable with other Boot tasks

akiel14:08:13

a defonce on app-state would be good

anmonteiro14:08:04

@akiel: sure, PR welcome

akiel14:08:04

@anmonteiro: if I use defonce on the state, I get the same error in your project as I get in mine. The problem is in reconcile! line 1787 in alpha41. The line is ((:render st)) and the problem is that (:render st) is nil. Can you see the same?

anmonteiro16:08:04

@akiel: definitely not seeing that

akiel16:08:32

@anmonteiro: I do the following: lein new oriens my-app, boot dev, change something - in chrome console I see Reload and set-route! messages, change def to defonce - in chrome console I see the following...

anmonteiro16:08:43

@akiel: yeah, hitting that too, I know why

anmonteiro16:08:03

problem is app also needs to be defonced

peeja16:08:38

Can you use any CLJS object as a React key? Does that work?

akiel16:08:21

@anmonteiro: yes I also noticed that a defonce on app works, but than you can’t reload routes and other things

anmonteiro16:08:38

@akiel: should be fixed now, try lein new oriens my-app 🙂

anmonteiro17:08:22

hrm, you might need to delete your local cache though

anmonteiro17:08:37

not sure, just check if it downloads a new one

akiel17:08:49

@anmonteiro: ok works for me - I’ll try this in my project

anmonteiro17:08:02

glad to hear

peeja17:08:13

Put another way: Does anyone know what objects can be used as React keys? Or, more accurately, what React's notion of key equality is?

akiel17:08:44

@peeja sorry no - I never had a need to use custom react keys

anmonteiro17:08:46

@peeja: I think it’s triple-equals equality, so numbers, strings

akiel18:08:57

@anmonteiro: in your solution: init! would not be called in production, I have solved it a bit differently: I prevented reloading of the core namespace, renamed init! into reload! and only do the forceUpdate there

akiel18:08:32

I have all my routeable components in different namspaces

anmonteiro18:08:34

@akiel: init! can be called in production, reloading will never happen

anmonteiro18:08:47

so it just ends up being called once

akiel18:08:03

yes it can be called in production - but will it be?

anmonteiro18:08:28

you need to call it for your app to be set up

akiel18:08:07

ok you can call init! in index.html

anmonteiro18:08:01

yeah, just need to ^:export it

akiel18:08:52

for me it’s simpler to have a non-reloadable core namespace

akiel18:08:59

and you really need the ^:once at routable components otherwise they will not update

anmonteiro18:08:58

@akiel: you can either make everything non-reloadable, and just have the app mount everytime you reload, or make everything reloadable for that workflow to actually work

akiel18:08:01

@anmonteiro: why doesn’t work a forceUpdate on your root component? I tried it. Would be simpler.

anmonteiro18:08:34

@akiel: since props haven’t changed, the shouldComponentUpdate call would fail on the children

akiel18:08:35

but than the mounting has this reconciler bug

anmonteiro18:08:00

I mean, not fail, but return false

akiel18:08:39

if I only change code - do I change props?

anmonteiro18:08:54

no, that’s exactly the point

akiel18:08:39

but if I change something in a subcomponent of a routable component - the forceUpdate also works

akiel18:08:35

ok but that subcomponent has no ^:once - is this the reason?

akiel19:08:12

ok with a ^:once it doesn’t work

akiel19:08:28

so the forceUpdate is not recursive

anmonteiro19:08:08

@akiel: for development purposes you can just use a react-key like (system-time) or something

anmonteiro19:08:22

and put that in props

anmonteiro19:08:26

that’s guaranteed to change

akiel19:08:29

for what I need now - it works fine

jasonjckn22:08:59

is there a way to disable react warnings

anmonteiro23:08:50

only way I know is using the production React