preset-env: use Chromium versions for Chromium-based browsers#8552
Open
ylemkimon wants to merge 4 commits intobabel:masterfrom
Open
preset-env: use Chromium versions for Chromium-based browsers#8552ylemkimon wants to merge 4 commits intobabel:masterfrom
ylemkimon wants to merge 4 commits intobabel:masterfrom
Conversation
This was referenced Aug 27, 2018
chicoxyzzy
reviewed
Aug 28, 2018
| "samsung 4": "44", | ||
| "samsung 5": "51", | ||
| "samsung 6.2": "56", | ||
| "samsung 7.2": "59", |
Contributor
Author
There was a problem hiding this comment.
@chicoxyzzy caniuse added Samsung Internet starting with samsung 4: Fyrd/caniuse@16d76e4. Therefore browserslist never returns samsung 3.
Member
|
Feel free to add a mapping for those browsers to |
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.
@babel/preset-envonly usesAndroid,Chrome,Edge,Firefox,IE,iOS,Safari,Nodeversions for detecting which transforms to include:babel/packages/babel-preset-env/src/targets-parser.js
Lines 32 to 42 in e875fc7
and silently ignores other browsers:
babel/packages/babel-preset-env/src/targets-parser.js
Lines 72 to 76 in e875fc7
However, there are local-popular or manufacturer-specific browsers such as Opera Mini, UC browser, QQ browser, Baidu browser, and Samsung Internet. Please see browserslist/browserslist#250 for their importance.
In Browserslist default, fortunately, IE 11, Chrome 49 (usage 0.69%) and Android 4.x (4.4 usage 0.58%, 4.4.4 isn't strictly last 2 versions but is in Browserslist default) acts as a stopgap preventing from excluding transform needed for old browsers. However, if user excludes them, they become
dead, or their usage drops,preset-envwill recognize as if it targets very modern browsers. Also, user may explicitly target them, using Browserslist config.For Chromium-based browsers, we can use their base Chromium versions to detect features, like
electron-to-chromium, as a best-effort basis. This PR adds a mapping for versions that are/were provided by caniuse, of Samsung Internet and UC Browser for Android, which is popular in Samsung devices and China, respectively.