Skip to content

Commit 582a010

Browse files
committed
Reconciler: Combine identical cases in findParent (#32210)
## 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)
1 parent ade1b63 commit 582a010

34 files changed

+86
-146
lines changed

compiled/facebook-www/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ff42a8798863c995523e284142b47e3cdfaee80
1+
19ca800caa01eec2f5e65e547c67b11592bec8b0
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
9ff42a8798863c995523e284142b47e3cdfaee80
1+
19ca800caa01eec2f5e65e547c67b11592bec8b0

compiled/facebook-www/React-dev.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ __DEV__ &&
19581958
exports.useTransition = function () {
19591959
return resolveDispatcher().useTransition();
19601960
};
1961-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
1961+
exports.version = "19.1.0-www-classic-19ca800c-20250131";
19621962
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19631963
"function" ===
19641964
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ __DEV__ &&
19581958
exports.useTransition = function () {
19591959
return resolveDispatcher().useTransition();
19601960
};
1961-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
1961+
exports.version = "19.1.0-www-modern-19ca800c-20250131";
19621962
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19631963
"function" ===
19641964
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
633+
exports.version = "19.1.0-www-classic-19ca800c-20250131";

compiled/facebook-www/React-prod.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
633+
exports.version = "19.1.0-www-modern-19ca800c-20250131";

compiled/facebook-www/React-profiling.classic.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
637+
exports.version = "19.1.0-www-classic-19ca800c-20250131";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
637+
exports.version = "19.1.0-www-modern-19ca800c-20250131";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -10917,9 +10917,6 @@ __DEV__ &&
1091710917
hostParentIsContainer = !1;
1091810918
break a;
1091910919
case 3:
10920-
hostParent = parent.stateNode.containerInfo;
10921-
hostParentIsContainer = !0;
10922-
break a;
1092310920
case 4:
1092410921
hostParent = parent.stateNode.containerInfo;
1092510922
hostParentIsContainer = !0;
@@ -16935,10 +16932,10 @@ __DEV__ &&
1693516932
(function () {
1693616933
var internals = {
1693716934
bundleType: 1,
16938-
version: "19.1.0-www-classic-9ff42a87-20250130",
16935+
version: "19.1.0-www-classic-19ca800c-20250131",
1693916936
rendererPackageName: "react-art",
1694016937
currentDispatcherRef: ReactSharedInternals,
16941-
reconcilerVersion: "19.1.0-www-classic-9ff42a87-20250130"
16938+
reconcilerVersion: "19.1.0-www-classic-19ca800c-20250131"
1694216939
};
1694316940
internals.overrideHookState = overrideHookState;
1694416941
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16972,7 +16969,7 @@ __DEV__ &&
1697216969
exports.Shape = Shape;
1697316970
exports.Surface = Surface;
1697416971
exports.Text = Text;
16975-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
16972+
exports.version = "19.1.0-www-classic-19ca800c-20250131";
1697616973
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1697716974
"function" ===
1697816975
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -10735,9 +10735,6 @@ __DEV__ &&
1073510735
hostParentIsContainer = !1;
1073610736
break a;
1073710737
case 3:
10738-
hostParent = parent.stateNode.containerInfo;
10739-
hostParentIsContainer = !0;
10740-
break a;
1074110738
case 4:
1074210739
hostParent = parent.stateNode.containerInfo;
1074310740
hostParentIsContainer = !0;
@@ -16707,10 +16704,10 @@ __DEV__ &&
1670716704
(function () {
1670816705
var internals = {
1670916706
bundleType: 1,
16710-
version: "19.1.0-www-modern-9ff42a87-20250130",
16707+
version: "19.1.0-www-modern-19ca800c-20250131",
1671116708
rendererPackageName: "react-art",
1671216709
currentDispatcherRef: ReactSharedInternals,
16713-
reconcilerVersion: "19.1.0-www-modern-9ff42a87-20250130"
16710+
reconcilerVersion: "19.1.0-www-modern-19ca800c-20250131"
1671416711
};
1671516712
internals.overrideHookState = overrideHookState;
1671616713
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16744,7 +16741,7 @@ __DEV__ &&
1674416741
exports.Shape = Shape;
1674516742
exports.Surface = Surface;
1674616743
exports.Text = Text;
16747-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
16744+
exports.version = "19.1.0-www-modern-19ca800c-20250131";
1674816745
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1674916746
"function" ===
1675016747
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-prod.classic.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -7883,9 +7883,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
78837883
hostParentIsContainer = !1;
78847884
break a;
78857885
case 3:
7886-
hostParent = parent.stateNode.containerInfo;
7887-
hostParentIsContainer = !0;
7888-
break a;
78897886
case 4:
78907887
hostParent = parent.stateNode.containerInfo;
78917888
hostParentIsContainer = !0;
@@ -10816,10 +10813,10 @@ var slice = Array.prototype.slice,
1081610813
})(React.Component);
1081710814
var internals$jscomp$inline_1512 = {
1081810815
bundleType: 0,
10819-
version: "19.1.0-www-classic-9ff42a87-20250130",
10816+
version: "19.1.0-www-classic-19ca800c-20250131",
1082010817
rendererPackageName: "react-art",
1082110818
currentDispatcherRef: ReactSharedInternals,
10822-
reconcilerVersion: "19.1.0-www-classic-9ff42a87-20250130"
10819+
reconcilerVersion: "19.1.0-www-classic-19ca800c-20250131"
1082310820
};
1082410821
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1082510822
var hook$jscomp$inline_1513 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10845,4 +10842,4 @@ exports.RadialGradient = RadialGradient;
1084510842
exports.Shape = TYPES.SHAPE;
1084610843
exports.Surface = Surface;
1084710844
exports.Text = Text;
10848-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
10845+
exports.version = "19.1.0-www-classic-19ca800c-20250131";

compiled/facebook-www/ReactART-prod.modern.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -7642,9 +7642,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
76427642
hostParentIsContainer = !1;
76437643
break a;
76447644
case 3:
7645-
hostParent = parent.stateNode.containerInfo;
7646-
hostParentIsContainer = !0;
7647-
break a;
76487645
case 4:
76497646
hostParent = parent.stateNode.containerInfo;
76507647
hostParentIsContainer = !0;
@@ -10536,10 +10533,10 @@ var slice = Array.prototype.slice,
1053610533
})(React.Component);
1053710534
var internals$jscomp$inline_1485 = {
1053810535
bundleType: 0,
10539-
version: "19.1.0-www-modern-9ff42a87-20250130",
10536+
version: "19.1.0-www-modern-19ca800c-20250131",
1054010537
rendererPackageName: "react-art",
1054110538
currentDispatcherRef: ReactSharedInternals,
10542-
reconcilerVersion: "19.1.0-www-modern-9ff42a87-20250130"
10539+
reconcilerVersion: "19.1.0-www-modern-19ca800c-20250131"
1054310540
};
1054410541
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1054510542
var hook$jscomp$inline_1486 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10565,4 +10562,4 @@ exports.RadialGradient = RadialGradient;
1056510562
exports.Shape = TYPES.SHAPE;
1056610563
exports.Surface = Surface;
1056710564
exports.Text = Text;
10568-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
10565+
exports.version = "19.1.0-www-modern-19ca800c-20250131";

compiled/facebook-www/ReactDOM-dev.classic.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -13901,9 +13901,6 @@ __DEV__ &&
1390113901
hostParentIsContainer = !1;
1390213902
break a;
1390313903
case 3:
13904-
hostParent = parent.stateNode.containerInfo;
13905-
hostParentIsContainer = !0;
13906-
break a;
1390713904
case 4:
1390813905
hostParent = parent.stateNode.containerInfo;
1390913906
hostParentIsContainer = !0;
@@ -27478,11 +27475,11 @@ __DEV__ &&
2747827475
return_targetInst = null;
2747927476
(function () {
2748027477
var isomorphicReactPackageVersion = React.version;
27481-
if ("19.1.0-www-classic-9ff42a87-20250130" !== isomorphicReactPackageVersion)
27478+
if ("19.1.0-www-classic-19ca800c-20250131" !== isomorphicReactPackageVersion)
2748227479
throw Error(
2748327480
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2748427481
(isomorphicReactPackageVersion +
27485-
"\n - react-dom: 19.1.0-www-classic-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
27482+
"\n - react-dom: 19.1.0-www-classic-19ca800c-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
2748627483
);
2748727484
})();
2748827485
("function" === typeof Map &&
@@ -27525,10 +27522,10 @@ __DEV__ &&
2752527522
!(function () {
2752627523
var internals = {
2752727524
bundleType: 1,
27528-
version: "19.1.0-www-classic-9ff42a87-20250130",
27525+
version: "19.1.0-www-classic-19ca800c-20250131",
2752927526
rendererPackageName: "react-dom",
2753027527
currentDispatcherRef: ReactSharedInternals,
27531-
reconcilerVersion: "19.1.0-www-classic-9ff42a87-20250130"
27528+
reconcilerVersion: "19.1.0-www-classic-19ca800c-20250131"
2753227529
};
2753327530
internals.overrideHookState = overrideHookState;
2753427531
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -28126,7 +28123,7 @@ __DEV__ &&
2812628123
exports.useFormStatus = function () {
2812728124
return resolveDispatcher().useHostTransitionStatus();
2812828125
};
28129-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
28126+
exports.version = "19.1.0-www-classic-19ca800c-20250131";
2813028127
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2813128128
"function" ===
2813228129
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactDOM-dev.modern.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -13700,9 +13700,6 @@ __DEV__ &&
1370013700
hostParentIsContainer = !1;
1370113701
break a;
1370213702
case 3:
13703-
hostParent = parent.stateNode.containerInfo;
13704-
hostParentIsContainer = !0;
13705-
break a;
1370613703
case 4:
1370713704
hostParent = parent.stateNode.containerInfo;
1370813705
hostParentIsContainer = !0;
@@ -27264,11 +27261,11 @@ __DEV__ &&
2726427261
return_targetInst = null;
2726527262
(function () {
2726627263
var isomorphicReactPackageVersion = React.version;
27267-
if ("19.1.0-www-modern-9ff42a87-20250130" !== isomorphicReactPackageVersion)
27264+
if ("19.1.0-www-modern-19ca800c-20250131" !== isomorphicReactPackageVersion)
2726827265
throw Error(
2726927266
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2727027267
(isomorphicReactPackageVersion +
27271-
"\n - react-dom: 19.1.0-www-modern-9ff42a87-20250130\nLearn more: https://react.dev/warnings/version-mismatch")
27268+
"\n - react-dom: 19.1.0-www-modern-19ca800c-20250131\nLearn more: https://react.dev/warnings/version-mismatch")
2727227269
);
2727327270
})();
2727427271
("function" === typeof Map &&
@@ -27311,10 +27308,10 @@ __DEV__ &&
2731127308
!(function () {
2731227309
var internals = {
2731327310
bundleType: 1,
27314-
version: "19.1.0-www-modern-9ff42a87-20250130",
27311+
version: "19.1.0-www-modern-19ca800c-20250131",
2731527312
rendererPackageName: "react-dom",
2731627313
currentDispatcherRef: ReactSharedInternals,
27317-
reconcilerVersion: "19.1.0-www-modern-9ff42a87-20250130"
27314+
reconcilerVersion: "19.1.0-www-modern-19ca800c-20250131"
2731827315
};
2731927316
internals.overrideHookState = overrideHookState;
2732027317
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -27912,7 +27909,7 @@ __DEV__ &&
2791227909
exports.useFormStatus = function () {
2791327910
return resolveDispatcher().useHostTransitionStatus();
2791427911
};
27915-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
27912+
exports.version = "19.1.0-www-modern-19ca800c-20250131";
2791627913
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
2791727914
"function" ===
2791827915
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactDOM-prod.classic.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -9564,9 +9564,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
95649564
hostParentIsContainer = !1;
95659565
break a;
95669566
case 3:
9567-
hostParent = parent.stateNode.containerInfo;
9568-
hostParentIsContainer = !0;
9569-
break a;
95709567
case 4:
95719568
hostParent = parent.stateNode.containerInfo;
95729569
hostParentIsContainer = !0;
@@ -17346,14 +17343,14 @@ function getCrossOriginStringAs(as, input) {
1734617343
}
1734717344
var isomorphicReactPackageVersion$jscomp$inline_1799 = React.version;
1734817345
if (
17349-
"19.1.0-www-classic-9ff42a87-20250130" !==
17346+
"19.1.0-www-classic-19ca800c-20250131" !==
1735017347
isomorphicReactPackageVersion$jscomp$inline_1799
1735117348
)
1735217349
throw Error(
1735317350
formatProdErrorMessage(
1735417351
527,
1735517352
isomorphicReactPackageVersion$jscomp$inline_1799,
17356-
"19.1.0-www-classic-9ff42a87-20250130"
17353+
"19.1.0-www-classic-19ca800c-20250131"
1735717354
)
1735817355
);
1735917356
Internals.findDOMNode = function (componentOrElement) {
@@ -17371,10 +17368,10 @@ Internals.Events = [
1737117368
];
1737217369
var internals$jscomp$inline_2330 = {
1737317370
bundleType: 0,
17374-
version: "19.1.0-www-classic-9ff42a87-20250130",
17371+
version: "19.1.0-www-classic-19ca800c-20250131",
1737517372
rendererPackageName: "react-dom",
1737617373
currentDispatcherRef: ReactSharedInternals,
17377-
reconcilerVersion: "19.1.0-www-classic-9ff42a87-20250130"
17374+
reconcilerVersion: "19.1.0-www-classic-19ca800c-20250131"
1737817375
};
1737917376
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1738017377
var hook$jscomp$inline_2331 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17738,4 +17735,4 @@ exports.useFormState = function (action, initialState, permalink) {
1773817735
exports.useFormStatus = function () {
1773917736
return ReactSharedInternals.H.useHostTransitionStatus();
1774017737
};
17741-
exports.version = "19.1.0-www-classic-9ff42a87-20250130";
17738+
exports.version = "19.1.0-www-classic-19ca800c-20250131";

compiled/facebook-www/ReactDOM-prod.modern.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -9315,9 +9315,6 @@ function recursivelyTraverseMutationEffects(root$jscomp$0, parentFiber) {
93159315
hostParentIsContainer = !1;
93169316
break a;
93179317
case 3:
9318-
hostParent = parent.stateNode.containerInfo;
9319-
hostParentIsContainer = !0;
9320-
break a;
93219318
case 4:
93229319
hostParent = parent.stateNode.containerInfo;
93239320
hostParentIsContainer = !0;
@@ -17082,14 +17079,14 @@ function getCrossOriginStringAs(as, input) {
1708217079
}
1708317080
var isomorphicReactPackageVersion$jscomp$inline_1789 = React.version;
1708417081
if (
17085-
"19.1.0-www-modern-9ff42a87-20250130" !==
17082+
"19.1.0-www-modern-19ca800c-20250131" !==
1708617083
isomorphicReactPackageVersion$jscomp$inline_1789
1708717084
)
1708817085
throw Error(
1708917086
formatProdErrorMessage(
1709017087
527,
1709117088
isomorphicReactPackageVersion$jscomp$inline_1789,
17092-
"19.1.0-www-modern-9ff42a87-20250130"
17089+
"19.1.0-www-modern-19ca800c-20250131"
1709317090
)
1709417091
);
1709517092
Internals.findDOMNode = function (componentOrElement) {
@@ -17107,10 +17104,10 @@ Internals.Events = [
1710717104
];
1710817105
var internals$jscomp$inline_2312 = {
1710917106
bundleType: 0,
17110-
version: "19.1.0-www-modern-9ff42a87-20250130",
17107+
version: "19.1.0-www-modern-19ca800c-20250131",
1711117108
rendererPackageName: "react-dom",
1711217109
currentDispatcherRef: ReactSharedInternals,
17113-
reconcilerVersion: "19.1.0-www-modern-9ff42a87-20250130"
17110+
reconcilerVersion: "19.1.0-www-modern-19ca800c-20250131"
1711417111
};
1711517112
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1711617113
var hook$jscomp$inline_2313 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17474,4 +17471,4 @@ exports.useFormState = function (action, initialState, permalink) {
1747417471
exports.useFormStatus = function () {
1747517472
return ReactSharedInternals.H.useHostTransitionStatus();
1747617473
};
17477-
exports.version = "19.1.0-www-modern-9ff42a87-20250130";
17474+
exports.version = "19.1.0-www-modern-19ca800c-20250131";

0 commit comments

Comments
 (0)