Fork me on GitHub
#reagent
<
2016-02-20
>
kanwei18:02:07

@mikethompson: still not working for me after following the examples. Here's a gist: https://gist.github.com/kanwei/7ac7efc9d966a2416c67

kanwei18:02:50

reagent/props always returns nil for me in :component-did-update

mikethompson20:02:22

@kanwei: which version of reagent are you using?

kanwei20:02:43

0.5.1 and 0.6.0-alpha both return nil

kanwei20:02:59

does that example work for you? cause I would be pretty surprised

mikethompson20:02:08

Certainly of odd because many have used it (not me personally) . What happens if you remove devcards from the equation? Also, I'd write outer-test like this:

(defn outer-test []
  (let [t (subscribe [:timer])]
   (fn []           ;;  <----- added to make it From2
     [:div
      [:div (str @t)]
      [inner-test @t]]
     )))

kanwei20:02:40

I hacked it by using

(second (reagent/argv cmp))
in
:component-did-mount
but it feels dirty

kanwei20:02:57

devcards doesn't affect it... still nil in a regular component

kanwei20:02:44

Form2 didn't change anything either

kanwei20:02:26

it's definitely getting passed into :component-will-receive-props though, but reagent/props just never returns anything

mikethompson21:02:36

The Form2 suggestion wasn't about fixing the reagent/props issue, it was about reminding you to not do subscriptions in Form1

mikethompson21:02:35

I'm afraid I don't currently use reagent/props so I'm stuck in terms of helping more.

mikethompson21:02:46

I'm really puzzled though. I'd suggest raising an issue across at the reagent issue tracker. We'll see what other say there.

jrheard23:02:40

i've been experiencing performance problems with this little demo for a while: http://jrheard.com/mortgage/

jrheard23:02:32

i'd originally written my code incorrectly, such that i had a component function called draw-bar and had invocations of it look like [draw-bar mortgage selected-mortgage something]; and so whenever the app's selected mortgage changed, every single bar would redraw, because selected-mortgage was different, which makes sense

jrheard23:02:05

so changing it to look like [draw-bar mortgage is-selected-mortgage etc] made the app correctly only rerender the necessary bars whenever the selected mortgage (controlled by mousing over a bar) had changed

jrheard23:02:55

but so in unminified mode, i was still experiencing very bad performance problems - if you scrolled over a bunch of bars, the UI would lag behind the user's input very noticeably

jrheard23:02:00

like really really badly

jrheard23:02:12

it's less noticeable in minified mode, but still takes about 60ms whenever you mouse over a bar

jrheard23:02:31

i'm a rookie at using the chrome timeline tool, but i have some screenshots that maybe someone will know how to interpret simple_smile

jrheard23:02:05

here's what a single mouse-over-a-bar event looks like from the unminified version: https://www.evernote.com/shard/s11/sh/dd5958c8-a38a-414e-8f63-6632820094a3/a696fda3187fec27

jrheard23:02:53

there are a ton of other function calls i couldn't also show on the screen, but it appears to bottom out in reagent's batching.cljs, in an absolute ton of Minor GC events in an "Animation Frame Fired"

jrheard23:02:19

you can see at the top of that screenshot that this is responsible for like 90% of the interaction's 108ms rendering time (if i'm interpreting all this correctly)

jrheard23:02:43

here's a screenshot of the minified version (which is currently the live one i linked earlier) - https://www.evernote.com/shard/s11/sh/14085ab6-ec40-41c7-a80c-b52217822993/c301e06670e28fef

jrheard23:02:08

rendering just takes 63ms this time, but still there' sa lot of time spent in Animation Frame Fired, and still a noticeable amount of Minor GC events

jrheard23:02:35

am i doing something super wrong? as far as i can tell, my UI should be pretty simple - just an <svg> with some <rect>s and <text>s

jrheard23:02:23

from what i can tell, the batching.js line is a call to (run-queues)

jrheard23:02:58

i'll try using checkout deps (for my first time :D) to add some printlns to this area of reagent so i can see where the time is going, just wanted to check to see if other people had seen this sort of behavior