helix

Jan K 2023-07-13T20:22:26.793659Z

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

Jan K 2023-07-13T20:24:46.790019Z

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

hifumi123 2023-07-13T20:45:13.120229Z

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

hifumi123 2023-07-13T20:45:37.244469Z

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 K 2023-07-13T20:51:49.894539Z

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.

hifumi123 2023-07-13T20:52:17.043629Z

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

hifumi123 2023-07-13T20:52:36.142499Z

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

hifumi123 2023-07-13T20:52:46.409659Z

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

hifumi123 2023-07-13T20:53:01.213709Z

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

hifumi123 2023-07-13T20:53:21.185399Z

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 K 2023-07-13T20:55:25.012649Z

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