Fork me on GitHub
#shadow-cljs
<
2023-05-04
>
James Amberger02:05:59

is there a global event that fires when watch rebuilds? so I could do, eg,

window.addEventListener("compiled", fn)
in some js code?

James Amberger21:05:39

Thanks @U05224H0W but what if this is in a .js file?

thheller06:05:12

do you not have any cljs files? what kind of .js file do you mean?

James Amberger19:05:11

As per your https://shadow-cljs.github.io/docs/UsersGuide.html#classpath-js I am including a js file so a collaborator can export certain React components.

thheller20:05:20

ok, and why does that file need the callback?

James Amberger16:05:34

I... don't remember

thheller06:05:55

(defn ^:dev/after-load compiled! [] ...)

simon16:05:57

Sorry if this is the wrong place to ask, I'm not sure to which part this is related to. I'm getting a bunch of errors in the browser by just requiring ["@react-pdf/renderer" :refer (Document)] , with the first error being [Error] SyntaxError: Unexpected token ','. Expected opening '{' at the start of a class body. Has anybody seen this before?

thheller16:05:32

the pdf libs are notoriously bad at working with build tools, could be that it includes some code that shadow-cljs doesn't process properly

simon16:05:44

thanks for the quick answer! I'll look into generating the pdf on the server then

kanwei20:05:47

is there a way to put a value into a CLJS file based on an ENV variable? we're doing some encryption stuff that involves public keys, and we'd like to basically inject the public key as a var in a CLJS file, getting the value on compile time instead of hard coding the value in the code