Skip to content

Commit 1e8f15f

Browse files
committed
fix[devtools/inspectElement]: dont pause initial inspectElement call when user switches tabs (#27488)
There are not so many changes, most of them are changing imports, because I've moved types for UI in a single file. In #27357 I've added support for pausing polling events: when user inspects an element, we start polling React DevTools backend for updates in props / state. If user switches tabs, extension's service worker can be killed by browser and this polling will start spamming errors. What I've missed is that we also have a separate call for this API, but which is executed only once when user selects an element. We don't handle promise rejection here and this can lead to some errors when user selects an element and switches tabs right after it. The only change here is that this API now has `shouldListenToPauseEvents` param, which is `true` for polling, so we will pause polling once user switches tabs. It is `false` by default, so we won't pause initial call by accident. https://github.com/hoxyq/react/blob/af8beeebf63b5824497fcd0bb35b7c0ac8fe60a0/packages/react-devtools-shared/src/backendAPI.js#L96 DiffTrain build for commit 77ec618.
1 parent a19627e commit 1e8f15f

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
@@ -24773,7 +24773,7 @@ function createFiberRoot(
2477324773
return root;
2477424774
}
2477524775

24776-
var ReactVersion = "18.3.0-canary-151e75a12-20231010";
24776+
var ReactVersion = "18.3.0-canary-77ec61885-20231010";
2477724777

2477824778
// Might add PROFILE later.
2477924779

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
@@ -8978,7 +8978,7 @@ var devToolsConfig$jscomp$inline_998 = {
89788978
throw Error("TestRenderer does not support findFiberByHostInstance()");
89798979
},
89808980
bundleType: 0,
8981-
version: "18.3.0-canary-151e75a12-20231010",
8981+
version: "18.3.0-canary-77ec61885-20231010",
89828982
rendererPackageName: "react-test-renderer"
89838983
};
89848984
var internals$jscomp$inline_1191 = {
@@ -9009,7 +9009,7 @@ var internals$jscomp$inline_1191 = {
90099009
scheduleRoot: null,
90109010
setRefreshHandler: null,
90119011
getCurrentFiber: null,
9012-
reconcilerVersion: "18.3.0-canary-151e75a12-20231010"
9012+
reconcilerVersion: "18.3.0-canary-77ec61885-20231010"
90139013
};
90149014
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90159015
var hook$jscomp$inline_1192 = __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
@@ -9404,7 +9404,7 @@ var devToolsConfig$jscomp$inline_1040 = {
94049404
throw Error("TestRenderer does not support findFiberByHostInstance()");
94059405
},
94069406
bundleType: 0,
9407-
version: "18.3.0-canary-151e75a12-20231010",
9407+
version: "18.3.0-canary-77ec61885-20231010",
94089408
rendererPackageName: "react-test-renderer"
94099409
};
94109410
var internals$jscomp$inline_1232 = {
@@ -9435,7 +9435,7 @@ var internals$jscomp$inline_1232 = {
94359435
scheduleRoot: null,
94369436
setRefreshHandler: null,
94379437
getCurrentFiber: null,
9438-
reconcilerVersion: "18.3.0-canary-151e75a12-20231010"
9438+
reconcilerVersion: "18.3.0-canary-77ec61885-20231010"
94399439
};
94409440
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
94419441
var hook$jscomp$inline_1233 = __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-151e75a12-20231010";
30+
var ReactVersion = "18.3.0-canary-77ec61885-20231010";
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-151e75a12-20231010";
619+
exports.version = "18.3.0-canary-77ec61885-20231010";

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-151e75a12-20231010";
622+
exports.version = "18.3.0-canary-77ec61885-20231010";
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-
151e75a128d0fd436dce365335b96c5686f704d4
1+
77ec61885fb19607cdd116a6790095afa40b5a94

0 commit comments

Comments
 (0)