shadow-cljs

migalmoreno 2026-02-11T13:40:56.578419Z

Hi, wondering if someone knows of a way to hot reload locally-installed NPM packages (installed via npm install --no-save ../path/to/lib or npm link) in shadow-cljs. I'm using a personal TypeScript UI library from a shadow-cljs app and I'd like to be able to make changes to it locally and see them in my shadow-cljs app, without having to restart the shadow-cljs server. I found https://github.com/thheller/shadow-cljs/issues/759 but it has been closed for some time

migalmoreno 2026-02-18T10:59:08.705439Z

Yeah sorry, I was just throwing it out there to see if you noticed something similar, since it's mostly to do with the recompilation on npm package.json changes. Hot reload of cljs files is almost as fast as before, it's the recompilation on package.json modifications which is a bit laggy (~3-4s more than a normal recompilation). Will do a bit more digging next week and report back. Cheers

migalmoreno 2026-02-17T12:32:39.281279Z

Hi @thheller would it be possible to limit the watch of package.json to only certain packages under node_modules/

migalmoreno 2026-02-17T12:33:14.345189Z

I've noticed that on 3.3.6 recompiles are a bit slower so I assumed it might be due to it watching over all packages

thheller 2026-02-17T13:40:30.757139Z

define a bit slower? and is it actually recompiling files from node_modules/? otherwise I don't see how this would slow down anything

thheller 2026-02-17T13:42:47.365859Z

also you said you were on 3.2.1 before, so what makes you say it was the 3.3.6 update specifically?

thheller 2026-02-11T15:15:28.618069Z

> However shadow-cljs still checks the package.json files of the packages and if those are modified will trigger a re-compile. So it will still detect new npm install versions. So you could touch node_modules/your-package/package.json after making changes in your JS?

thheller 2026-02-11T15:15:55.524179Z

that should still work. which version are you using? it was broken for a while

migalmoreno 2026-02-11T15:22:50.187739Z

3.2.1

migalmoreno 2026-02-11T15:26:19.436659Z

> So you could touch node_modules/your-package/package.json after making changes in your JS? I just tried this but nothing happened. I have to recompile/restart the server for the changes to have effect

thheller 2026-02-12T09:32:35.220799Z

hmm yeah the npm reload didn't work at all. fixed it in 3.3.6. still just watching the package.json files though, but touching them should now invalidate and recompile the entire package

migalmoreno 2026-02-12T16:40:55.234689Z

Can confirm it now works fine 👍 thanks a lot!

👍 1