Conversation
Contributor
If we mock |
Owner
Author
|
@nicolo-ribaudo I was thinking about something like that, but it looks problematically. |
|
@zloirock awesome stuff, really excited about this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
caniuse,mdnandcompat-tableare good educational resources but are bad data sources for providing only required polyfills for target engines. Onlycompat-tablefrom this list contains at least some useful data and at this moment it's used inbabel-preset-env, however, it's limited:compat-tablecontains data only about ECMAScript features and proposals, not about web platform features. So, for example,babel-preset-envadds all web platform features fromcore-jseven in environments where they are supported.core-jscontains also fixes for broken implementations, butcompat-tabledoes not contain any information even about serious bugs in engines (for example,Array#reversebroken in Safari 12).compat-tablecontains only some basic and naive tests, they do not show that features work even basically as should. For example, old Safari have broken iterators without.nextmethod, butcompat-tableshows them as supported because just check thattypeofof methods which should return iterators isfunction. Some features like typed arrays are almost completely not covered.compat-tableis not designed for providing data for tools, some of the restcompat-tablemaintainers against of maintaining this functionality.So let's provide data about the necessity of
core-jsmodules for target engines.This PR contains:
core-js-compatpackage with data about the necessity ofcore-jsmodules and API for getting a list of requiredcore-jsmodules bybrowserslistquery.core-jsfeature detection - we can't add the fullcore-jstest case to runtime, but those tests overlap the rest - for eachcore-jsmodule.core-js-builderpackage for allowingtargetsoption withbrowserslistquery.Feel free to test and provide data / mapping for missed engines.