Fork me on GitHub
#fulcro
<
2019-05-29
>
grzm00:05:30

Were you around when people were frustrated when they were running into issues using just a single element namespace? Like (ns fulcro), not even (ns fulcro.core)

tony.kay00:05:45

came in right on the heels of that I think

exit214:05:32

How does one deal with nested data in a form? (i.e.) {:person {:address {:zip}}, where I want :zip to be a field

nha14:05:11

I see you are interested in SSR @rickmoynihan FYI these are the two things that bit me: - https://github.com/fulcrologic/fulcro/issues/299 - https://github.com/fulcrologic/fulcro/issues/301

tony.kay16:05:32

@njj The book covers nesting components that you want to treat as nested forms for both kinds of form support. The form-state support is recommended, but if you don’t plan to break the elements up into components as described, then it is up to you. Make an input. Show the value. Make a mutation that can change the value. Figure out how you want to encode the delta. The form-state support leverages the component’s knowledge to help with that, but it cannot cover all the possible random cases you might invent. Form-state will only work with nesting if you actually nest components to match your nested data. Or, if it is to-one you could flatten it at the server layer with pathom and make it simpler for the client…no need for it to know anything about the structure in your db.

exit216:05:51

I’ve been doing the flattening recently, it seems to be working fine. I just wasn’t sure if there was some alternative. Thanks Tony!