Add core-js polyfill for lib/browser#2266
Conversation
|
Thanks a lot Michal for working out this solution! I can confirm this indeed solves the issue 👍 The growth of the bundle from 600 kB to 726 kB is huge, that is quite a bummer :( ! It would be nice to see if there are alternative solutions, it's a bit of a pity to have to do this just to support an old browser that is hardly used anymore already. Some ideas:
I'll send you an invite for browserstack so you can test on IE11 yourself too :) |
|
Turns out I misunderstood the Babel documentation (or it's wrong, idk). The option Is 40 kB increase of bundle size acceptable, or should I investigate other options? This increase should only affect people who use |
|
I can confirm that it now works fine in Firefox 16. |
woohoo 🎉 that's good news! 40 kB increase is a serious amount, but I think it's acceptable. Like you explain it's only for people importing the bundled version, and those people probably do not want to have to worry about adding polyfills themselves and just want it to "work". Also, there is an escape: you can import the ES or CommonJs version, to do the bundling yourself with/without any polyfills (depending on the browsers you need to support). I'll merge your fix now, thanks again for working this out! |
|
@m93a shall we switch to use Nodejs 16 and npm 7 during development? Then the |
|
Fix published now in |
That's a good point, we should coordinate to use the same version of Node :) I don't have strong feelings about which version to use, Node 16 sounds good to me 👍 |
|
Okido! |
|
lock file is upgraded now, see f048e2c |
* added core-js polyfills for lib/browser/math.js * exclude defaultInstanceCorejs from lib/esm and lib/cjs * removed a semicolon * changed useBuiltIns to usage Co-authored-by: Jos de Jong <wjosdejong@gmail.com>

This PR injects all necessary core-js polyfills into
lib/browser/math.js. This should fix #2245, however I couldn't check it since I don't have a Windows machine.useBuiltInslib/browser/math.js, the CommonJS and ESM exports are unaffectedwindow.SymbolandArray.fromwill be defined)lib/browser/math.jsby126 kB40 kB (from 600 kB to726 kB640 kB)How I tested it: