X Tutup
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
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
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

pkg-pr-new bot commented Sep 26, 2025

Open in StackBlitz

commit: 8e7f8c3

@JLHwung
Copy link
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
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
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
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

X Tutup