Skip to content

Commit

Permalink
Clean up findFiberByHostInstance from DevTools Hook (#31711)
Browse files Browse the repository at this point in the history
The need for this was removed in
#30831

Since the new DevTools version has been released for a while and we
expect people to more or less auto-update. Future versions of React
don't need this.

Once we remove the remaining uses of `getInstanceFromNode` e.g. in the
deprecated internal `findDOMNode`/`findNodeHandle` and the event system,
we can completely remove the tagging of DOM nodes.

DiffTrain build for [3b597c0](3b597c0)
  • Loading branch information
sebmarkbage committed Dec 10, 2024
1 parent a3b4387 commit 2564c8f
Show file tree
Hide file tree
Showing 23 changed files with 100 additions and 128 deletions.
2 changes: 1 addition & 1 deletion compiled-rn/VERSION_NATIVE_FB
Original file line number Diff line number Diff line change
@@ -1 +1 @@
19.0.0-native-fb-de68d2f4-20241204
19.0.0-native-fb-3b597c05-20241210
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<160a11128267704309b6ab8a4178e177>>
* @generated SignedSource<<c00b1cc281f493ba19736147d01c055b>>
*/

"use strict";
Expand Down Expand Up @@ -420,5 +420,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4ab67f1597a97138a25ba4aa51a83988>>
* @generated SignedSource<<8c27205b2f8cbb91fa759e037620c374>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<4ab67f1597a97138a25ba4aa51a83988>>
* @generated SignedSource<<8c27205b2f8cbb91fa759e037620c374>>
*/

"use strict";
Expand Down Expand Up @@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cd64d01e66b344949b063ad934308ad1>>
* @generated SignedSource<<b5df96adc780d5a9fa86082232105e97>>
*/

/*
Expand Down Expand Up @@ -25794,11 +25794,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-de68d2f4-20241204" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-3b597c05-20241210" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-de68d2f4-20241204\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-3b597c05-20241210\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25835,11 +25835,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204"
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -25983,5 +25982,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<e6dc49083d7f6b1d3dcd756ba7a07031>>
* @generated SignedSource<<49d657c95238fa14271d1926827f8c5c>>
*/

/*
Expand Down Expand Up @@ -15864,14 +15864,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1731 = React.version;
if (
"19.0.0-native-fb-de68d2f4-20241204" !==
"19.0.0-native-fb-3b597c05-20241210" !==
isomorphicReactPackageVersion$jscomp$inline_1731
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1731,
"19.0.0-native-fb-de68d2f4-20241204"
"19.0.0-native-fb-3b597c05-20241210"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15893,11 +15893,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2186 = {
bundleType: 0,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204"
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2187 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16001,4 +16000,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d41e5384bdb7ebba5c6944401702170a>>
* @generated SignedSource<<3245d2c989e6aff0aef50cbd12023f91>>
*/

/*
Expand Down Expand Up @@ -16517,14 +16517,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1821 = React.version;
if (
"19.0.0-native-fb-de68d2f4-20241204" !==
"19.0.0-native-fb-3b597c05-20241210" !==
isomorphicReactPackageVersion$jscomp$inline_1821
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1821,
"19.0.0-native-fb-de68d2f4-20241204"
"19.0.0-native-fb-3b597c05-20241210"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16546,11 +16546,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1828 = {
bundleType: 0,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204",
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16669,4 +16668,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<8090e4e1a96875999b0b1e929689f54a>>
* @generated SignedSource<<903e2cbe35e2d1e94df0b6acce1d1b8d>>
*/

/*
Expand Down Expand Up @@ -25855,11 +25855,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.0.0-native-fb-de68d2f4-20241204" !== isomorphicReactPackageVersion)
if ("19.0.0-native-fb-3b597c05-20241210" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.0.0-native-fb-de68d2f4-20241204\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.0.0-native-fb-3b597c05-20241210\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -25896,11 +25896,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204"
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26360,7 +26359,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<046ea9b9730f6e8d6a381272708c7682>>
* @generated SignedSource<<49e7a1ac287e040371502ca905a4a9b3>>
*/

/*
Expand Down Expand Up @@ -15875,14 +15875,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1732 = React.version;
if (
"19.0.0-native-fb-de68d2f4-20241204" !==
"19.0.0-native-fb-3b597c05-20241210" !==
isomorphicReactPackageVersion$jscomp$inline_1732
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1732,
"19.0.0-native-fb-de68d2f4-20241204"
"19.0.0-native-fb-3b597c05-20241210"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -15904,11 +15904,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2189 = {
bundleType: 0,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204"
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2190 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16166,4 +16165,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<20d4f0ac43edf7059230122ab79fd535>>
* @generated SignedSource<<53a1870db84718cd9b45e718d1beccde>>
*/

/*
Expand Down Expand Up @@ -16532,14 +16532,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1822 = React.version;
if (
"19.0.0-native-fb-de68d2f4-20241204" !==
"19.0.0-native-fb-3b597c05-20241210" !==
isomorphicReactPackageVersion$jscomp$inline_1822
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1822,
"19.0.0-native-fb-de68d2f4-20241204"
"19.0.0-native-fb-3b597c05-20241210"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16561,11 +16561,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1829 = {
bundleType: 0,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getClosestInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204",
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$292 = 0;
Expand Down Expand Up @@ -16838,7 +16837,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<fb51fc0c7ad8e8f3fae68c93e44325bc>>
* @generated SignedSource<<4719b0b3fc7a219845f10de753a4dfa6>>
*/

"use strict";
Expand Down Expand Up @@ -1103,10 +1103,6 @@ __DEV__ &&
function unhideTextInstance(textInstance) {
textInstance.isHidden = !1;
}
function getInstanceFromNode(mockNode) {
mockNode = nodeToInstanceMap.get(mockNode);
return void 0 !== mockNode ? mockNode.internalInstanceHandle : null;
}
function bindToConsole(methodName, args, badgeName) {
var offset = 0;
switch (methodName) {
Expand Down Expand Up @@ -15556,11 +15552,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.0.0-native-fb-de68d2f4-20241204",
version: "19.0.0-native-fb-3b597c05-20241210",
rendererPackageName: "react-test-renderer",
currentDispatcherRef: ReactSharedInternals,
findFiberByHostInstance: getInstanceFromNode,
reconcilerVersion: "19.0.0-native-fb-de68d2f4-20241204"
reconcilerVersion: "19.0.0-native-fb-3b597c05-20241210"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -15705,5 +15700,5 @@ __DEV__ &&
flushSyncWorkAcrossRoots_impl(0, !0));
}
};
exports.version = "19.0.0-native-fb-de68d2f4-20241204";
exports.version = "19.0.0-native-fb-3b597c05-20241210";
})();
Loading

0 comments on commit 2564c8f

Please sign in to comment.