From ea8b199720cc3f6950eaf4414c0ffe298dd2402a Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 13 Sep 2021 09:55:26 +0200 Subject: [PATCH] Revert "chore: remove unneeded yarn patch for react native (#11853)" This reverts commit 0e5495b3e94f48851ad7f699be9e41dedf63cdfc. --- .../{babel.config.js => .babelrc.js} | 0 package.json | 3 +- patches/react-native.patch | 13 ++++++ yarn.lock | 44 +++++++++++++++++++ 4 files changed, 59 insertions(+), 1 deletion(-) rename examples/react-native/{babel.config.js => .babelrc.js} (100%) create mode 100644 patches/react-native.patch diff --git a/examples/react-native/babel.config.js b/examples/react-native/.babelrc.js similarity index 100% rename from examples/react-native/babel.config.js rename to examples/react-native/.babelrc.js diff --git a/package.json b/package.json index 158dbd0c1276..3f211eb5bcf8 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,7 @@ "@types/jest/pretty-format": "^25.1.0", "babel-jest": "workspace:*", "jest": "workspace:*", - "jest-environment-node": "workspace:*" + "jest-environment-node": "workspace:*", + "react-native": "patch:react-native@0.64.0#./patches/react-native.patch" } } diff --git a/patches/react-native.patch b/patches/react-native.patch new file mode 100644 index 000000000000..0720ad2a58f4 --- /dev/null +++ b/patches/react-native.patch @@ -0,0 +1,13 @@ +diff --git a/jest/preprocessor.js b/jest/preprocessor.js +index 5920c0a6f23c056f27366fabf32dd13c6f86465b..2658e52f9127ac58849e7f830f6342d8b683672c 100644 +--- a/jest/preprocessor.js ++++ b/jest/preprocessor.js +@@ -64,8 +64,6 @@ module.exports = { + [require('@babel/plugin-transform-flow-strip-types')], + [ + require('@babel/plugin-proposal-class-properties'), +- // use `this.foo = bar` instead of `this.defineProperty('foo', ...)` +- {loose: true}, + ], + [require('@babel/plugin-transform-computed-properties')], + [require('@babel/plugin-transform-destructuring')], diff --git a/yarn.lock b/yarn.lock index 060842a76c81..6b9812efd87e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18118,6 +18118,50 @@ fsevents@^1.2.7: languageName: node linkType: hard +"react-native@patch:react-native@0.64.0#./patches/react-native.patch::locator=%40jest%2Fmonorepo%40workspace%3A.": + version: 0.64.0 + resolution: "react-native@patch:react-native@npm%3A0.64.0#./patches/react-native.patch::version=0.64.0&hash=c73352&locator=%40jest%2Fmonorepo%40workspace%3A." + dependencies: + "@jest/create-cache-key-function": ^26.5.0 + "@react-native-community/cli": ^5.0.1-alpha.0 + "@react-native-community/cli-platform-android": ^5.0.1-alpha.0 + "@react-native-community/cli-platform-ios": ^5.0.1-alpha.0 + "@react-native/assets": 1.0.0 + "@react-native/normalize-color": 1.0.0 + "@react-native/polyfills": 1.0.0 + abort-controller: ^3.0.0 + anser: ^1.4.9 + base64-js: ^1.1.2 + event-target-shim: ^5.0.1 + hermes-engine: ~0.7.0 + invariant: ^2.2.4 + jsc-android: ^245459.0.0 + metro-babel-register: 0.64.0 + metro-react-native-babel-transformer: 0.64.0 + metro-runtime: 0.64.0 + metro-source-map: 0.64.0 + nullthrows: ^1.1.1 + pretty-format: ^26.5.2 + promise: ^8.0.3 + prop-types: ^15.7.2 + react-devtools-core: ^4.6.0 + react-native-codegen: ^0.0.6 + react-refresh: ^0.4.0 + regenerator-runtime: ^0.13.2 + scheduler: ^0.20.1 + shelljs: ^0.8.4 + stacktrace-parser: ^0.1.3 + use-subscription: ^1.0.0 + whatwg-fetch: ^3.0.0 + ws: ^6.1.4 + peerDependencies: + react: 17.0.1 + bin: + react-native: cli.js + checksum: 5685b7f4d3bbf967ca3d90365cc5fc3d64421bc22b2b08ccc548d2d4e9e9211d0e52abde0fca807203564257d187d3d955cb05a66114eb17f1958305cc30dce2 + languageName: node + linkType: hard + "react-refresh@npm:^0.4.0": version: 0.4.3 resolution: "react-refresh@npm:0.4.3"