This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-14
Channels
- # announcements (1)
- # beginners (13)
- # calva (2)
- # cider (43)
- # cljdoc (11)
- # clojure (16)
- # clojure-spec (10)
- # clojure-uk (6)
- # clojurescript (7)
- # code-reviews (3)
- # core-matrix (1)
- # datascript (4)
- # datomic (7)
- # devcards (4)
- # figwheel-main (12)
- # fulcro (27)
- # hoplon (1)
- # lein-figwheel (1)
- # luminus (1)
- # nrepl (23)
- # off-topic (4)
- # planck (1)
- # re-frame (8)
- # reagent (7)
- # shadow-cljs (61)
- # spacemacs (7)
- # tools-deps (19)
Hi, working through the form state support. any guidance/tips on using it in devcards
@eoliphant I do things like set up mock networking so I can play full stack without a server
Then you can do your loads and such from started callback in the fulcro cards, etc. See the book demo source
and of course prim/merge-component
is handy for just shoving in instances of something that can then be configured with form data
just released fulcro-inspect jar 2.2.4
and chrome extension updated to 1.0.6
, this updates fixes a bug in the diff algorithm when you have maps that contains maps as keys, thanks for the nice reproducible case @magra!

@tony.kay how bad can the performance impact get of putting every keystroke (i.e. input fields) in the global state atom?
@hmaurer this section of the book talks about it http://book.fulcrologic.com/#_controlled_inputs
it really depends on your use case and application
if your app is well tuned (using union queries etc.) and you’re not doing anything fancy (like live updating a preview on every keystroke (which should be debounced anyway)) then it should be fine
i always default to using app state for inputs and mostly haven’t had issues, (m/set-string! this :ui/query :event evt)
makes it easy
then if and only if it actually turns out to be a performance bottleneck then i try to optimize
if it’s slow i’ve used a combination of key, default-value, and onBlur
(dom/input
{:key title-val
:defaultValue title-val
:placeholder "Ex: foo bar baz"
:onBlur #(m/set-string! this :ui/field :event %)})
this lets you still use app state but the input is uncontrolled and only invokes a mutation on blur
does that make sense?
@currentoor it does; thank you! I’ll read the book section and union queries right away
union queries are tricky to understand at first, i would get one of the examples from the book working in your own source code first, like in a dev card
then use it as a reference when building your own unions
Tony’s done a lot of work to make unions easier with defrouter
, but it still gets me sometimes 😅
Is there a way to register a Pathom parser with the easy server?
Ok. Are there any canonical fulcro+pathom examples? I know there's Walkable's realworld example. Any others?
there is not a lot of secret, pathom will give you the parser, so you just have to create some http handler that gets the query/tx and send to the parser as the second argument
are you having dificulties with some specific part of it?
Ok. Are there any canonical fulcro+pathom examples? I know there's Walkable's realworld example. Any others?
I have a quick question around data loading with Fulcro, when someone knowledgeable passes by: what is the standard way to load different data on different routes? Also, is there a way to load data in a standalone, embeddable component? For example with Apollo (GraphQL) it is fairly straightforward for a component to run a query when it is rendered.
regarding loading data I found this: http://book.fulcrologic.com/#_combining_routing_with_data_management