You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-dev.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23998,7 +23998,7 @@ function createFiberRoot(
23998
23998
return root;
23999
23999
}
24000
24000
24001
-
var ReactVersion = "18.3.0-canary-a3743b2e4-20230920";
24001
+
var ReactVersion = "18.3.0-canary-1b1dcb8a4-20230920";
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-prod.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -8620,7 +8620,7 @@ var devToolsConfig$jscomp$inline_1028 = {
8620
8620
throwError("TestRenderer does not support findFiberByHostInstance()");
8621
8621
},
8622
8622
bundleType: 0,
8623
-
version: "18.3.0-canary-a3743b2e4-20230920",
8623
+
version: "18.3.0-canary-1b1dcb8a4-20230920",
8624
8624
rendererPackageName: "react-test-renderer"
8625
8625
};
8626
8626
varinternals$jscomp$inline_1227={
@@ -8651,7 +8651,7 @@ var internals$jscomp$inline_1227 = {
Copy file name to clipboardExpand all lines: compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react-test-renderer/cjs/ReactTestRenderer-profiling.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -9046,7 +9046,7 @@ var devToolsConfig$jscomp$inline_1070 = {
9046
9046
throwError("TestRenderer does not support findFiberByHostInstance()");
9047
9047
},
9048
9048
bundleType: 0,
9049
-
version: "18.3.0-canary-a3743b2e4-20230920",
9049
+
version: "18.3.0-canary-1b1dcb8a4-20230920",
9050
9050
rendererPackageName: "react-test-renderer"
9051
9051
};
9052
9052
varinternals$jscomp$inline_1268={
@@ -9077,7 +9077,7 @@ var internals$jscomp$inline_1268 = {
0 commit comments