Skip to content
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

Use chrome data when android is absent #10790

Merged

Conversation

@JLHwung
Copy link
Contributor

JLHwung commented Dec 2, 2019

Q                       A
Fixed Issues? Fixes #10789
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

In this PR we introduce a getLowestImplementedVersion which adds chrome support data as fallback when android support data is absent, by doing preset-env would not introduce unnecessary transforms for Android >= 52, which should share the same features sets as Chrome >= 52.

The previous behaviour is revealed in this CI failure. This behaviours renders settings like last 2 versions unusable and preset-env will thus apply all the transforms.

Copy link
Member

zloirock left a comment

@nicolo-ribaudo

This comment has been minimized.

@zloirock

This comment has been minimized.

Copy link
Member

zloirock commented Dec 2, 2019

The existence of any android versions greater than 4.4.4 in browserslist looks like a bug.

@JLHwung

This comment has been minimized.

Copy link
Contributor Author

JLHwung commented Dec 2, 2019

According to the caniuse description, the android whose version are greater than 4.4.4 refers to Android 5-6.x WebView. We could propose to add a new android-webview agent to caniuse-db but I think a single android works fine here as long as the version does not overlap with Android Browser.

My first approach was somehow similar to core-js-compat: map android >= 36 to chrome >= 36. But I realize that it would make queries like android >= 4 converted to { android: "4.0.0", chrome: "76.0.0" } so I switch to current implementation.

@zloirock Wouldn't current approach in core-js-compat map android 5 to chrome 5? I think we should emit warnings for 5 <= android < 30 in which both WebView and Android Browser are not available.

@zloirock

This comment has been minimized.

Copy link
Member

zloirock commented Dec 2, 2019

@JLHwung browserslist will throw an error on android 5, so not.

For Android 5+ Chrome and WebView we have and_chr -> chrome.

See kangax/compat-table#801

@JLHwung JLHwung force-pushed the JLHwung:use-chrome-data-when-android-is-absent branch from 96be294 to 7402a40 Dec 4, 2019

Using modules transform: auto

Using plugins:

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 4, 2019

Author Contributor

The plugins listed here is generated from a sort-of modern browserslist configuration. It can help us prioritize bug fixes in the current transforms. because these plugins are expected to be used for a longer time than other standard transforms.

@JLHwung JLHwung force-pushed the JLHwung:use-chrome-data-when-android-is-absent branch from 7402a40 to 064852f Dec 5, 2019
@JLHwung JLHwung force-pushed the JLHwung:use-chrome-data-when-android-is-absent branch from 064852f to 3a6d351 Dec 30, 2019
@JLHwung JLHwung force-pushed the JLHwung:use-chrome-data-when-android-is-absent branch from 8f34d63 to 24803c0 Dec 30, 2019
Using targets:
{
"android": "77",
"chrome": "77",

This comment has been minimized.

Copy link
@JLHwung

JLHwung Dec 30, 2019

Author Contributor

Recently the chrome 49 usage just drops to 0.5% and therefore excluded from browserslists defaults > 0.5% now.

@JLHwung JLHwung merged commit 03d163a into babel:master Jan 3, 2020
4 of 5 checks passed
4 of 5 checks passed
build (13.x)
Details
test262 Workflow: test262
Details
Travis CI - Pull Request Build Passed
Details
build-standalone Workflow: build-standalone
Details
e2e Workflow: e2e
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
You can’t perform that action at this time.