Re-frame/clojurescript embedded in server rendered pages

Does anyone do this? I’ve done it with Elm (and plain ole JS as most of you probably have) and it works great for getting code into an existing codebase that is a server rendered application (Rails, Phoenix, Django, etc). I’m not against SPA’s but I’m also not a fan of SPA’s for every website in particular CRUD type apps that have simple user interaction for most cases. But it seems in my searching that most of the information about clojurescript is discussed in the context of using it for SPA’s.

Just wondering if that’s because cljs/re-frame isn’t a good fit for that sort of application (server rendered HTML with dynamic bits handled with clojurescript/re-frame component embedded) or that nobody is really blogging, discussing it anywhere. From my little bit of looking at reframe it appears you can embed a component into the DOM?

I like the Elm architecture a lot but it has some issues that don’t really work for me in some cases. Re-Frame appears to be similar to the Elm Architecture but with a better interop story and I’d like to start learning it but I don’t have any SPA work pending or on my roadmap and don’t have time to just build one for “fun” at the moment.

Thanks for any intel on this!

1 Like

I bet someone could make a wrapper around Turbolinks/Stimulus to do something like that. The recent blog post about Stimulus seems interesting to me. It has felt to me like writing SPAs for mobile devices made developers wrestle with unnecessary performance problems (or even desktop).

Most of the http libs in Clojure seem to support pre-SPA. It just seems like most of the open source work lately is all about SPAs and REST.

Specifically for React, it seems Rum may be what you’re looking for.

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.