(patch)[DevTools] bug fix: backend injection logic not working for undocked devtools window (#26665)

bugfix for #26492

This bug would cause users unable to use the devtools (component tree
empty).

The else-if logic is broken when user switch to undocked devtools mode
(separate window) because `sender.tab` would exist in that case.
<img width="314" alt="image"
src="https://user-images.githubusercontent.com/1001890/232930094-05a74445-9189-4d50-baf1-a0360b29ef7e.png">

Tested on Chrome with a local build

DiffTrain build for commit https://github.com/facebook/react/commit/96fd2fb726130d2980e6d450f5d9e468f922b8b9.
This commit is contained in:
mondaychen
2023-04-19 00:44:12 +00:00
parent ef915c1608
commit c8acb01b32
13 changed files with 19 additions and 19 deletions
@@ -23745,7 +23745,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-d8089f2cf-20230418";
var ReactVersion = "18.3.0-next-96fd2fb72-20230418";
// Might add PROFILE later.
@@ -8587,7 +8587,7 @@ var devToolsConfig$jscomp$inline_1023 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1206 = {
@@ -8618,7 +8618,7 @@ var internals$jscomp$inline_1206 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1207 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9013,7 +9013,7 @@ var devToolsConfig$jscomp$inline_1065 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1247 = {
@@ -9044,7 +9044,7 @@ var internals$jscomp$inline_1247 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1248 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-next-d8089f2cf-20230418";
var ReactVersion = "18.3.0-next-96fd2fb72-20230418";
// ATTENTION
// When adding new symbols to this file,
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-d8089f2cf-20230418";
exports.version = "18.3.0-next-96fd2fb72-20230418";
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-d8089f2cf-20230418";
exports.version = "18.3.0-next-96fd2fb72-20230418";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
d8089f2cf27a17872a13805fce415b74fd3b107e
96fd2fb726130d2980e6d450f5d9e468f922b8b9
@@ -27052,7 +27052,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-d8089f2cf-20230418";
var ReactVersion = "18.3.0-next-96fd2fb72-20230418";
function createPortal$1(
children,
@@ -9456,7 +9456,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1047 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9498,7 +9498,7 @@ var internals$jscomp$inline_1276 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1277 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10165,7 +10165,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1125 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10220,7 +10220,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
@@ -27565,7 +27565,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-d8089f2cf-20230418";
var ReactVersion = "18.3.0-next-96fd2fb72-20230418";
function createPortal$1(
children,
@@ -9715,7 +9715,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1102 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9757,7 +9757,7 @@ var internals$jscomp$inline_1345 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1346 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10424,7 +10424,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1180 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-d8089f2cf-20230418",
version: "18.3.0-next-96fd2fb72-20230418",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10479,7 +10479,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-d8089f2cf-20230418"
reconcilerVersion: "18.3.0-next-96fd2fb72-20230418"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {