Skip to content

Commit d39d345

Browse files
committed
refactor[devtools/extension]: more stable element updates polling to avoid timed out errors (#27357)
Some context: - When user selects an element in tree inspector, we display current state of the component. In order to display really current state, we start polling the backend to get available updates for the element. Previously: - Straight-forward sending an event to get element updates each second. Potential race condition is not handled in any form. - If user navigates from the page, timeout wouldn't be cleared and we would potentially throw "Timed out ..." error. - Bridge disconnection is not handled in any form, if it was shut down, we could spam with "Timed out ..." errors. With these changes: - Requests are now chained, so there can be a single request at a time. - Handling both navigation and shut down events. This should reduce the number of "Timed out ..." errors that we see in our logs for the extension. Other surfaces will also benefit from it, but not to the full extent, as long as they utilize "resumeElementPolling" and "pauseElementPolling" events. Tested this on Chrome, running React DevTools on multiple tabs, explicitly checked the case when service worker is in idle state and we return back to the tab. DiffTrain build for commit 2eed132.
1 parent 2c322d6 commit d39d345

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
@@ -23994,7 +23994,7 @@ function createFiberRoot(
2399423994
return root;
2399523995
}
2399623996

23997-
var ReactVersion = "18.3.0-canary-bb1d8d166-20230911";
23997+
var ReactVersion = "18.3.0-canary-2eed13284-20230912";
2399823998

2399923999
// Might add PROFILE later.
2400024000

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
@@ -8617,7 +8617,7 @@ var devToolsConfig$jscomp$inline_1027 = {
86178617
throw Error("TestRenderer does not support findFiberByHostInstance()");
86188618
},
86198619
bundleType: 0,
8620-
version: "18.3.0-canary-bb1d8d166-20230911",
8620+
version: "18.3.0-canary-2eed13284-20230912",
86218621
rendererPackageName: "react-test-renderer"
86228622
};
86238623
var internals$jscomp$inline_1226 = {
@@ -8648,7 +8648,7 @@ var internals$jscomp$inline_1226 = {
86488648
scheduleRoot: null,
86498649
setRefreshHandler: null,
86508650
getCurrentFiber: null,
8651-
reconcilerVersion: "18.3.0-canary-bb1d8d166-20230911"
8651+
reconcilerVersion: "18.3.0-canary-2eed13284-20230912"
86528652
};
86538653
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
86548654
var hook$jscomp$inline_1227 = __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
@@ -9043,7 +9043,7 @@ var devToolsConfig$jscomp$inline_1069 = {
90439043
throw Error("TestRenderer does not support findFiberByHostInstance()");
90449044
},
90459045
bundleType: 0,
9046-
version: "18.3.0-canary-bb1d8d166-20230911",
9046+
version: "18.3.0-canary-2eed13284-20230912",
90479047
rendererPackageName: "react-test-renderer"
90489048
};
90499049
var internals$jscomp$inline_1267 = {
@@ -9074,7 +9074,7 @@ var internals$jscomp$inline_1267 = {
90749074
scheduleRoot: null,
90759075
setRefreshHandler: null,
90769076
getCurrentFiber: null,
9077-
reconcilerVersion: "18.3.0-canary-bb1d8d166-20230911"
9077+
reconcilerVersion: "18.3.0-canary-2eed13284-20230912"
90789078
};
90799079
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
90809080
var hook$jscomp$inline_1268 = __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-bb1d8d166-20230911";
30+
var ReactVersion = "18.3.0-canary-2eed13284-20230912";
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-bb1d8d166-20230911";
619+
exports.version = "18.3.0-canary-2eed13284-20230912";

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-bb1d8d166-20230911";
622+
exports.version = "18.3.0-canary-2eed13284-20230912";
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-
bb1d8d166799eb97892be6c7826179270ba283d0
1+
2eed1328478e8c923fcb4e6abf5efbd9e1233402

0 commit comments

Comments
 (0)