From d94ba38ebbd71e365ead89309afc9232fd75afe1 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Wed, 26 Sep 2018 09:48:35 -0700 Subject: [PATCH] Remove global babelHelpers and regenerator (#21283) Summary: Follow up to https://github.com/facebook/metro/commit/8932a9caa8f9ffe82160f2da25342a0bde3bbb26 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: https://github.com/facebook/react-native/pull/21283 Reviewed By: mjesun Differential Revision: D10010963 Pulled By: rafeca fbshipit-source-id: da5e23dd901f8f8940d46816b4fc9290d0e28c76 --- IntegrationTests/RCTRootViewIntegrationTestApp.js | 2 -- jest/setup.js | 1 - package.json | 1 + rn-get-polyfills.js | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/IntegrationTests/RCTRootViewIntegrationTestApp.js b/IntegrationTests/RCTRootViewIntegrationTestApp.js index 715ad35f3a..986dee99e1 100644 --- a/IntegrationTests/RCTRootViewIntegrationTestApp.js +++ b/IntegrationTests/RCTRootViewIntegrationTestApp.js @@ -10,8 +10,6 @@ */ 'use strict'; -require('regenerator-runtime/runtime'); - var React = require('React'); var ReactNative = require('react-native'); diff --git a/jest/setup.js b/jest/setup.js index 9f6d4ceee8..b3938f2670 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -108,7 +108,6 @@ jest }) .mock('ensureComponentIsNative', () => () => true); -const mockEmptyObject = {}; const mockNativeModules = { AlertManager: { alertWithArgs: jest.fn(), diff --git a/package.json b/package.json index 7baec93926..53aa94c4b7 100644 --- a/package.json +++ b/package.json @@ -147,6 +147,7 @@ "react": "16.6.3" }, "dependencies": { + "@babel/runtime": "^7.0.0", "absolute-path": "^0.0.0", "art": "^0.10.0", "babel-core": "^6.24.1", diff --git a/rn-get-polyfills.js b/rn-get-polyfills.js index a228d6f1f9..217c9c7faf 100644 --- a/rn-get-polyfills.js +++ b/rn-get-polyfills.js @@ -19,5 +19,4 @@ module.exports = () => [ require.resolve('./Libraries/polyfills/Array.prototype.es6.js'), require.resolve('./Libraries/polyfills/Array.es6.js'), require.resolve('./Libraries/polyfills/Object.es7.js'), - require.resolve('./Libraries/polyfills/babelHelpers.js'), ];