-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core-js@3 adds es.promise when esmodules target is set to true #565
Comments
Sorry, I do not completely understand your issue. What do you mean by "it doesn't include"?
I can say more:
I'm one of |
I updated the above issue a bit but I think you're right. It's a duplicate indeed. This makes me to believe that we might need to update the usage property inside Thanks for the fast answer! maybe add one of the issues to the compat json so you don't get this issue over and over 😛 |
|
Feel free to add a PR -) |
sweet, I thought it only worked for transforms! Oh will definitly create a PR! 👍 |
When using
@babel/preset-env
with core-js@2 it doesn't include es.promise when we set the target options toesmodules: true
.Core-js@2 target list:
https://github.com/babel/babel/blob/a596da28220b69df6265192d1ca788e6b9ca67aa/packages/babel-preset-env/data/corejs2-built-ins.json#L947-L957
When switching to corejs 3. es.promise is being added as a polyfill because it's browser compat is different from version 2. This makes esmodules=true pretty useless. It seems like promises are pretty flawed because of a bug in v8 but not sure why safari 11 is targetted. I wonder if we should lower it for the sake of keeping esmodules valuable. With es.promise set, no one is going to use the esmodules shorthand.
core-js/packages/core-js-compat/src/data.js
Lines 691 to 695 in b843714
The buug in v8: https://bugs.chromium.org/p/chromium/issues/detail?id=830565
I think core-js should stick to compat tables and not care to much about browser bugs but that's just my opinion.
Another option might be to add an option to @babel/preset-env to disable checks for browser bugs. Whenever a new bug comes up we might need retarget these polyfills to chrome 75 and lots of browsers will get unecessary polyfills.
The text was updated successfully, but these errors were encountered: