Fork me on GitHub
#re-frame
<
2017-02-02
>
rui.yang01:02:25

hi, wonder with the latest complier change, what is the general re-frame app size?

danielcompton01:02:44

Depends entirely on what else you include

rui.yang02:02:32

@danielcompton a good start is to test https://github.com/Day8/re-frame-template. last time I compiled it was around 500K, not gzipped

danielcompton02:02:36

I don't have time at the moment, but happy to hear reports back of gzipped and not gzipped

rui.yang02:02:32

any reference I could do to test it? just bump clojurescript version?

rui.yang02:02:57

I think the latest is 1.9.456 from mvn central

rui.yang02:02:49

384987 in 1.9.229 vs 384735 in 1.9.456

rui.yang02:02:09

unless the latest change hasn’t been officially released to mvn central

rui.yang02:02:32

no big difference between 229 and 456

rui.yang02:02:31

1.9.456 was recently released at 28-Jan-2017. I assume it includes the compiler changes. sadly, seems that we are using all the codes of react that the compiler couldn’t help much 😞

jstaffans11:02:34

seems you need a compiler option, infer-externs

jstaffans11:02:50

ah no, sorry. Seems that is about something something else entirely.

murphybob16:02:29

hi, hopefully I'm not here to spam, but I do have a question / problem as which feels a bit rude as the first thing I say... but anyway - here goes I'm developing a re-frame app using figwheel as part of my dev process, which had been working great until I started using reg-sub-raw for subscribing to a REST api (aiming to be in accordance with https://github.com/Day8/re-frame/blob/master/docs/Subscribing-To-External-Data.md) The problem I'm seeing is that after a figwheel reload of my subs.cljs file those subscriptions go mental, they seem to get into some sort of infinite loop and make http requests as fast as they can until the browser eventually gives up the ghost. Sticking some printlns and tweaking them figwheel hot reloads I can see that the new subs handlers are being loaded as the message being printed updates and the old message doesn't get repeated, so they're not being added to. If I remove the (ra/render ...) from the function figwheel calls on reload it doesn't occur, but obviously the ui doesn't re-render so that's no use. I've googled everything I can think of and I'm well and truly baffled, so I thought I'd ask in here. Though I understand this is a bit of an obscure problem so I don't necessarily expect anyone to have an idea! 🙂

murphybob16:02:09

(note I've only ever seen this behaviour occurring on a figwheel hot reload)

murphybob16:02:30

(also worth noting when figwheel reloads files other than the subs file, e.g. one of my ui view cljs files, then this issue doesn't occur)

Geoffrey Gaillard19:02:56

Hi @murphybob ! I encountered a similar situation, note that it wasn't triggered by figwheel reload, but by clojure.spec. The thing is that after hours of searching the bug, I discovered that … it wasn't a bug (nor it was a feature 🙂 ). I was writing type 2 and 3 components like those ones:

(defn my-cmpt-type-2  []
  (let [s (subscribe [:some-sub)]
  (fn []
    …)))

(defn my-cmpt-type-3 []
  (let [s (subscribe [:some-sub])]
    (reagent/create-class
      {:component-did-mount (fn []……)
       :reagent-render (fn [] ……)})))
And I was using my specs to generate sample data in forms. In other words I was filling html forms automatically with random data. I generated these data inside the render function, and guess what… this data change was triggering some dispatch calls and thus some handlers, that in turn were swap!ing the database and triggering subscriptions … I think you can see the loop… So when I saw you post I asked myself : Why is he using reg-sub-raw rather than a simple reg-sub? Is there some particular state somewhere else than the main database that could alter something? What does the function called by figwheel on refresh ? I'm afraid I don't have an answer to you problem, but maybe the problem is not with the subscriptions themselves … And maybe the debug interceptor could help tracing if some event is being dispatched … https://github.com/Day8/re-frame/blob/master/docs/Interceptors.md#appendix

mac22:02:59

If anyone has built a re-frame app that uses PouchDB I would love to compare notes 🙂

rui.yang23:02:27

the latest compiler change is to dead code removing in npm dependencies. it will also automatically generate externs with infer-externs.

rui.yang23:02:41

I wonder how does the dead code works for dependencies packaged with cljsjs. will the complier advance compile the packaged react and react-dom? or it just simply ignore optimising it?