Fork me on GitHub
#re-frame
<
2016-05-29
>
mccraigmccraig08:05:52

yw @richiardiandrea :) are you using the clairvoyant tracing macros too ? about 95% of the complexity in my macros is making them work with clairvoyant...

pesterhazy09:05:53

@mccraigmccraig: clairvoyant looks interesting. Why is to so important to you? Any thoughts on https://github.com/philoskim/debux ?

mccraigmccraig09:05:28

@pesterhazy: just 'cos along with https://github.com/Day8/re-frame-tracer and https://github.com/Day8/re-frame/wiki/Debugging it gives you a very clear insight into exactly what is happening in your re-frame app... i haven't looked at debux

mccraigmccraig09:05:18

a quick look at debux @pesterhazy and it looks similar to clairvoyant... my short-form re-frame macros would probably need similar support (i.e. expand re-frame reaction/regsub/reghandler forms to standard fn forms before the trace macros get hold of them)... you could very easily adapt my macros to debux if that is the case

carkh09:05:21

I sometimes have subscriptions where one of the parameter is itself a subscription or a reaction, like so :

(let [some-data (subscribe [:data/subdata @depends-on-this])] .... )
I was surprised (after writing quite a bit of code), that the subscribe content was not itself "reactive". So that when depends-on-this changes, there was no update to some-data. I considered doing something like this :
(let [some-data (reaction @(subscribe [:data/subdata @depends-on-this]))] .... )
But i'm not quite sure if this will not resubscribe when it should not... Thus doing the expensive behind the scene calculations without the benefit of the reagent caching. Any thought about this ?

mikethompson09:05:52

@carkh: look up dynamic subscriptions

mikethompson09:05:44

You'll end up with:

(let [some-data (subscribe [:data/subdata] [depends-on-this]) .... )

carkh09:05:30

ahh i remember reading this, then promptly forgetting about it ! thanks !

richiardiandrea15:05:28

@mccraigmccraig: haven't gotten to the part yet (today)...ideally you want need to wrap your handlers anymore, just enable/disable tracing...is it like this already? I will check and report

mccraigmccraig15:05:09

@richiardiandrea: you still wrap ... and you need to use the versions of the wrapping macros from my macros

richiardiandrea16:05:46

@mccraigmccraig Ok yeah I think what I had in mind is more a macro around ns...or...add meta to the ns...would it be a good idea to trace everything? Maybe yes if your handlers/subs/views are not huge and you are organizing code in panels...I guess