From 030663bb0634fc76f811cdc63e4d09e7ca32f3d4 Mon Sep 17 00:00:00 2001 From: evanbacon Date: Sun, 24 Sep 2023 07:16:28 -0700 Subject: [PATCH] bump react-refresh to latest (#39486) Summary: - Companion PR to https://github.com/facebook/metro/pull/1085 - The Fast Refresh changes appear to be required for using static rendering and React DOM. In frameworks like Expo Router which support both native and web, this causes users to not be able to use Fast Refresh on web. ## Changelog: [GENERAL] [CHANGED] - Upgrade React Refresh package from 0.4.0 to 0.14.0 Pull Request resolved: https://github.com/facebook/react-native/pull/39486 Test Plan: 1. In a React Native project's `package.json`: ```json "resolutions": { "react-refresh": "~0.14.0" }, ``` 2. Start the server with a clear Metro cache. 3. Changes should update while preserving React state. Reviewed By: huntie Differential Revision: D49348078 Pulled By: robhogan fbshipit-source-id: ac3dcb096c35c6c29c6e6a919cf263559bceaa7c --- packages/react-native-babel-preset/package.json | 2 +- packages/react-native/package.json | 2 +- yarn.lock | 5 +++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-native-babel-preset/package.json b/packages/react-native-babel-preset/package.json index 05d82837e96..2e6dbc5985c 100644 --- a/packages/react-native-babel-preset/package.json +++ b/packages/react-native-babel-preset/package.json @@ -55,7 +55,7 @@ "@babel/template": "^7.0.0", "@react-native/babel-plugin-codegen": "*", "babel-plugin-transform-flow-enums": "^0.0.2", - "react-refresh": "^0.4.0" + "react-refresh": "^0.14.0" }, "peerDependencies": { "@babel/core": "*" diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 08535069733..036eee03600 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -120,7 +120,7 @@ "pretty-format": "^26.5.2", "promise": "^8.3.0", "react-devtools-core": "^4.27.7", - "react-refresh": "^0.4.0", + "react-refresh": "^0.14.0", "react-shallow-renderer": "^16.15.0", "regenerator-runtime": "^0.13.2", "scheduler": "0.24.0-canary-efb381bbf-20230505", diff --git a/yarn.lock b/yarn.lock index d8de644eb33..4701347d6cd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8016,6 +8016,11 @@ react-is@^17.0.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0" integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w== +react-refresh@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" + integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== + react-refresh@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.4.0.tgz#d421f9bd65e0e4b9822a399f14ac56bda9c92292"