Skip to content

Server side rendering #31

@luxbock

Description

@luxbock

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions