Fork me on GitHub
#shadow-cljs
<
2024-02-13
>
cap10morgan20:02:12

I'm running into an issue using an externs.js file (for a JS library) where I get a lot of errors about needing to be in at least ES-2015 mode to support things like const and class. I see a lot of those in example externs files for the Google Closure compiler, but shadow sets this when it ingests them: https://github.com/thheller/shadow-cljs/blob/5f859cd9244977daf10aa38c4419b68ed7fe872f/src/main/shadow/build/closure.clj#L1047 ...is there a reason to set such an old version? It seems like it's rejecting externs files that should be valid (e.g. https://developers.google.com/closure/compiler/docs/externs-and-exports).

cap10morgan20:02:09

and changing that to :ecmascript6 seems to make everything work as expected

thheller21:02:05

I don't actually remember why this is so old. I guess because I assumed externs files only use old syntax

thheller21:02:26

makes no difference whatsoever if a externs file has const or var

thheller21:02:51

I mean no problem to bump this but you might be overthinking your externs file 😛

thheller21:02:09

fixed in 2.27.4

cap10morgan21:02:16

awesome, thanks!

cap10morgan21:02:30

yeah, I don't even remember where this externs file came from originally haha