Welcome! Please see the About page for a little more info on how this works.

0 votes
ago in ClojureScript by

Hi,

I am generating html dynamically on the server with hiccup. I am using the include-js macro to add the javascript that has been compiled from clojurescript to the hiccup template. The shadow-cljs cli just watches the clojurescript and just compiles the javascript.

But when I use this approach I lose all the interactive programming that I have if I am using shadow-cljs with a statically rendered html file.

Is it possible to get interactive programming with clojurescript where one evaluates expressions on the fly with a repl when using shadow-cljs while generating the html dynamically.

I am assuming shadow-cljs is adding some interactive javascript to the statically rendered file that will make it possible to get the interactivity one wishes to get. Is it possible to add that missing piece to html that one is generating themselves?

1 Answer

0 votes
ago by

Static vs dynamic HTML doesn't matter - CLJS doesn't care about that. All that matters is that the compiled CLJS code can connect to the WebSocket endpoint that the shadow-cljs watch process creates.

With that in mind, it's hard provide any actionable advice without knowing exactly what's going on in your project. If you can create a public minimal reproducible example, I could take a look.

...