fulcro 2024-10-26

Jakub HolĂ˝ (HolyJak) 2024-10-26T19:57:08.454439Z

I am debugging a RAD app and set a breakpoint on all exceptions and I see than in use-fulcro the (isoget js-props :fulcro$app) is failing b/c js-props is null 🤯 All props are undefined, only faux-class = BodyContainer . I suppose this indicates a problem? The parent frame is the BodyContainer class, with props `js-props__49202__auto__: undefined, props__49205__auto__: undefined, ...` . We get there from comp/fragment where we run (apply react/createElement react/Fragment (clj->js props) (force-children children)) with children=() and props that seem to be the exact value of a form’s fo/subforms (I am troubleshooting a weird react error I add when trying to show a subform)

Jakub HolĂ˝ (HolyJak) 2024-10-26T20:05:55.522149Z

If I remove fulcro-troubleshooting’s render-middleware then I get a different error, so I will focus on that one…

Jakub HolĂ˝ (HolyJak) 2024-10-26T20:09:01.990629Z

Ok, React’s throwOnInvalidObjectType is throwing b/c it is asked to render something that is not a string or component, namely it is Clj data that looks as the fo/subforms first entry (i.e. a [<first key> <first value>] )

Jakub HolĂ˝ (HolyJak) 2024-10-26T20:12:40.332279Z

Mystery solved: it was misplaced } so that I ended up with

(defsc-form ...
  {opts...}
  fo/subforms {...}) ; this is inside the body!!!
(Indentation in the file was messed up so it was hard to see)

In the Fulcro RAD book, there is a phrase: > Normalization can be expensive for large reports. Denormalize reports that don’t share info with forms. This can save many seconds of processing if you have thousands of data points, will also affect rendering speed if you are doing something like a chart. I think I know what denormalizing a query is, but how does exactly does one denormalize a report? Thank you!!!

You don't normalize it in the first place. I.e. query for a prop without a join, but in the server return all the report data

This so cool, @tony.kay — he built a version where you can… well, tough to describe…. modify the render functions so that you can basically access your entire app thru the CLJ repl. You can hiccup as the output of what would be rendered in the click, and you can click on elements, and trigger the transactions. https://www.youtube.com/watch?v=JhF-_yRI5cE

👍 1
đź‘€ 1
Jakub HolĂ˝ (HolyJak) 2024-10-26T17:46:06.659669Z

Thanks for sharing! This is really awesome. I imagine it could be really a great starting point for learning…