Fork me on GitHub
#reagent
<
2018-05-05
>
tatut09:05:35

Does anyone have a working SSR solution with JVM backend? What’s the current state of the art.

tatut09:05:52

I tried with Nashorn (won’t load, complains about Map an ES6 feature), Rhino (NPE while compiling the JS source), J2V8 and clj-chrome-devtools require external native components

juhoteperi09:05:13

Node works, no idea about JVM solutions. Probably doesn't work currently. Best solution could be to implement Reagent-hiccup renderer in Clojure, similar to what Rum does: https://github.com/tonsky/rum/blob/gh-pages/src/rum/server_render.clj, that would require trying to run React in JVM.

tatut09:05:00

Yes, but that doesn’t work if you use 3rd party JS React components

tatut09:05:10

how would a server side renderer know what markup they generate?

juhoteperi09:05:56

Nashorn should have ES6 features in Java 9 or 10, so maybe that would help with running React there

tatut09:05:20

Yes, I think I’ll try a later JDK… if I get it working, I’ll blog something about it

juhoteperi09:05:46

And React 15 might work, I think they started using those features in React 16

tatut09:05:29

Oh, ok… I’ll try that too

grav16:05:30

Anyone played around with proton-native? Wonder how it fairs with Reagent https://proton-native.js.org/#/?id=proton-native