This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-23
Channels
- # announcements (2)
- # beginners (165)
- # boot (11)
- # cider (11)
- # clj-kondo (7)
- # cljdoc (1)
- # cljsrn (5)
- # clojure (120)
- # clojure-dev (21)
- # clojure-europe (3)
- # clojure-france (1)
- # clojure-italy (62)
- # clojure-nl (8)
- # clojure-spec (26)
- # clojure-uk (40)
- # clojuredesign-podcast (1)
- # clojurescript (3)
- # cursive (2)
- # data-science (2)
- # datomic (10)
- # emacs (2)
- # figwheel-main (1)
- # fulcro (17)
- # graphql (5)
- # hoplon (5)
- # jackdaw (15)
- # jobs (2)
- # juxt (1)
- # luminus (5)
- # off-topic (1)
- # onyx (11)
- # pathom (4)
- # pedestal (1)
- # re-frame (4)
- # reagent (11)
- # reitit (1)
- # remote-jobs (5)
- # shadow-cljs (48)
- # spacemacs (2)
- # specter (4)
- # sql (24)
- # tools-deps (25)
- # vim (82)
Hi there, I just want to prototype something on the front-end only. Is that easy to do with fulcro?
Depends on how quickly you can grasp normalisation /components / idents. See http://book.fulcrologic.com/fulcro3/#_fulcro_from_10000_feet
In F3 I'm doing a load from a button. As a parameter I'm passing a tree of data. i.e. reaching in to other components. This tree is not up to date with the state that I can see in Fulcro Inspect. I can make this tree up to date by pressing a different button that does a mutation that presumably refreshes these 'other component instances'. I can think of ways to try to work around this. But ideally I'd like to 'make sure this tree is refreshed in the UI' before doing the load.
Ah, interesting scenario @cjmurphy. The new optimized render does, in fact, no longer patch the props tree like F2 did. You can switch to the keyframe renderer, and it will behave correctly for that scenario.
well, also: Make sure you force refresh the parent, just like you would in F2. So, when whatever mutation is modifying the child in question, it should queue a refresh for the parent. I did add :refresh
options to support that….so, in fact, it is still workable with the ident-optimized render. I was just hoping that ppl would not need to think about it.
I’ve not had time to performance compare the two renderers, but I do expect that the overall overhead is significantly reduced so that the keyframe render should be fast in most cases.
The entity I'm wanting to have hydrated is a 'rule', and the component that needs the rule (where the button is) is its parent. I thought that keyframe render could help so the fulcro-app has options that include :reconciler-options {:render-mode :keyframe}
. I can do a very small Fulcro application that tests this out.
The functions that are pre-written to do this are in nses under the rendering
package
Thanks for your help Tony. I fixed the problem by using computed and putting the transact! mutation that assembles the rule higher up (closer to the root of) the UI tree, remembering how important the 'this' transact! arg is is for rendering. Beforehand the transact! call was at the same depth on a different branch. No need to move to using the keyframe-renderer.