From 2b89104924b6cbcb74da77f089fb39af2c2a712f Mon Sep 17 00:00:00 2001 From: Ruslan Lesiutin Date: Wed, 16 Nov 2022 10:29:08 -0800 Subject: [PATCH] refactor(react-native-github/polyfills): rename polyfills to js-polyfills Summary: Changelog: [General][Changed] - renamed polyfills package to js-polyfills as a part of [migration to monorepo structure](https://github.com/facebook/react-native/issues/34692) Differential Revision: https://internalfb.com/D41190595 fbshipit-source-id: 8158c8c2c4f5bf013e8cde5111d880d7929e426c --- Libraries/vendor/core/ErrorUtils.js | 2 +- jest/setup.js | 4 ++-- package.json | 2 +- packages/polyfills/BUCK | 2 +- packages/polyfills/package.json | 4 ++-- rn-get-polyfills.js | 3 ++- 6 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Libraries/vendor/core/ErrorUtils.js b/Libraries/vendor/core/ErrorUtils.js index 12530c0eccc6fc..37b0da17cd1881 100644 --- a/Libraries/vendor/core/ErrorUtils.js +++ b/Libraries/vendor/core/ErrorUtils.js @@ -8,7 +8,7 @@ * @flow strict */ -import type {ErrorUtilsT} from '@react-native/polyfills/error-guard'; +import type {ErrorUtilsT} from '@react-native/js-polyfills/error-guard'; /** * The particular require runtime that we are using looks for a global diff --git a/jest/setup.js b/jest/setup.js index 3738bd2c61e516..511c6642a4691f 100644 --- a/jest/setup.js +++ b/jest/setup.js @@ -12,8 +12,8 @@ const MockNativeMethods = jest.requireActual('./MockNativeMethods'); const mockComponent = jest.requireActual('./mockComponent'); -jest.requireActual('@react-native/polyfills/Object.es8'); -jest.requireActual('@react-native/polyfills/error-guard'); +jest.requireActual('@react-native/js-polyfills/Object.es8'); +jest.requireActual('@react-native/js-polyfills/error-guard'); global.__DEV__ = true; diff --git a/package.json b/package.json index 07ae77c2304211..9bd621c865a9c8 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "Libraries", "LICENSE", "local-cli", + "packages/polyfills", "React-Core.podspec", "react-native.config.js", "react.gradle", @@ -114,7 +115,6 @@ "@react-native-community/cli-platform-ios": "10.0.0-alpha.3", "@react-native/assets": "1.0.0", "@react-native/normalize-color": "2.1.0", - "@react-native/polyfills": "2.0.0", "abort-controller": "^3.0.0", "anser": "^1.4.9", "base64-js": "^1.1.2", diff --git a/packages/polyfills/BUCK b/packages/polyfills/BUCK index 88ffc9513eee78..b3881484a9599e 100644 --- a/packages/polyfills/BUCK +++ b/packages/polyfills/BUCK @@ -22,7 +22,7 @@ yarn_workspace( rn_library( name = "polyfills", - base_path = relative_path_to_js_root() + "node_modules/@react-native/polyfills/", + base_path = relative_path_to_js_root() + "node_modules/@react-native/js-polyfills/", is_polyfill = True, labels = [ "pfh:ReactNative_CommonInfrastructurePlaceholder", diff --git a/packages/polyfills/package.json b/packages/polyfills/package.json index 58a2b3a70494eb..6dfce02834c485 100644 --- a/packages/polyfills/package.json +++ b/packages/polyfills/package.json @@ -1,6 +1,6 @@ { - "name": "@react-native/polyfills", - "version": "2.0.0", + "name": "@react-native/js-polyfills", + "version": "0.72.0", "description": "Polyfills for React Native.", "repository": { "type": "git", diff --git a/rn-get-polyfills.js b/rn-get-polyfills.js index 9a806bfc138409..cf95190df342d7 100644 --- a/rn-get-polyfills.js +++ b/rn-get-polyfills.js @@ -9,4 +9,5 @@ 'use strict'; -module.exports = require('@react-native/polyfills'); +// Although symlink for @react-native/js-polyfills is present, Metro couldn't handle it +module.exports = require('./packages/polyfills');