shadow-cljs

ns 2025-03-06T18:16:49.022989Z

thheller 2025-03-06T19:37:57.938879Z

which shadow-cljs version do you use? I vaguely remember something like this being fixed a rather long time ago?

thheller 2025-03-06T19:38:00.545729Z

I don't know the context of this error? is it happening in some npm code or on the CLJS side?

thheller 2025-03-06T19:38:38.503969Z

could be that the default :output-feature-set is just not high enough

thheller 2025-03-06T19:38:51.516669Z

maybe try wiping the .shadow-cljs/builds folder to clear caches

ns 2025-03-06T19:39:34.271249Z

Hi, I was using 2.15.2 and in the meantime I found your message where you mention fix with js-options in version 2.16.4 and I'm trying to switch to it and deploy project as we speak

ns 2025-03-06T19:39:54.515439Z

The only thing I'm actually unsure of is where to actually put the js-options

thheller 2025-03-06T19:40:21.863209Z

just into the build config? doesn't need to be in :dev or :release if it applies to both

ns 2025-03-06T19:40:51.549679Z

This is happening while trying to use react-virtuoso npm package version 4.12.5

thheller 2025-03-06T19:41:35.939309Z

where it goes kinda depends on where it is needed. if its in some npm code then :js-options, otherwise :compiler-options

thheller 2025-03-06T19:41:47.831239Z

but it shouldn't be used manually either way 😛

thheller 2025-03-06T19:42:16.115189Z

but in those old versions you mentioned the closure compiler sometimes didn't correctly detect some used polyfills

thheller 2025-03-06T19:42:21.567779Z

so the fix is upgrading 😛 not working around it via :force-library-injection

ns 2025-03-06T19:43:06.491619Z

Ok, at the moment it sits in release section, like this:

:release
   {:asset-path "/assets/js/compiled"
    :js-options {:force-library-injection #{"es6/util/makeiterator"}}
    :build-options
    {:ns-aliases
     {day8.re-frame.tracing day8.re-frame.tracing-stubs}}}
Weird thing is that in dev section it worked with compiler options but in release it didn't, like this:
:dev
   {:asset-path "/js/compiled"
    :compiler-options
    {:force-library-injection #{"es6/util/makeiterator"}....

thheller 2025-03-06T19:43:20.884549Z

those old versions also had a rather low :output-feature-set :es6 which makes no sense unless you are actually writing code for 10 year old browsers 😛

thheller 2025-03-06T19:43:59.942239Z

delete :force-library-injection from your mind. it never worked properly. just forget it exists and move on.

thheller 2025-03-06T19:44:45.731259Z

it was a hacky work around for a problem in the closure compiler. it was temporary and is fixed nowadays.

thheller 2025-03-06T19:45:22.330869Z

it literally injects a polyfill for code that has been supported by browsers since before 2015

thheller 2025-03-06T19:45:32.051079Z

that is not useful today.

ns 2025-03-06T19:45:46.976309Z

Ok, I'll forget it. 🙂 The code I'm writing is an admin system doesn't need to support very old browsers, so I really should invest little time in bringing shadow up to date.

thheller 2025-03-06T19:46:18.457799Z

you can just set :compiler-options {:output-feature-set :es-next}, which essentially just disables all polyfills

thheller 2025-03-06T19:47:17.629149Z

(that even works with the old version I believe)

ns 2025-03-06T19:51:30.492759Z

Ok I will, thank you for your help, really apprecitate it!

ns 2025-03-06T18:16:52.299879Z

Hi, I'm getting ("Uncaught TypeError: $jscomp.makeIterator is not a function") error and I found out from one of the messages that I have to inject makeIterator during build process. I managed go get it working for local development but I cannot get it working for release version. Any help is really appreciated. My shadow build config is attached above. Thank you!