Is there a way to get hot-reload and a repl to a :node-script target?
I'm experimenting with a server that needs to run on node, I could get the server to compile with: npx shadow-cljs -d cider/cider-nrepl:0.51.1 watch :app :server
That generates the server js file but doesn't run the server.
If I do separately run node path/to/server.js it will start a server, and a :server repl I can connect and print to. Good.
Now if I do save that file there's no hot reload, I could use nodemon path/to/server.js and that would hotreload the whole node process, losing the internal state.
Is there a good way to get a clojure-like experience with a node server?
https://code.thheller.com/blog/shadow-cljs/2019/08/25/hot-reload-in-clojurescript.html
if you have a REPL then there is hot reload
what you might be missing is the :dev/after-load hook
ah thank you! I was using :after-load rather than :dev/after-load !
One thing that it's not clear to me is where the server repl is running from. I guess it's not from npx shadow-cljs... but rather from node path/to/server.js correct?
This seems useful to know to fix a related problem I have with calva not switching between the two repls
https://clojurians.slack.com/archives/CBE668G4R/p1750501328074719?thread_ts=1750499391.908279&cid=CBE668G4R
both really
https://shadow-cljs.github.io/docs/UsersGuide.html#repl-troubleshooting
you can switch repls via (shadow.cljs.devtools.api/repl :app) or :server. switches the CLJ REPL to CLJS for that build. :cljs/quit switches it back to CLJ
not the slightest clue how calva handles any of that though
Will investigate, thank you!!