From 2520e6912f00aa0a6a8c417f8ace30de16f09e34 Mon Sep 17 00:00:00 2001 From: Brian Vaughn Date: Thu, 29 Apr 2021 16:57:25 -0700 Subject: [PATCH] Update React DevTools to ^4.13.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: React DevTools has gotten pretty outdated in React Native. Let's fix that! Last time I tried this it caused a lot of churn for tools like Flipper, so I approached this in two steps ([detailed in this post](https://fb.workplace.com/groups/rnsyncsquad/permalink/808063140086959/)). First was a short term plan (as implemented in [PR 21344](https://github.com/facebook/react/pull/21344)) to: 1. Branch and make a patch release of DevTools 4.10 that adds a protocol check to the frontend (to detect any newer backends). 2. Upgrade Flipper (and recommend upgrade for the OSS React Native Debugger as well) to this new frontend. 3. Wait for the updated frontend to roll out. The short term plan is now done, at least for the internal build of Flipper, and both GitHub PRs to update Flipper and React Native Debugger have been merged. So this diff moves forward with the longer term plan (implemented in [PR 21331](https://github.com/facebook/react/pull/21331)): 1. Add an explicit version to the protocol used by the DevTools "backend" and "frontend" components to talk to each other. 2. Check this protocol during initialization to ensure it matches. 3. Show upgrade/downgrade instructions if there's a mismatch (or if the check times out without a response– indicating an older backend). 4. Release this as 4.13. --- Changelog: [General][Changed] - Upgrade `react-devtools-core` from ~4.6.0 to ^4.13.0 Reviewed By: yungsters Differential Revision: D28103394 fbshipit-source-id: 21114294144bde9aede63cb3ba98a240082299bd --- desktop/plugins/public/reactdevtools/package.json | 7 +++++-- desktop/plugins/public/yarn.lock | 14 +++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/desktop/plugins/public/reactdevtools/package.json b/desktop/plugins/public/reactdevtools/package.json index 4e03c04b4..8cb46319e 100644 --- a/desktop/plugins/public/reactdevtools/package.json +++ b/desktop/plugins/public/reactdevtools/package.json @@ -5,7 +5,10 @@ "version": "0.0.0", "pluginType": "device", "supportedDevices": [ - {"os": "Metro", "archived": false} + { + "os": "Metro", + "archived": false + } ], "main": "dist/bundle.js", "flipperBundlerEntry": "index.tsx", @@ -16,7 +19,7 @@ "dependencies": { "address": "^1.1.2", "get-port": "^5.0.0", - "react-devtools-core": "~4.10.3" + "react-devtools-core": "^4.13.0" }, "title": "React DevTools", "icon": "app-react", diff --git a/desktop/plugins/public/yarn.lock b/desktop/plugins/public/yarn.lock index 287be6033..17cef5b68 100644 --- a/desktop/plugins/public/yarn.lock +++ b/desktop/plugins/public/yarn.lock @@ -1270,10 +1270,10 @@ raf@^3.4.0: dependencies: performance-now "^2.1.0" -react-devtools-core@~4.10.3: - version "4.10.3" - resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.10.3.tgz#30580721d7e9a1568a55b7107f2b6cdce6502e63" - integrity sha512-2CtceOczycfR1Th5B+lIPA1NnGODdbeTLTLZVCYmdXfdmvR5h1+cgr0f+R7HtWbTeIcG5PXUK1/YDnELP5opQA== +react-devtools-core@^4.13.0: + version "4.13.0" + resolved "https://registry.yarnpkg.com/react-devtools-core/-/react-devtools-core-4.13.0.tgz#fa80ee03b1a975c1d9898e24de841e45a4b22d30" + integrity sha512-KR+0pLw8wTjOVr+9AECe5ctmycaAjbmxN3bbdB0vmlwm0JkxNnKMxDzanf+4V8IuPBQWgm8qdWpbSOqhu1l14g== dependencies: shell-quote "^1.6.1" ws "^7" @@ -1465,9 +1465,9 @@ safe-regex@^1.1.0: ret "~0.1.10" scheduler@^0.20.1: - version "0.20.1" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c" - integrity sha512-LKTe+2xNJBNxu/QhHvDR14wUXHRQbVY5ZOYpOGWRzhydZUqrLb2JBvLPY7cAqFmqrWuDED0Mjk7013SZiOz6Bw== + version "0.20.2" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.2.tgz#4baee39436e34aa93b4874bddcbf0fe8b8b50e91" + integrity sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1"