Skip to content

Commit

Permalink
Reconciler: Combine identical cases in findParent (#32210)
Browse files Browse the repository at this point in the history
## Summary

When lookup `Parent`, `HostRoot` and `HostPortal` should be merged,
because when creating a `Portal`, it will also include
`containerInfo`(So we can directly use this `containerInfo` to delete
the real DOM nodes.), so there is no need to handle them separately.

## How did you test this change?

No behavior changes, all existing tests pass.

DiffTrain build for [19ca800](19ca800)
  • Loading branch information
gnoff committed Jan 31, 2025
1 parent 5d1509e commit 0c2639f
Show file tree
Hide file tree
Showing 23 changed files with 86 additions and 122 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.1.0-native-fb-9ff42a87-20250130
19.1.0-native-fb-19ca800c-20250131
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<5e1b815567d096b454e9eaae7bb92825>>
* @generated SignedSource<<f20ead02fe1607d1118311ad20dbb98a>>
*/

"use strict";
Expand Down Expand Up @@ -428,5 +428,5 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d5327429716017e10daecdc6cd67386c>>
* @generated SignedSource<<ec1b2dae45e60236688f80bf9a05a872>>
*/

"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.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<d5327429716017e10daecdc6cd67386c>>
* @generated SignedSource<<ec1b2dae45e60236688f80bf9a05a872>>
*/

"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.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<6662cbbb9dbf8b7957351e4fb057887e>>
* @generated SignedSource<<e8d90cc512df9d457ca4c5c054bc12a9>>
*/

/*
Expand Down Expand Up @@ -12422,9 +12422,6 @@ __DEV__ &&
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -25997,11 +25994,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-9ff42a87-20250130" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-19ca800c-20250131" !== 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.1.0-native-fb-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-19ca800c-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26038,10 +26035,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26187,5 +26184,5 @@ __DEV__ &&
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
})();
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cb67a2004533893952c24f6345d8b51f>>
* @generated SignedSource<<b61d85f0344279fdb98b1dad30c4f307>>
*/

/*
Expand Down Expand Up @@ -8674,9 +8674,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16003,14 +16000,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1786 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-19ca800c-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1786
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1786,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-19ca800c-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16032,10 +16029,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2242 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2243 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16141,4 +16138,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<2123504bcc671c29af3c759339d03e87>>
* @generated SignedSource<<f0f08356a652867ae326d9402e3a3d1c>>
*/

/*
Expand Down Expand Up @@ -9068,9 +9068,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16652,14 +16649,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1881 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-19ca800c-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1881
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1881,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-19ca800c-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16681,10 +16678,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1888 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130",
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16805,4 +16802,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
listenToAllSupportedEvents(container);
return new ReactDOMHydrationRoot(initialChildren);
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<6808ed37fdae0dd8f12efd685843d77e>>
* @generated SignedSource<<1ced3a8ced26a4064f87d313d6a37909>>
*/

/*
Expand Down Expand Up @@ -12430,9 +12430,6 @@ __DEV__ &&
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -26058,11 +26055,11 @@ __DEV__ &&
};
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-native-fb-9ff42a87-20250130" !== isomorphicReactPackageVersion)
if ("19.1.0-native-fb-19ca800c-20250131" !== 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.1.0-native-fb-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-native-fb-19ca800c-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -26099,10 +26096,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -26564,7 +26561,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
"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<<7a5ee1c7dad1a60917fc01b90d6789e6>>
* @generated SignedSource<<78a11e252340ae98385834d2a1be92ab>>
*/

/*
Expand Down Expand Up @@ -8674,9 +8674,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16014,14 +16011,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1787 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-19ca800c-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1787
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1787,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-19ca800c-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16043,10 +16040,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_2245 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130"
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2246 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -16306,4 +16303,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<630c89c1f2bf8d4a15b8b91c28856a08>>
* @generated SignedSource<<0ff03d4d98865ebb975722f53279ac1a>>
*/

/*
Expand Down Expand Up @@ -9072,9 +9072,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
hostParentIsContainer = !1;
break a;
case 3:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
break a;
case 4:
hostParent = parent.stateNode.containerInfo;
hostParentIsContainer = !0;
Expand Down Expand Up @@ -16667,14 +16664,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
};
var isomorphicReactPackageVersion$jscomp$inline_1882 = React.version;
if (
"19.1.0-native-fb-9ff42a87-20250130" !==
"19.1.0-native-fb-19ca800c-20250131" !==
isomorphicReactPackageVersion$jscomp$inline_1882
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1882,
"19.1.0-native-fb-9ff42a87-20250130"
"19.1.0-native-fb-19ca800c-20250131"
)
);
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
Expand All @@ -16696,10 +16693,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
};
var internals$jscomp$inline_1889 = {
bundleType: 0,
version: "19.1.0-native-fb-9ff42a87-20250130",
version: "19.1.0-native-fb-19ca800c-20250131",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-native-fb-9ff42a87-20250130",
reconcilerVersion: "19.1.0-native-fb-19ca800c-20250131",
getLaneLabelMap: function () {
for (
var map = new Map(), lane = 1, index$294 = 0;
Expand Down Expand Up @@ -16974,7 +16971,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-native-fb-9ff42a87-20250130";
exports.version = "19.1.0-native-fb-19ca800c-20250131";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
Loading

0 comments on commit 0c2639f

Please sign in to comment.