Fork me on GitHub
#reagent
<
2015-09-21
>
darwin09:09:53

@danielgrosse: using go macro inside component’s render function looks quite crazy to my eye, I would guess during first component render it just puts internal go representation into that hiccup vector, that is why you are seeing numbers

darwin09:09:01

I would write normal component depending on some data and run this go routine outside render function and update data for the component standard way

danielgrosse12:09:55

@darwin Thanks for your advice. I still have to learn many things. simple_smile

curtosis15:09:38

should a simple reagent app (3-4 components, nothing fancy, no routing) compile to a 443K app.js in :advanced compilation mode?

savaki16:09:04

Doesn’t sound right. Could you post your code?

curtosis16:09:20

there's what I think the relevant project.clj bits are.

curtosis16:09:22

the (poorly-named) :profiles/production entry just brings in the database configuration that needs to go into the WAR file.

savaki16:09:46

strange. i’m not used to the uberjar, but it looks ok otherwise. what happens when you change the top optimizations to :advanced?

curtosis16:09:30

when I run outside of :uberjar the whole thing gets split out and I get all the goog files in their own directory.

savaki16:09:10

given that this is a cljs project, what does the uberjar do for you?

curtosis16:09:59

the server side is actually where most of the code lives. lots of Java wrapped in clojure, fronted by a cljs UI.

savaki16:09:15

So 443k is the size of the app.js file?

curtosis16:09:50

yes. gzipped, 110k.

savaki16:09:52

Oh, is that with an inlined react.js? Or is that external?

curtosis16:09:40

inlined. I also mentioned it over on #C03S1L9DN, and @dnolen seemed to think that wasn't crazy big.

savaki16:09:44

If so, that sounds about right.

curtosis16:09:54

cool. glad for the sanity check. simple_smile

curtosis16:09:21

I forget that 400K is still a pretty small load for all the js a page needs.

savaki16:09:10

the minified react.js by itself is already ~120k

chris19:09:00

So if I call a function that derefs my ratom from a component does that cause the calling component to rerender? or is it just if I deref the ratom in the component itself?

gadfly36120:09:25

If the function that derefs your ratom is called from within the render phase of the component, the component should re-render

chris23:09:01

ok thanks