Skip to content
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

Remove global babelHelpers and regenerator #21283

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions IntegrationTests/RCTRootViewIntegrationTestApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@

'use strict';

require('regenerator-runtime/runtime');

const React = require('react');
const ReactNative = require('react-native');

Expand Down
12 changes: 0 additions & 12 deletions Libraries/Core/InitializeCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,6 @@ ReactNativeVersionCheck.checkVersions();
// ERROR: Event loop not supported.
polyfillGlobal('Promise', () => require('Promise'));

// Set up regenerator.
polyfillGlobal('regeneratorRuntime', () => {
// The require just sets up the global, so make sure when we first
// invoke it the global does not exist
delete global.regeneratorRuntime;
/* $FlowFixMe(>=0.54.0 site=react_native_oss) This comment suppresses an
* error found when Flow v0.54 was deployed. To see the error delete this
* comment and run Flow. */
require('regenerator-runtime/runtime');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also remove regenerator-runtime from the dependencies in package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need it for jest tests, I guess I could move it to dev deps

return global.regeneratorRuntime;
});

// Set up timers
const defineLazyTimer = name => {
polyfillGlobal(name, () => require('JSTimers')[name]);
Expand Down
Loading