Fork me on GitHub
#shadow-cljs
<
2024-02-12
>
zeitstein13:02:44

Is there an easy way to force recompile or require of all cljs files from the REPL?

zeitstein13:02:38

I'd like to use cljs.test/run-all-tests and want to make sure it picks up the latest code.

zeitstein13:02:47

Basically a nicer way to do:

(require ns1 :reload)
(require ns2 :reload)
...

zeitstein13:02:17

Can I trigger the build with this flag from the REPL? I'd prefer not to stick this in shadow-cljs.edn.

thheller14:02:49

sorry, missed this. no there is no way to do this from the REPL

thheller14:02:08

unless I guess you run against a build with a running watch, then this is ensured by that with no reloading required otherwise

zeitstein15:02:16

A macro emits code based on a (library) var. Need to trigger a reload after changing that var's value (clj-side). So, I don't think watch picks it up 🙂 Thanks!

thheller16:02:52

this is rather dangerous things to do, since it completely messes with the caching logic. make sure you disable cache for namespaces using that macro, as shadow-cljs won't see it and may think it can use the cache

👍 1