ember-cli-babel
ember-cli-babel copied to clipboard
Array.prototype.flat polyfill is missing
Hello, I'm using "ember-cli-babel": "^7.7.3"
array.flat in Edge browser throws an error, while array.flatMap is working.
may be related with:
https://github.com/babel/babel/issues/9749
I confirm. Looks like there is no polyfill for that
Babel polyfill has been deprecated. (https://github.com/babel/babel/tree/master/packages/babel-polyfill)
We should upgrade this package to use core-js explicitly.
@rwjblue any plans moving to core-js 3? :)
I haven't really looked into it much, but off the cuff I would think that we would follow suit with Babel and remove the polyfilling.
Folks would then use something like ember-auto-import to get these polyfills like the @babel/polyfill site suggests.
@rwjblue - we just hit the same issue (flat missing). I don't understand your comment - is there something we can do right now as users or we have to wait for ember-cli-babel to be updated?
Also curious if there is something that could be done now
One option is to use https://github.com/pzuraq/ember-cli-babel-polyfills, just updated it to use the latest core-js and confirmed it has Array.flat, plus it ensures that the polyfills are only included in legacy browsers by using nomodule, so modern users don't pay the cost 😄
Awesome. Yep that's the solution :)
That gets flat in (via core-js/stable), if I was interested in all the esnext stuff as well, should I just be importing core-js myself? Or might that be something ember-cli-babel-polyfills or eventually ember-cli-babel may support?
Going to close this as polyfill support was removed in v8.