Skip to content

Commit 4bb6478

Browse files
committed
feat[devtools/extension]: show disclaimer when page doesnt run react and refactor react polling logic (#27373)
Changes: 1. Refactored react polling logic, now each `.eval()` call is wrapped in Promise, so we can chain them properly. 2. When user has browser DevTools opened and React DevTools panels were mounted, user might navigate to the page, which doesn't have React running. Previously, we would show just blank white page, now we will show disclaimer. Disclaimer appears after 5 failed attempts to find React. We will also show this disclaimer if it takes too long to load the page, but once any React instance is loaded and registered, we will update the panels. 3. Dark theme support for this disclaimer and popups in Firefox & Chromium-based browsers **Important**: this is only valid for case when React DevTools panels were already created, like when user started debugging React app and then switched to non-React page. If user starts to debug non-React app (by opening browser DevTools for it), we will not create these panels, just like before. Q: "Why do we poll to get information about react?" A: To handle case when react is loaded after the page has been loaded, some sandboxes for example. | Before | After | | --- | --- | | <img width="1840" alt="Screenshot 2023-09-14 at 15 37 37" src="https://github.com/facebook/react/assets/28902667/2e6ffb39-5698-461d-bfd6-be2defb41aad"> | <img width="1840" alt="Screenshot 2023-09-14 at 15 26 16" src="https://github.com/facebook/react/assets/28902667/1c8ad2b7-0955-41c5-b8cc-d0fdb03e13ca"> | DiffTrain build for commit 1b1dcb8.
1 parent 8ba46ff commit 4bb6478

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23998,7 +23998,7 @@ function createFiberRoot(
2399823998
return root;
2399923999
}
2400024000

24001-
var ReactVersion = "18.3.0-canary-a3743b2e4-20230920";
24001+
var ReactVersion = "18.3.0-canary-1b1dcb8a4-20230920";
2400224002

2400324003
// Might add PROFILE later.
2400424004

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8620,7 +8620,7 @@ var devToolsConfig$jscomp$inline_1028 = {
86208620
throw Error("TestRenderer does not support findFiberByHostInstance()");
86218621
},
86228622
bundleType: 0,
8623-
version: "18.3.0-canary-a3743b2e4-20230920",
8623+
version: "18.3.0-canary-1b1dcb8a4-20230920",
86248624
rendererPackageName: "react-test-renderer"
86258625
};
86268626
var internals$jscomp$inline_1227 = {
@@ -8651,7 +8651,7 @@ var internals$jscomp$inline_1227 = {
86518651
scheduleRoot: null,
86528652
setRefreshHandler: null,
86538653
getCurrentFiber: null,
8654-
reconcilerVersion: "18.3.0-canary-a3743b2e4-20230920"
8654+
reconcilerVersion: "18.3.0-canary-1b1dcb8a4-20230920"
86558655
};
86568656
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86578657
var hook$jscomp$inline_1228 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9046,7 +9046,7 @@ var devToolsConfig$jscomp$inline_1070 = {
90469046
throw Error("TestRenderer does not support findFiberByHostInstance()");
90479047
},
90489048
bundleType: 0,
9049-
version: "18.3.0-canary-a3743b2e4-20230920",
9049+
version: "18.3.0-canary-1b1dcb8a4-20230920",
90509050
rendererPackageName: "react-test-renderer"
90519051
};
90529052
var internals$jscomp$inline_1268 = {
@@ -9077,7 +9077,7 @@ var internals$jscomp$inline_1268 = {
90779077
scheduleRoot: null,
90789078
setRefreshHandler: null,
90799079
getCurrentFiber: null,
9080-
reconcilerVersion: "18.3.0-canary-a3743b2e4-20230920"
9080+
reconcilerVersion: "18.3.0-canary-1b1dcb8a4-20230920"
90819081
};
90829082
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90839083
var hook$jscomp$inline_1269 = __REACT_DEVTOOLS_GLOBAL_HOOK__;

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-dev.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ if (
2727
}
2828
"use strict";
2929

30-
var ReactVersion = "18.3.0-canary-a3743b2e4-20230920";
30+
var ReactVersion = "18.3.0-canary-1b1dcb8a4-20230920";
3131

3232
// ATTENTION
3333
// When adding new symbols to this file,

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-prod.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,4 +616,4 @@ exports.useSyncExternalStore = function (
616616
exports.useTransition = function () {
617617
return ReactCurrentDispatcher.current.useTransition();
618618
};
619-
exports.version = "18.3.0-canary-a3743b2e4-20230920";
619+
exports.version = "18.3.0-canary-1b1dcb8a4-20230920";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/cjs/React-profiling.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ exports.useSyncExternalStore = function (
619619
exports.useTransition = function () {
620620
return ReactCurrentDispatcher.current.useTransition();
621621
};
622-
exports.version = "18.3.0-canary-a3743b2e4-20230920";
622+
exports.version = "18.3.0-canary-1b1dcb8a4-20230920";
623623

624624
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
625625
if (
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a3743b2e444d2198972b190a9d97c3edcf370414
1+
1b1dcb8a40d002edcbca483b1f9caa78087a878f

0 commit comments

Comments
 (0)