-
-
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-compat loose mode #644
Comments
I'm thinking about a not so strict version of |
Let me know if there is anything I can do to help implement it. I think a good place to start would be a version of the core-js-compat data based on caniuse-db and compat-table, which should reduce the amount of polyfills that are needed for modern browser targets. Another one I just came across: |
btw, we're planning on enabling babel's |
|
After much thought and experiments, I think that a loose version of Unlike
You can manually configure the level of aggressiveness if you are sure that it's fine, you can exclude injecting of specified module - but creating something like loose mode will create temptation, which will cause a huge number of problems. So it's better to solve it on the configurable level of aggressiveness and related APIs side. Sure, it requires improvement or reworking, but it's another issue. |
I was compiling some code with babel-preset-env, using the
useBuiltins: 'usage'
option andesmodules: true
target. I noticed that I was getting the promise polyfill even though all modules supporting browsers support promises natively. I found several issues on this repo about that, e.g. #565. The reason on that one seems to be to do with unhandled promise rejection tracking not being supported cross browser, which is a bit different from Promises being supported at all I think.Some other features have super aggressive targets as well, e.g.
array.prototype.map
set to Chrome 51. Seems pretty clear that that has existed natively for many years before that.I understand that core-js is going for 100% spec compatibility and wants to work around edge case browser bugs, but sometimes that isn't necessary for certain projects. I was wondering if something like babel's loose mode could be supported for code-js-compat, with baselines set lower for the targets, not based on browser bugs but based on support. This would result in a much smaller amount of polyfill code being needed most of the time as native support for most ES features is pretty good these days.
Thoughts?
The text was updated successfully, but these errors were encountered: