Fork me on GitHub
#shadow-cljs
<
2022-08-21
>
aiba18:08:10

That's helpful, thank you. And it seems (:shadow.build/mode &env) is nil when shadow is watching a build and hot reloading a namespace, is that expected?

aiba18:08:53

Actually i'm sometimes getting nil values for (:shadow.build/mode &env) inside macros, even when doing a release build. it's almost like there is some kind of compliation pass that happens which causes macroexpansion before the build environment is set. I also noticed that there are some macroexpansions that happen before the :configure stage of hooks are called.

thheller19:08:48

there can be no macro expansions before :configure. well unless those macros are in .cljc and you do anything in CLJ?

thheller19:08:07

needless to say it is only set for CLJS compilation. otherwise it won't be present, but it should always be present for CLJS code?

aiba19:08:21

Yeah it is in a cljc file, and i have some toplevel constants that are set to like (def foo (my-macro)). in those cases, could my-macro be being called with nil build-mode and before the :configure stage?

thheller19:08:27

there is absolutely no CLJS compilation happening before :configure so no