mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
DevTools: Inline references to fiber flags (#26542)
We shouldn't be referencing internal fields like fiber's `flag` directly of DevTools. It's an implementation detail. However, over the years a few of these have snuck in. Because of how DevTools is currently shipped, where it's expected to be backwards compatible with older versions of React, this prevents us from refactoring those fields inside the reconciler. The plan we have to address this is to fix how DevTools is shipped: DevTools will be released in lockstep with each version of React. Until then, though, I need a temporary solution because it's blocking a feature I'm working on. So in meantime, I'm going to have to fork the DevTool's code based on the React version, like we already do with the fiber TypeOfWork enum. As a first step, I've inlined all the references to fiber flags into the specific call sites where they are used. Eventually we'll import these functions from the reconciler so they stay in sync, rather than maintaining duplicate copies of the logic. DiffTrain build for commit https://github.com/facebook/react/commit/0ba4d7b0d80d942dc8f074f7ce0536e6b2559fbf.
This commit is contained in:
+1
-1
@@ -23884,7 +23884,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-da94e8b24-20230404";
|
||||
var ReactVersion = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
// Might add PROFILE later.
|
||||
|
||||
|
||||
+2
-2
@@ -8683,7 +8683,7 @@ var devToolsConfig$jscomp$inline_1028 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1220 = {
|
||||
@@ -8714,7 +8714,7 @@ var internals$jscomp$inline_1220 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1221 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -9108,7 +9108,7 @@ var devToolsConfig$jscomp$inline_1070 = {
|
||||
throw Error("TestRenderer does not support findFiberByHostInstance()");
|
||||
},
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-test-renderer"
|
||||
};
|
||||
var internals$jscomp$inline_1261 = {
|
||||
@@ -9139,7 +9139,7 @@ var internals$jscomp$inline_1261 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1262 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ if (
|
||||
}
|
||||
"use strict";
|
||||
|
||||
var ReactVersion = "18.3.0-next-da94e8b24-20230404";
|
||||
var ReactVersion = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
// ATTENTION
|
||||
// When adding new symbols to this file,
|
||||
|
||||
+1
-1
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-next-da94e8b24-20230404";
|
||||
exports.version = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
+1
-1
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
|
||||
);
|
||||
};
|
||||
exports.useTransition = useTransition;
|
||||
exports.version = "18.3.0-next-da94e8b24-20230404";
|
||||
exports.version = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
|
||||
if (
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
da94e8b24a3f31a3e805f9bf6bba73055aad9d41
|
||||
0ba4d7b0d80d942dc8f074f7ce0536e6b2559fbf
|
||||
|
||||
+1
-1
@@ -27177,7 +27177,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-da94e8b24-20230404";
|
||||
var ReactVersion = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
+2
-2
@@ -9554,7 +9554,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1052 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -9596,7 +9596,7 @@ var internals$jscomp$inline_1297 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1298 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -10262,7 +10262,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1130 = {
|
||||
findFiberByHostInstance: getInstanceFromNode,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -10317,7 +10317,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
});
|
||||
exports.createPortal = function (children, containerTag) {
|
||||
return createPortal$1(
|
||||
|
||||
+1
-1
@@ -27700,7 +27700,7 @@ function createFiberRoot(
|
||||
return root;
|
||||
}
|
||||
|
||||
var ReactVersion = "18.3.0-next-da94e8b24-20230404";
|
||||
var ReactVersion = "18.3.0-next-0ba4d7b0d-20230404";
|
||||
|
||||
function createPortal$1(
|
||||
children,
|
||||
|
||||
+2
-2
@@ -9810,7 +9810,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1107 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -9852,7 +9852,7 @@ var internals$jscomp$inline_1359 = {
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
};
|
||||
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
|
||||
var hook$jscomp$inline_1360 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
|
||||
|
||||
+2
-2
@@ -10518,7 +10518,7 @@ var roots = new Map(),
|
||||
devToolsConfig$jscomp$inline_1185 = {
|
||||
findFiberByHostInstance: getInstanceFromTag,
|
||||
bundleType: 0,
|
||||
version: "18.3.0-next-da94e8b24-20230404",
|
||||
version: "18.3.0-next-0ba4d7b0d-20230404",
|
||||
rendererPackageName: "react-native-renderer",
|
||||
rendererConfig: {
|
||||
getInspectorDataForViewTag: function () {
|
||||
@@ -10573,7 +10573,7 @@ var roots = new Map(),
|
||||
scheduleRoot: null,
|
||||
setRefreshHandler: null,
|
||||
getCurrentFiber: null,
|
||||
reconcilerVersion: "18.3.0-next-da94e8b24-20230404"
|
||||
reconcilerVersion: "18.3.0-next-0ba4d7b0d-20230404"
|
||||
});
|
||||
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
|
||||
computeComponentStackForErrorReporting: function (reactTag) {
|
||||
|
||||
Reference in New Issue
Block a user