Fork me on GitHub
#shadow-cljs
<
2024-01-07
>
Aron04:01:06

I have an edn file that I am loading in a macro dynamically (the name of the file is passed to the macro) and that macro is used in 2 builds. When I edit the edn file, the changes are not picked up, even if I add

:build-options {:cache-level :off}
to both builds and all namespaces to :cache-blocker If I remove .shadow-cljs and builds directories both, and then recompile everything then it works I am open to alternative approaches, like not using .edn file, but the file needs to be dynamically loaded in a macro. Is this even possible to be configured correctly, I wonder?

thheller08:01:22

or set the analyzer data yourself, in the same way that function does

Aron10:01:43

looks exactly what I need, thanks. Need to figure out how to use it because naively replacing slurp with slurp-resource doesn't yet change the behavior. Likely I am doing something wrong (again).

thheller11:01:50

if you post the macro I can comment, otherwise you are on your own 😛

Aron11:01:40

Thanks, I want to try first a bit to understand alone, otherwise I will forget if you just give me the solution 😄

Aron11:01:28

https://github.com/rauhs/hicada/blob/master/src/hicada/compiler.cljc#L416 this one though, essentially I am just finding a file and passing it to this

Aron12:01:30

actually, rc/inline works fine of course I just had a very convoluted way to add the namespace to the path and that needed removing thanks again

Aron12:01:08

first I broke the code 3 times 😄

Aron15:01:10

now if I can make hot-reload work with react renderToPipeableStream + hydrateRoot, that will be the best 😅

Aron22:01:08

it works! 🥳