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

Define fallback exports for @babel/runtime on old Node #12877

Merged
merged 2 commits into from Feb 23, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 23, 2021

Q                       A
Fixed Issues? Fixes #12871
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Conditional exports have been introduced in Node.js 13.7.0. Previous Node.js versions still read the exports field in package.json but throw when they see conditions.

This PR adds a fallback (using the array exports "syntax"): older Node.js versions will fail loading the conditional exports, and fallback to the second array entry.
There is comment in the build script that explains it.

@guybedford I'm sorry to ping you, but I just learned this by experimenting and reading the docs. Is my understanding correct? 😅

@nicolo-ribaudo nicolo-ribaudo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Feb 23, 2021
@babel-bot
Copy link
Collaborator

babel-bot commented Feb 23, 2021

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

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 23, 2021

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 ea6e63a:

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

@guybedford
Copy link
Contributor

Yes, this approach would cover Node.js 13.0 - Node.js 13.6. 12.X and 14.X are all fine here though. 1believe these support ranges should be possible to ignore within the next few months ideally though as it's not an LTS version.

@nicolo-ribaudo
Copy link
Member Author

I believe these support ranges should be possible to ignore within the next few months ideally though as it's not an LTS version.

Yeah, in Babel 8 (right after Node.js 10 goes EOL) we'll drop non-lts versions (except for 15).

@nicolo-ribaudo nicolo-ribaudo merged commit ac7ac54 into babel:main Feb 23, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the runtime-the-final-fix branch February 23, 2021 17:32
This was referenced Mar 5, 2021
@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 May 26, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: regression outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

do not define a valid './helpers/interopRequireWildcard' target error
4 participants