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
Provide mapping to Chromium versions for Chromium-based browsers #290
Comments
Hm, never thought that Babel just ignore others browsers 😣 In Autoprefixer and other PostCSS plugins we uses Can I Use and support all Browserslist’s browsers. I am not sure that we need to change Browserslist if it is a Babel problem. Maybe we can just add browser to chrome convector to Babel? |
@ai Babel (and possibly eslint-plugin-compat in the future) uses Kangax compatibility table, which doesn't provide data for those browsers. (compat-table/compat-table#1001, compat-table/compat-table#1247) I've opened an issue at babel/babel#8545 to request a feature to warn about them. But for Chromium-based browsers, I think it's better for upstream (Browserslist) to provide a mapping to Chromium versions, as it already has |
There is one problem with adding this mapping to Browserslist. In case of Babel QQ works same as Chrome. But in case of other feature (like payment API) it could work in different way. So with adding it to Browserslist we will make Babel/Kangax life easier, but in other hand we will make life much harder for other Browserslist’s users (like ESLint plugin which will warn you if some of your target browsers don't support JS API). This is why I think that main problem here is Kangax. I will upvote your issue. |
@ai I think we can make the new option |
If we will have this mapping data, patching Kagnax will be very easy. And it will keep Browserslist API free from hacks and avoid other Kangax non-Browserslist users from making the same mistake of ignoring non-white browsers. Why you think you should use it here, but not in Kagnax? |
I am closing it since nobody decided to create a data |
Most tools use only major browsers version to detect features. For instance, Babel (
babel-preset-env
) only usesAndroid
,Chrome
,Edge
,Firefox
,IE
,iOS
,Safari
,Node
versions for detecting which transforms to include. (babel/babel
/packages/babel-preset-env/src/targets-parser.js
#L32-L42).However, there are local-popular or manufacturer-specific browsers (see #250 for their importance) such as QQ browser, Baidu browser, UC browser, Samsung Internet, which are based on rather old Chromium and rarely update its version:
caniuse
refers to, but latest version 8.7 is based on 57Fortunately, 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) acts as a stopgap preventing from excluding transform needed for old browsers. However, if user excludes them, they become
dead
, or their usage drops, they'll recognize as if it targets very modern browsers.Proposal
I think Browserslist should:
electron-to-chromium
mapToChromium
options which adds or substitutes with corresponding Chrome versions.For example,
browserslist('baidu 7.12', {mapToChromium: true})
returns['baidu 7.12', 'chrome 48']
or['chrome 48']
.I'm willing to open a PR.
Alternative
I thought about creating another package for version mappings, but as there are only 7 versions of them
caniuse
provides, and as there is no reliable source other than user agent strings collected by analytic companies, it needs community contribution. (Only reliable source I can find is Samsung Internet release notes, but even it doesn't have latest versions.)The text was updated successfully, but these errors were encountered: