Skip to content

Commit 9243463

Browse files
committed
Find Pairs and Apply View Transition Names to the Clones in the "old" Phase (#32599)
Stacked on #32578. We need to apply view-transition-names to the clones that we create in the "old" phase for the ViewTransition boundaries that should activate. Finding pairs is a little trickier than in ReactFiberCommitViewTransitions. Normally we collect all name "insertions" in the `accumulateSuspenseyCommit` phase before we even commit. Then in the snapshot do we visit all "deletions" and since we already collected all the insertions we know immediately if the deletion had a pair and should therefore get a "name" assigned to activate the boundary. For ReactFiberApplyGesture we need to assign names to "insertions" since it's in reverse but we don't already have a map of deletions. Therefore we need to first visit all deletions. Instead of doing that in a completely separate pass, we instead visit deletions in the same pass to find pairs. Since this is in the same pass we might visit insertions before deletions or vice versa depending on document order. However, we can deal with this by applying the name to the insertion when we find the deletion if we've already made the clones at that point. Applying names to pure exits, updates or nested (relayout) is a bit more straight-forward. DiffTrain build for [2e38573](2e38573)
1 parent 3d227aa commit 9243463

34 files changed

+194
-122
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c4a3b92e098cf1896939758e7419cbdb0e2f0cf4
1+
2e385738a4dfd1554c146f6313b1530a09b5ce78
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c4a3b92e098cf1896939758e7419cbdb0e2f0cf4
1+
2e385738a4dfd1554c146f6313b1530a09b5ce78

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ __DEV__ &&
15321532
exports.useTransition = function () {
15331533
return resolveDispatcher().useTransition();
15341534
};
1535-
exports.version = "19.1.0-www-classic-c4a3b92e-20250314";
1535+
exports.version = "19.1.0-www-classic-2e385738-20250314";
15361536
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15371537
"function" ===
15381538
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1532,7 +1532,7 @@ __DEV__ &&
15321532
exports.useTransition = function () {
15331533
return resolveDispatcher().useTransition();
15341534
};
1535-
exports.version = "19.1.0-www-modern-c4a3b92e-20250314";
1535+
exports.version = "19.1.0-www-modern-2e385738-20250314";
15361536
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15371537
"function" ===
15381538
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
641641
exports.useTransition = function () {
642642
return ReactSharedInternals.H.useTransition();
643643
};
644-
exports.version = "19.1.0-www-classic-c4a3b92e-20250314";
644+
exports.version = "19.1.0-www-classic-2e385738-20250314";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,4 +641,4 @@ exports.useSyncExternalStore = function (
641641
exports.useTransition = function () {
642642
return ReactSharedInternals.H.useTransition();
643643
};
644-
exports.version = "19.1.0-www-modern-c4a3b92e-20250314";
644+
exports.version = "19.1.0-www-modern-2e385738-20250314";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
645645
exports.useTransition = function () {
646646
return ReactSharedInternals.H.useTransition();
647647
};
648-
exports.version = "19.1.0-www-classic-c4a3b92e-20250314";
648+
exports.version = "19.1.0-www-classic-2e385738-20250314";
649649
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
650650
"function" ===
651651
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ exports.useSyncExternalStore = function (
645645
exports.useTransition = function () {
646646
return ReactSharedInternals.H.useTransition();
647647
};
648-
exports.version = "19.1.0-www-modern-c4a3b92e-20250314";
648+
exports.version = "19.1.0-www-modern-2e385738-20250314";
649649
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
650650
"function" ===
651651
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10673,7 +10673,9 @@ __DEV__ &&
1067310673
null,
1067410674
!1
1067510675
) &&
10676-
((pair.paired = deletion.stateNode),
10676+
((className = deletion.stateNode),
10677+
(pair.paired = className),
10678+
(className.paired = pair),
1067710679
scheduleViewTransitionEvent(deletion, props.onShare));
1067810680
pairs.delete(name);
1067910681
if (0 === pairs.size) break;
@@ -10707,7 +10709,9 @@ __DEV__ &&
1070710709
!1
1070810710
) &&
1070910711
(void 0 !== pair
10710-
? ((pair.paired = deletion.stateNode),
10712+
? ((className = deletion.stateNode),
10713+
(pair.paired = className),
10714+
(className.paired = pair),
1071110715
appearingViewTransitions.delete(name),
1071210716
scheduleViewTransitionEvent(deletion, props.onShare))
1071310717
: scheduleViewTransitionEvent(deletion, props.onExit));
@@ -18503,10 +18507,10 @@ __DEV__ &&
1850318507
(function () {
1850418508
var internals = {
1850518509
bundleType: 1,
18506-
version: "19.1.0-www-classic-c4a3b92e-20250314",
18510+
version: "19.1.0-www-classic-2e385738-20250314",
1850718511
rendererPackageName: "react-art",
1850818512
currentDispatcherRef: ReactSharedInternals,
18509-
reconcilerVersion: "19.1.0-www-classic-c4a3b92e-20250314"
18513+
reconcilerVersion: "19.1.0-www-classic-2e385738-20250314"
1851018514
};
1851118515
internals.overrideHookState = overrideHookState;
1851218516
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18540,7 +18544,7 @@ __DEV__ &&
1854018544
exports.Shape = Shape;
1854118545
exports.Surface = Surface;
1854218546
exports.Text = Text;
18543-
exports.version = "19.1.0-www-classic-c4a3b92e-20250314";
18547+
exports.version = "19.1.0-www-classic-2e385738-20250314";
1854418548
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1854518549
"function" ===
1854618550
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10491,7 +10491,9 @@ __DEV__ &&
1049110491
null,
1049210492
!1
1049310493
) &&
10494-
((pair.paired = deletion.stateNode),
10494+
((className = deletion.stateNode),
10495+
(pair.paired = className),
10496+
(className.paired = pair),
1049510497
scheduleViewTransitionEvent(deletion, props.onShare));
1049610498
pairs.delete(name);
1049710499
if (0 === pairs.size) break;
@@ -10525,7 +10527,9 @@ __DEV__ &&
1052510527
!1
1052610528
) &&
1052710529
(void 0 !== pair
10528-
? ((pair.paired = deletion.stateNode),
10530+
? ((className = deletion.stateNode),
10531+
(pair.paired = className),
10532+
(className.paired = pair),
1052910533
appearingViewTransitions.delete(name),
1053010534
scheduleViewTransitionEvent(deletion, props.onShare))
1053110535
: scheduleViewTransitionEvent(deletion, props.onExit));
@@ -18275,10 +18279,10 @@ __DEV__ &&
1827518279
(function () {
1827618280
var internals = {
1827718281
bundleType: 1,
18278-
version: "19.1.0-www-modern-c4a3b92e-20250314",
18282+
version: "19.1.0-www-modern-2e385738-20250314",
1827918283
rendererPackageName: "react-art",
1828018284
currentDispatcherRef: ReactSharedInternals,
18281-
reconcilerVersion: "19.1.0-www-modern-c4a3b92e-20250314"
18285+
reconcilerVersion: "19.1.0-www-modern-2e385738-20250314"
1828218286
};
1828318287
internals.overrideHookState = overrideHookState;
1828418288
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18312,7 +18316,7 @@ __DEV__ &&
1831218316
exports.Shape = Shape;
1831318317
exports.Surface = Surface;
1831418318
exports.Text = Text;
18315-
exports.version = "19.1.0-www-modern-c4a3b92e-20250314";
18319+
exports.version = "19.1.0-www-modern-2e385738-20250314";
1831618320
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1831718321
"function" ===
1831818322
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)