This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-07-20
Channels
- # aleph (2)
- # boot (18)
- # cider (3)
- # cljs-dev (14)
- # cljsrn (28)
- # clojure (428)
- # clojure-austin (3)
- # clojure-hk (1)
- # clojure-ireland (5)
- # clojure-mexico (1)
- # clojure-quebec (2)
- # clojure-russia (49)
- # clojure-spec (138)
- # clojure-uk (45)
- # clojurescript (70)
- # core-async (1)
- # cursive (8)
- # datomic (13)
- # defnpodcast (3)
- # devops (1)
- # editors (4)
- # events (1)
- # funcool (14)
- # hoplon (17)
- # jobs-rus (1)
- # luminus (5)
- # mount (51)
- # off-topic (21)
- # om (9)
- # om-next (8)
- # onyx (43)
- # planck (6)
- # re-frame (13)
- # reagent (18)
- # ring-swagger (1)
- # spacemacs (17)
- # untangled (18)
- # vim (13)
- # yada (21)
with re-frame I am thinking of adding a signal for the window size and just subscribing to it. is there a better way?
Trying to understand the resource needs of Reagent: If I can tell (through a (prn "drawn")
) that a component function is called repeatedly during interaction with a page, does that mean that I am hogging a lot of resources with each call? I mean, supposing I am not causing heavy computations or side effects other than changing the page state. As I understand it, Reagent will only redraw the elements which are actually changed, not the tree carrying that element - even if the tree is called again. Is this right?
And DOM manipulation is the heaviest part of Reagent, resource-wise. Yes? 🙂
Asking because my app seems a bit slow, for example upon entering text in a [:input {:type :text}]
. Each stroke causes a delay before the next.
@reefersleep: yes, reagent/react will do minimal-ish dom updates, and if parents are unchanged they won't get re-rendered
dom manipulation is often the heaviest part of an app, but it depends on what your app is doing - what's happening in response to keypresses ?
just #(swap! state assoc :entered-text %)
, that's why I'm wondering
And then there's an next-button which reads (:entered-text @state)
as well as a couple of other vals to see if it should be disabled or not
it's just a form and some validation (before you press the next-button) 🙂
that sounds pretty lightweight
indeed
I don't know if it's just because I'm running figwheel, haven't tried compiling for production
i have used https://github.com/Day8/re-frame/wiki/Debugging to great effect before when i've been debugging perf problems... only the component bit is applicable to vanilla reagent, but it gives you deep insight into what exactly is going on in your app
production compiles make a lot of difference to load-times, not so much to loaded performance
I'll give it a go, thanks a lot!
ok, wow, this is great http://blob.tomerweller.com/reagent-import-react-components-from-npm