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

Update to Browserslist 4.14.5 #12241

Merged
merged 1 commit into from Oct 24, 2020
Merged

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 22, 2020

Q                       A
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? browserslist update
License MIT

This PRs updates to Browserslist 4.14, and uses the new supports es6-module query instead of our custom logic to build the esmodules: true query.

I wanted to include this in #12189, but since it's just a small refactoring I moved it to a separate PR.

@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Oct 22, 2020
@babel-bot
Copy link
Collaborator

babel-bot commented Oct 22, 2020

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/30855/

Comment on lines 5 to 12
"android": "61.0.0",
"android": "81.0.0",
"chrome": "61.0.0",
"edge": "16.0.0",
"firefox": "60.0.0",
"ie": "11.0.0",
"ios": "10.3.0",
"node": "13.2.0",
"opera": "48.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory this shouldn't have changed, but:

  • node is removed because Browserslist uses compat-table which doesn't include data for Node.js. It's not a problem, because all the transforms required for Node.js 13.2 are required for the other browsers in this query anyway 🤷
  • android is changed because compat-table only keeps data for the last version. I kind of expected Browserslist to automatically use the Chrome version (like we do in our generated compat data) since we are using the mobileToDesktop: true Browserslist option, but again it's not observable since android 61 is already covered by chrome 61 in these targets.

Copy link
Contributor

@JLHwung JLHwung Oct 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will become a breaking change, if we decide { esmodule: true } should intersect other queries (babel/rfcs#2 (comment)), i.e. B({ esmodule: true }) ∩ B({ android: 78 }) will no longer be B({ android: 78 }) but B({ android: 81 }), where B is the browsers set returned from @babel/helper-compilation-targets. Likewise for node.

@ai I think it is a bug if supports feature query does not respect mobileToDesktop: true

npx browserslist --mobile-to-desktop "supports es6-module"

should contain android 61.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realized that we won't be able to use a Browserslist-based intersection anyway.

Currently targets: ["chrome 30"] resolves to "compile everything down to chrome 30, but targets: ["chrome 30 and supports es6-module"] resolves to an empty set because there isn't any browser that both is chrome 30 and supports esm.

The query should have been chrome >= 30 and supports es6-module, but it given how targets has always being working users probably rely on >= being optional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverted

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 22, 2020

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d7df4c3:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

"firefox": "68",
"firefox": "74",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a change in Browserslist's defaults

@nicolo-ribaudo nicolo-ribaudo changed the title Update to Browserslist 4.14.5 and use their esmodules data Update to Browserslist 4.14.5 Oct 23, 2020
@JLHwung JLHwung merged commit b4ae7b7 into babel:main Oct 24, 2020
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 23, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Dependency ⬆️ PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants