This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-20
Channels
- # bangalore-clj (1)
- # beginners (145)
- # boot (8)
- # braid-chat (2)
- # capetown (2)
- # cider (27)
- # cljs-dev (232)
- # cljsrn (30)
- # clojure (223)
- # clojure-boston (1)
- # clojure-dusseldorf (2)
- # clojure-greece (1)
- # clojure-italy (21)
- # clojure-russia (16)
- # clojure-sanfrancisco (13)
- # clojure-spec (33)
- # clojure-uk (56)
- # clojurescript (165)
- # core-async (16)
- # core-logic (5)
- # cursive (14)
- # data-science (2)
- # datavis (2)
- # datomic (49)
- # duct (15)
- # editors (5)
- # emacs (6)
- # fulcro (11)
- # graphql (11)
- # hoplon (8)
- # jobs (4)
- # jobs-discuss (82)
- # jobs-rus (7)
- # leiningen (4)
- # luminus (5)
- # off-topic (90)
- # om (7)
- # om-next (1)
- # parinfer (67)
- # pedestal (34)
- # portkey (46)
- # re-frame (12)
- # reagent (4)
- # reitit (3)
- # remote-jobs (1)
- # ring-swagger (8)
- # shadow-cljs (13)
- # spacemacs (18)
- # specter (6)
- # sql (5)
- # tools-deps (4)
- # unrepl (40)
- # yada (26)
The canvas example in the fulcro book is very useful for me, the rerendering is very smooth on that sample. I'm currently drawing starcraft II output to a canvas. And planning to implement mouse functionality (so clicking/dragging boxes etc), I hope I can get it as smooth as that.
Currently the rendering is still too slow for that to be useful though. I'm doing some ugly conversions of a bytestring to a binary string and then sometimes back to an 32byte arraybuffer. Sigh. Working with binary data in JS is blegh.
It seems having :ref on a component triggers the render function on a constant (requestAnimationFrame?) basis, even if shouldComponentUpdate is passed false. I guess that's intended and I should put the expensive binary conversion in the model.
@bbss having a ref doesn't do that, having a ref that is a lambda is probably your culprit, since a new lambda is generated every time, and that changes the props that are seen, which makes it refresh when it doesn't need it. Generating the lambda on mount and storing it as a prop on the instance is one way around that.
Oh wow.. I might be making that mistake on my JS projects at work too. Although maybe it could be a om/fulcro thing "props that are seen". Thanks for the insight.