shadow-cljs

Harold 2025-11-05T20:45:41.210519Z

Sorry if I'm dense and I've missed it, is it possible to start both a watch of one build and a separate node-repl with a single command-line invocation?

thheller 2025-11-06T08:19:19.364789Z

I hope you are not typing into the actual node-repl prompt and rather use your editor?

1
thheller 2025-11-06T08:19:58.711819Z

if so your editor is likely using nrepl to connect, which you can use to do all sorts of things, such as starting a node-repl without it needing to be started from the command line

Harold 2025-11-06T16:17:47.692019Z

Oh wow, if I understand you correctly (and this seems to be the case from a quick try) I can just start the webapp (browser) build watch in a single terminal, and then use my editor (emacs + CIDER, fwiw) to fire up a separate node-repl on the same shadow server?

Harold 2025-11-06T16:24:57.135779Z

I certainly had the wrong mental model of what was going on, thank you for this step of my enlightenment.

thheller 2025-11-06T16:31:44.600929Z

yes, heck you don't even need to start the watch from the terminal. npx shadow-cljs clj-repl or just npx shadow-cljs server will just start the server (including the nrepl server)

thheller 2025-11-06T16:32:08.370199Z

when connected to that you can do (shadow.cljs.devtools.api/watch :the-build {}) to start a watch

thheller 2025-11-06T16:32:25.497219Z

and (shadow.cljs.devtools.api/node-repl) to start the and switch the node repl

thheller 2025-11-06T16:37:19.761619Z

oh and all of of of course also via http://localhost:9630 😉

Harold 2025-11-06T16:41:00.894669Z

I've learned a lot, thanks 🙇

Harold 2025-11-05T21:21:40.386709Z

currently I'm starting the node-repl in one terminal, waiting for the server to boot, and then starting the watch in a second terminal (which starts very fast because the awesome server is being found).