Skip to content

[babel 8] Add sideEffects: false to babel-runtime#17529

Merged
JLHwung merged 1 commit intobabel:mainfrom
nicolo-ribaudo:sef
Dec 12, 2025
Merged

[babel 8] Add sideEffects: false to babel-runtime#17529
JLHwung merged 1 commit intobabel:mainfrom
nicolo-ribaudo:sef

Conversation

@nicolo-ribaudo
Copy link
Copy Markdown
Member

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

@nicolo-ribaudo nicolo-ribaudo added the PR: Polish (next major) 💅 A type of pull request used for our changelog categories for next major release label Sep 26, 2025
@babel-bot
Copy link
Copy Markdown
Collaborator

babel-bot commented Sep 26, 2025

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

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Sep 26, 2025

Open in StackBlitz

commit: 8e7f8c3

@JLHwung
Copy link
Copy Markdown
Contributor

JLHwung commented Sep 27, 2025

The @babel/runtime/regenerator/index.js does have side effects because it registers regeneratorRuntime to the global object. As for other runtime helpers, if they do not write to global object, they should be considered pure.

c.f. #17463 (comment)

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

I didn't realize that that file is also in Babel 8. Is has a Todo comment mentioning to remove it, we should actually do it.

@JLHwung
Copy link
Copy Markdown
Contributor

JLHwung commented Sep 27, 2025

I didn't realize that that file is also in Babel 8. Is has a Todo comment mentioning to remove it, we should actually do it.

Yeah. If we want to keep that file in Babel 7, we can overwrite the package.json#files config (and the exports config) in Babel 8 so that at least this file will not be published in Babel 8. We can eventually remove this file when we discontinue Babel 7.

@nicolo-ribaudo
Copy link
Copy Markdown
Member Author

nicolo-ribaudo commented Oct 17, 2025

Conditional package.json#files doesn't seem to work. I changed it to a runtime error for now.

I plan to split the Babel 8 vs Babel 7 branch soon, then we can delete the file.

@JLHwung JLHwung merged commit 1feae85 into babel:main Dec 12, 2025
54 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the sef branch December 12, 2025 15:53
@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 Mar 14, 2026
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 14, 2026
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: Polish (next major) 💅 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.

sideEffects: false to @babel/runtime's package.json

4 participants