You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible to pre-render your application server side with React based wrappers by evaluating your components in Nashorn and calling rendertoString to get the HTML output.
Since Hiccup works just fine on both Clojure and ClojureScript, then it seems like doing server side rendering with freactive should be significantly easier than this. One would just have to port the key API functions such as rx, cursor and atom over to Clojure, and then add an additional function that outputs the Hiccup with everything dereferenced.
I remember that freactive started originally as a JFX wrapper, which I have no experience with. I see that this repository contains code that I assume is related to this background. Would what I'm suggesting cause some conflicts with this JFX work? Might there be some synergy in here, where one could build a JFX GUI and a web front-end sharing the same code base?
FWIW my use case would be sharing components between a Gorilla REPL and a web application. It's not urgent, but I figured that someone else is bound to end up needing this as well, so it's better to think things through earlier rather than later.
The text was updated successfully, but these errors were encountered:
Note: once you go a little further with this, it becomes clear there are some pretty important challenges that would need to be overcome - most importantly on the client you expect to have one "global state" whereas server side you're managing many clients. So (defonce global-state ...) plus a bunch of (defonce some-cursor (cursor global-state...)) will not work with this model... Not sure yet how to get around this.
It's possible to pre-render your application server side with React based wrappers by evaluating your components in Nashorn and calling
rendertoString
to get the HTML output.Since Hiccup works just fine on both Clojure and ClojureScript, then it seems like doing server side rendering with freactive should be significantly easier than this. One would just have to port the key API functions such as
rx
,cursor
andatom
over to Clojure, and then add an additional function that outputs the Hiccup with everything dereferenced.I remember that freactive started originally as a JFX wrapper, which I have no experience with. I see that this repository contains code that I assume is related to this background. Would what I'm suggesting cause some conflicts with this JFX work? Might there be some synergy in here, where one could build a JFX GUI and a web front-end sharing the same code base?
FWIW my use case would be sharing components between a Gorilla REPL and a web application. It's not urgent, but I figured that someone else is bound to end up needing this as well, so it's better to think things through earlier rather than later.
The text was updated successfully, but these errors were encountered: