Fork me on GitHub
#fulcro
<
2023-01-06
>
Eva O00:01:02

With the introduction of these RAD hooks, do you recommend new projects lean towards using hooks over class lifecycle methods?

tony.kay05:01:42

In general the hooks approach does seem to be cleaner. I don’t generally use the old component lifecycle methods in new code myself…but YMMV. As far as I can tell React will continue to support both far into the future.

tony.kay05:01:53

The hooks stuff makes disconnected subtrees way easier in Fulcro. I added a defnc (normalizing component) to raw. This takes you one step closer to easy standalone react code that uses a Fulcro subtree with full-stack support, but doesn’t have any opinion at all what you use for actual rendering (other than it is react-based).

tony.kay05:01:17

I mean, you can do non-react as well, but that requires you hook up some kind of mock rendering system to update your “UI” every time Fulcro wants a refresh.

Eva O07:01:13

Ok thanks. I'll start using hooks.

tony.kay17:01:41

The downside of hooks is shouldComponentUpdate, but latest FUlcro adds wrapper for React memo

Eva O07:01:04

Why doesn't date-time/*current-timezone* default to the system default? It seems weird to need to call (dt/set-timezone! (str (zone-id/system-default)))

tony.kay17:01:39

Because a server runs in an arbitrary env where that might not be correct. Assumptions on the part of the library in this case are bad. It might be ok to do so in client code, but it is trivial for you to set it correctly via your own code and decision logic.

tony.kay17:01:05

Also, on a server, you might have users in many zones, so with-timezone is more appropriate.

Quentin Le Guennec21:01:48

Is the fulcro-rad-template expected to work behind a load balancer with multiple instances of the fulcro app? I’m guessing there will be issues with csrf and ring sessions.

Jakub Holý (HolyJak)21:01:31

That sounds about right. You would need to impl some shared session and csfr storage.