Fork me on GitHub
#shadow-cljs
<
2022-01-04
>
witek15:01:46

Hello and a happy new year! Is there a way to query the shadow-cljs build id or the build target inside of (defmacro ...)? I have two different builds (one for browser and one for node) and I would like to generate different code from the macro.

thheller16:01:41

no, the build id is not directly accessible in macros.

thheller16:01:23

I guess you can get the compiler env and the set something in :compiler-options similar to how cljs-devtools does

Alys Brooks22:01:45

I'm getting intermittent errors about jscomp.inherit , which has come up on this channel before and apparently it's an issue with correct polyfill loading. I don't know if there's helpful information I can report?

thheller06:01:34

yeah unfortunately this issue is proving very hard to reproduce but reports have been very silent for newer shadow-cljs version. which version do you use?

Alys Brooks21:01:06

I just upgraded to the latest, 2.16.12 in an attempt to fix another issue.

Alys Brooks22:01:39

The release build doesn't seem to have this issue. I don't know if that's a coincidence or if release builds don't have this issue? The project I'm working on is for an event, so ideally release builds would be as low risk as possible in case we have to do a hotfix.

Alys Brooks22:01:03

This probably doesn't help very much but the specific module is goog.iter.es6.js.

thheller05:01:25

which :output-feature-set do you use? ideally you set :compiler-options {:output-feature-set :es8} (or higher if you can). then this error should disappear completely.

thheller05:01:50

if you have a repo to reproduce it that would help a lot in maybe tracking it down

Alys Brooks20:01:33

Sorry for not responding sooner. I'm not sure I can share the repository because it's for a client of ours. Is there a way I can find the code that caused the polyfill to be used? The source mapping doesn't seem to work (although maybe I should try Chrome).

Alys Brooks22:01:33

Unfortunately I cannot simply link to the code, as it isn't open source.