Fork me on GitHub

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


the fulcro.server ns has that for the client


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!

🙂 8
bananadance 8

@tony.kay how bad can the performance impact get of putting every keystroke (i.e. input fields) in the global state atom?


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

 {: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 😅

Daniel Hines22:10:24

Is there a way to register a Pathom parser with the easy server?


@d4hines sorry, I wasn’t reading clearly…listen to Wilker

Daniel Hines23:10:33

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?

Daniel Hines23:10:33

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.


however it feels a bit odd to me to trigger a load query as a mutation before transitioning to a new route