shadow-cljs

2025-10-07T22:05:40.413989Z

I have a shadow-cjs project and want to work on it in two git worktrees. Does anyone have a formula for running the :dev build from each worktree separately. The best I’ve come up with is to just duplicate the config into a :dev2 build with a different :http-port, and :proxy-url

2025-10-07T22:15:54.091659Z

and I don’t think this lets me set a predictable :nrepl :port

thheller 2025-10-08T06:57:18.379969Z

I'm not entirely sure I understand the question, why does it need a separate http-port? is the server different?

thheller 2025-10-09T07:11:16.559069Z

the dev http server is completely optional. all it does is serve the .js files. it has nothing to do with hot-reload or the REPL, thats an entirely separate server that is always managed for you and not configured at all. https://shadow-cljs.github.io/docs/UsersGuide.html#dev-http

thheller 2025-10-09T07:13:34.065739Z

:dev-http or the much older and 10+ years deprecated :devtools {:http-port ...} were always optional and only provided for convenience. any server will do.

2025-10-09T10:41:20.831629Z

Ah, that makes sense then. Thanks.

2025-10-08T11:05:22.223159Z

I would like to have the UI run separately in each worktree, with distinct backends

thheller 2025-10-08T16:17:12.715929Z

so just have those backends serve the .js files?

2025-10-08T17:06:49.555329Z

I must be misunderstanding something. I thought in dev the usual workflow was to use the shadow dev server to serve the javascript.

Hendrik 2025-10-08T20:13:27.301919Z

if you are using VSCode, then you could use dev containers for this.

Hendrik 2025-10-08T20:17:08.948689Z

in theory you do not have to change any ports. in practice you have to forward your frontend ports to different host ports to see two UIs at the same time