Skip to content

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Apr 12, 2025

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

In Babel 7 it's safe to replace regeneratorRuntime references not injected by Babel with a call to the helper, because it has the same behavior. To avoid having to provide backwards compatibility across major versions, this PR changes the Babel 8 behavior to simply not do that. If somebody has a regeneratorRuntime global reference in their code they will have to use babel-plugin-polyfill-regenerator, which injects an import to the original (thus, with the semantics that the user expected when they wrote that code) regenerator-runtime package.

@nicolo-ribaudo nicolo-ribaudo added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release PR: Needs Docs labels Apr 12, 2025
@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft April 12, 2025 16:24
@nicolo-ribaudo nicolo-ribaudo changed the base branch from main to regenerator-refactor April 25, 2025 13:27
@babel-bot
Copy link
Collaborator

babel-bot commented Apr 25, 2025

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

@nicolo-ribaudo nicolo-ribaudo force-pushed the regenerator-improve branch 2 times, most recently from 375a9f7 to 8bb6725 Compare April 25, 2025 15:17
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review April 25, 2025 16:12
@liuxingbaoyu liuxingbaoyu force-pushed the regenerator-refactor branch from 50fa1b7 to d18276c Compare May 1, 2025 13:18
@liuxingbaoyu
Copy link
Member

Are there any benefits to using babel-plugin-polyfill-regenerator over importing regenerator-runtime directly?

@nicolo-ribaudo
Copy link
Member Author

nicolo-ribaudo commented May 14, 2025

Are there any benefits to using babel-plugin-polyfill-regenerator over importing regenerator-runtime directly?

That maybe the problem is in one of your dependencies, and you don't have direct control on it. But yeah I mention in the migration docs that ideally people should not rely on an implicit global.

@nicolo-ribaudo nicolo-ribaudo force-pushed the regenerator-refactor branch from e9768d3 to 99546ea Compare May 14, 2025 12:11
@nicolo-ribaudo nicolo-ribaudo force-pushed the regenerator-refactor branch from 99546ea to b2db8aa Compare May 23, 2025 13:08
@nicolo-ribaudo nicolo-ribaudo force-pushed the regenerator-improve branch 4 times, most recently from 67f11f9 to 1fdd23f Compare May 27, 2025 09:26
@nicolo-ribaudo nicolo-ribaudo force-pushed the regenerator-refactor branch from f83a619 to be67be4 Compare May 27, 2025 10:23
@nicolo-ribaudo nicolo-ribaudo merged commit b88c630 into babel:regenerator-refactor May 27, 2025
2 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the regenerator-improve branch May 27, 2025 13:10
nicolo-ribaudo added a commit that referenced this pull request May 29, 2025
@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 Aug 27, 2025
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 27, 2025
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: 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.

3 participants