Fork me on GitHub
#helix
<
2023-07-13
>
Jan K20:07:26

Is there some support for server-side rendering in Helix?

Jan K20:07:46

Did a search and I don't suppose anything changed since around April, so guess not.

hifumi12320:07:13

you can always use React’s built-in server side API

hifumi12320:07:37

this will require your frontend server to run in node.js, but IMO its far better than pretending to render react components in the JVM

Jan K20:07:49

I see, thanks. I don't think I want to run node.js though. I'm migrating from Rum and would prefer some SSR support like UIx has.

hifumi12320:07:17

Helix also does SSR, you are confusing SSR on the JVM with SSR in general

hifumi12320:07:36

if you would like to do SSR on the JVM then you would essentially have to recreate React in Clojure (or Java)

hifumi12320:07:46

this can lead to a bunch of hydration mismatches and subtle bugs so I do not recommend it

hifumi12320:07:01

its always better to stick with the official React Server API or use a framework built on top of it (like Next.js)

hifumi12320:07:21

with that said, UIx2 has some support for SSR on the JVM, but again, beware hydration mismatches, and not all hooks are supported IIRC

Jan K20:07:25

I'll have to look into this deeper and experiment, thanks for the pointers.