From 458d56c0a1ac73c088660830a8bf2db65de7d9a2 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 | 2 +- rn-get-polyfills.js | 1 - 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/IntegrationTests/RCTRootViewIntegrationTestApp.js b/IntegrationTests/RCTRootViewIntegrationTestApp.js index edc64819c132fd..2466b6378586eb 100644 --- a/IntegrationTests/RCTRootViewIntegrationTestApp.js +++ b/IntegrationTests/RCTRootViewIntegrationTestApp.js @@ -9,8 +9,6 @@ 'use strict'; -require('regenerator-runtime/runtime'); - const React = require('react'); const ReactNative = require('react-native'); diff --git a/jest/setup.js b/jest/setup.js index 1587b431f0e2e0..9aef617dd4a002 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -92,7 +92,6 @@ jest }) .mock('ensureComponentIsNative', () => () => true); -const mockEmptyObject = {}; const mockNativeModules = { AlertManager: { alertWithArgs: jest.fn(), diff --git a/package.json b/package.json index 6767b04267e994..5cbeae812b5587 100644 --- a/package.json +++ b/package.json @@ -148,6 +148,7 @@ "react": "16.5.0" }, "dependencies": { + "@babel/runtime": "^7.0.0", "absolute-path": "^0.0.0", "art": "^0.10.0", "base64-js": "^1.1.2", @@ -203,7 +204,6 @@ }, "devDependencies": { "@babel/core": "^7.0.0", - "@babel/runtime": "^7.0.0", "async": "^2.4.0", "babel-eslint": "9.0.0", "babel-generator": "^6.26.0", diff --git a/rn-get-polyfills.js b/rn-get-polyfills.js index 769bf876b925c0..121fa00ab66543 100644 --- a/rn-get-polyfills.js +++ b/rn-get-polyfills.js @@ -18,5 +18,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'), ];