-
-
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
customizable level of aggressiveness #283
Comments
Generally things in In a normal workflow, I'd expect that the only things that initiate global mutations, like changing |
@loganfsmyth I agree with you on that. But it would be great if core-js had less chances of breaking things, as de facto polyfill library. It is great to have 'strict to the specs' polyfilling mode in case if it is needed, but if it is default and only one, this may cause issues. Polyfilling usual things like Array.from, Object.values, etc in third-party code looks rather reasonable and painless to me, their use is more consistent than non-native substitutes for these operations, and probably better than instructing the users in readme which ES201* polyfills they should have in order to make the code work (this depends a lot on what is the library and which platforms it aims at). Even though variable polyfills (Map, Symbol) are better to be imported from The example is feathersjs/feathers#510 . The package uses |
Sorry, but @loganfsmyth right, it's how polyfills work.
I'll think about it. |
I'm seeing a similar issue with |
Using Bluebird as global
Promise
is quite popular, just because it is good (at error handling in particular) and it is fast.core-js/shim
includes core-js Promise polyfill and overrides any other Promise implementation which it considers as bad. From my understanding of situation, Bluebird doesn't pass@@species
test and thus is being replaced with ES6 Promise polyfill:I'm not sure if
@@species
support for promises is really a feature in demand, but I'm positive that among the developers who use Bluebird as globalPromise
there is no single person who would want to replace it with ES6 Promise polyfill by accident (I've had an unfortunate case before and had to use a descriptor to protectPromise
from core-js).I cannot remember any other core-js polyfill that would be harmful when being accidentally applied, but if the problem may be not specific to
Promise
, can the level ofcore-js
aggressiveness be made customizable (e.g. with environment variable)?Usually I would expect from a polyfill that it will be applied if and only if a variable/method doesn't exist. This is the level of polyfilling that I would call generally desirable, and I was surprised by the fact that core-js applies the polyfills by force on some conditions (like a 'bad' promise implementation), and this cannot be adjusted.
I'm aware of
core-js/library
, so the issue applies to the cases whencore-js/shim
with no cherry-picking would be good, with the exception of the described behaviour.The text was updated successfully, but these errors were encountered: