shadow-cljs

borkdude 2025-09-25T15:18:49.397059Z

Reloading question. if you have the following require chain: ui -> resolver -> transform and not ui -> transform directly and you made a change in transform, resolver would reload, but ui would not - does that make sense? I would perhaps expect that ui would also reload, although technically it shouldn't have to since when you re-define only one mutable namespace object, all the rest should see the differences when functions being called. but with that reasoning, resolver itself shouldn't have to reload either. so I'm kind of puzzled by this

thheller 2025-09-25T15:30:49.322789Z

the logic stops at resolver yes. with the reason being that you may make a change in transform, e.g. rename (defn foo [] ...) to (defn bar [] ...). if resolver was not recompiled but still using foo it would get runtime problem. when it does get recompile you at least get a compiler warning/error. ui doesn't have a require, so doesn't use anything from transform directly and thus doesn't need to be recompiled

thheller 2025-09-25T15:33:07.562799Z

(note that this behaviour is specific to shadow-cljs. figwheel does still do the entire chain I think)

thheller 2025-09-25T15:38:58.561859Z

note that when it comes to reloading you can set :devools {:reload-strategy :full}. that does reload the entire chain, but still doesn't recompile ui still

borkdude 2025-09-25T15:50:42.248659Z

thanks for the explanation

thheller 2025-09-25T16:38:41.903349Z

note that not too long ago I slightly adjusted this logic to account for macro expanded code

thheller 2025-09-25T16:39:03.299249Z

so, if for any reason ui does actually use something from transform directly it will get recompiled

thheller 2025-09-25T16:39:28.030249Z

could be coming from a macro emitting a fully qualified symbol or just the code itself using something directly

thheller 2025-09-25T16:39:57.398199Z

so the direct require isn't the only "link"

thheller 2025-09-25T16:41:26.903359Z

https://github.com/thheller/shadow-cljs/commit/3da9880ca86666bbdb0e49b43034973789141c05 actually been much longer ago than I remembered. so been like that for a while now.