-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[babel 8] Do not replace global regeneratorRuntime
references in regenerator transform
#17237
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
[babel 8] Do not replace global regeneratorRuntime
references in regenerator transform
#17237
Conversation
ed75813
to
f2b3a0f
Compare
f2b3a0f
to
5fc2fa4
Compare
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/59418 |
375a9f7
to
8bb6725
Compare
50fa1b7
to
d18276c
Compare
1a02a48
to
bd10fa0
Compare
Are there any benefits to using |
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. |
e9768d3
to
99546ea
Compare
312f887
to
1044027
Compare
99546ea
to
b2db8aa
Compare
67f11f9
to
1fdd23f
Compare
99c2cd6
to
9bb58ec
Compare
f83a619
to
be67be4
Compare
…generator transform (#17237)
Fixes #1, Fixes #2
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 aregeneratorRuntime
global reference in their code they will have to usebabel-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.