-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove global babelHelpers and regenerator (#21283)
Summary: Follow up to facebook/metro@8932a9c Babel helpers and regenerator runtime will be imported automatically from `babel/runtime`. We still need to add the global regeneratorRuntime for jest tests since we disable babel-runtime currently. Pull Request resolved: #21283 Reviewed By: mjesun Differential Revision: D10010963 Pulled By: rafeca fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76
- Loading branch information
1 parent
544adca
commit 458d56c
Showing
4 changed files
with
1 addition
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
458d56c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafeca I noticed you did not include the change that removes the global regenerator polyfill. I think this might cause it to get included it twice in the bundle when using
@babel/transform-runtime
. I think the ideal solution would be to remove it from InitializeCore.js and include it as a polyfill at fb (in the internal rn-get-polyfills.js that has the babelHelpers polyfill).Would that work?
The alternative solution is to make
@babel/transform-runtime
not transform regenerator and keep using the global for OSS too.458d56c
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @janicduplessis ! Since the regenerator runtime is added lazily once it's used we cannot add it as a normal polyfill (it needs to be able to require other modules).
@ejanzer is doing some internal changes that will allow us to inject the regenerator runtime in a different way, once we have this done we should be able to remove it from
InitializeCore