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

Remove ./helpers/esm exports from @babel/runtime and drop Node.js 13.0-13.1 #16346

Merged

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 12, 2024

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

They are not actually needed anymore, given that we use exports with an import condition. They are there just because Babel emitted /esm/ imports when using useESModule: true, before that package.json#exports was a thing.

This PR also simplify the conditions object, and as a side effects drops support for Node.js 13.0 and 13.1. In general I'd like to keep @babel/runtime as maximally compatible as possible, but this should be fine.

Now package.json is like this:

  "exports": {
    "./helpers/AsyncGenerator": {
      "node": "./helpers/AsyncGenerator.js",
      "import": "./helpers/esm/AsyncGenerator.js",
      "default": "./helpers/AsyncGenerator.js"
    },
    "./helpers/OverloadYield": {
      "node": "./helpers/OverloadYield.js",
      "import": "./helpers/esm/OverloadYield.js",
      "default": "./helpers/OverloadYield.js"
    },

@nicolo-ribaudo nicolo-ribaudo added the PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release label Mar 12, 2024
@babel-bot
Copy link
Collaborator

babel-bot commented Mar 12, 2024

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

@nicolo-ribaudo nicolo-ribaudo force-pushed the runtime-babel-8-remove-esm-exports branch from f62a4cf to 50ab996 Compare March 13, 2024 11:01
Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

Is the node entry still necessary?

@nicolo-ribaudo
Copy link
Member Author

Is the node entry still necessary?

Yes, because some helpers should only be loaded once if possible (for example, _temporalUndefined) if possible.

@nicolo-ribaudo nicolo-ribaudo merged commit 91d2158 into babel:main Mar 14, 2024
51 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the runtime-babel-8-remove-esm-exports branch March 14, 2024 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants