Skip to content

Commit d587415

Browse files
committed
Mark shouldStartViewTransition as true when there's an enter animation (#32764)
Typically we mark the name of things that might animate in the snapshot phase. At the same time we track that should call startViewTransition too. However, we don't do this for "enter" since they're only marked later. Leading to having just an "enter" not to animate unless there's at least another update too. This tracks if there's a ViewTransitionComponent in the tree that enters. Luckily we know that from the static flag so we don't have to traverse it. DiffTrain build for [4280563](4280563)
1 parent 473ee29 commit d587415

34 files changed

+254
-146
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3e88e97c116c7a1535976f2d4486bbf345476443
1+
4280563b04898baad423dc7d0f8b0dfea3b1797a
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3e88e97c116c7a1535976f2d4486bbf345476443
1+
4280563b04898baad423dc7d0f8b0dfea3b1797a

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,7 @@ __DEV__ &&
15111511
exports.useTransition = function () {
15121512
return resolveDispatcher().useTransition();
15131513
};
1514-
exports.version = "19.1.0-www-classic-3e88e97c-20250326";
1514+
exports.version = "19.1.0-www-classic-4280563b-20250326";
15151515
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15161516
"function" ===
15171517
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
@@ -1511,7 +1511,7 @@ __DEV__ &&
15111511
exports.useTransition = function () {
15121512
return resolveDispatcher().useTransition();
15131513
};
1514-
exports.version = "19.1.0-www-modern-3e88e97c-20250326";
1514+
exports.version = "19.1.0-www-modern-4280563b-20250326";
15151515
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15161516
"function" ===
15171517
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
@@ -624,4 +624,4 @@ exports.useSyncExternalStore = function (
624624
exports.useTransition = function () {
625625
return ReactSharedInternals.H.useTransition();
626626
};
627-
exports.version = "19.1.0-www-classic-3e88e97c-20250326";
627+
exports.version = "19.1.0-www-classic-4280563b-20250326";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,4 +624,4 @@ exports.useSyncExternalStore = function (
624624
exports.useTransition = function () {
625625
return ReactSharedInternals.H.useTransition();
626626
};
627-
exports.version = "19.1.0-www-modern-3e88e97c-20250326";
627+
exports.version = "19.1.0-www-modern-4280563b-20250326";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ exports.useSyncExternalStore = function (
628628
exports.useTransition = function () {
629629
return ReactSharedInternals.H.useTransition();
630630
};
631-
exports.version = "19.1.0-www-classic-3e88e97c-20250326";
631+
exports.version = "19.1.0-www-classic-4280563b-20250326";
632632
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
633633
"function" ===
634634
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
@@ -628,7 +628,7 @@ exports.useSyncExternalStore = function (
628628
exports.useTransition = function () {
629629
return ReactSharedInternals.H.useTransition();
630630
};
631-
exports.version = "19.1.0-www-modern-3e88e97c-20250326";
631+
exports.version = "19.1.0-www-modern-4280563b-20250326";
632632
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
633633
"function" ===
634634
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10432,6 +10432,10 @@ __DEV__ &&
1043210432
);
1043310433
}
1043410434
}
10435+
function trackEnterViewTransitions(placement) {
10436+
if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432))
10437+
shouldStartViewTransition = !0;
10438+
}
1043510439
function applyViewTransitionToHostInstancesRecursive(
1043610440
child,
1043710441
name,
@@ -10441,10 +10445,10 @@ __DEV__ &&
1044110445
) {
1044210446
for (var inViewport = !1; null !== child; ) {
1044310447
if (5 === child.tag)
10444-
(shouldStartViewTransition = !0),
10445-
null !== collectMeasurements
10446-
? (collectMeasurements.push(null), (inViewport = !0))
10447-
: inViewport || (inViewport = !0);
10448+
null !== collectMeasurements
10449+
? (collectMeasurements.push(null), (inViewport = !0))
10450+
: inViewport || (inViewport = !0),
10451+
(shouldStartViewTransition = !0);
1044810452
else if (22 !== child.tag || null === child.memoizedState)
1044910453
(30 === child.tag && stopAtNestedViewTransitions) ||
1045010454
(applyViewTransitionToHostInstancesRecursive(
@@ -10639,7 +10643,8 @@ __DEV__ &&
1063910643
null === committedLanes.alternate &&
1064010644
0 !== (committedLanes.flags & 2)
1064110645
)
10642-
commitBeforeMutationEffects_complete(root);
10646+
root && trackEnterViewTransitions(committedLanes),
10647+
commitBeforeMutationEffects_complete(root);
1064310648
else {
1064410649
if (enableViewTransition && 22 === committedLanes.tag)
1064510650
if (
@@ -10653,6 +10658,7 @@ __DEV__ &&
1065310658
commitBeforeMutationEffects_complete(root);
1065410659
continue;
1065510660
} else if (null !== deletions && null !== deletions.memoizedState) {
10661+
root && trackEnterViewTransitions(committedLanes);
1065610662
commitBeforeMutationEffects_complete(root);
1065710663
continue;
1065810664
}
@@ -18194,10 +18200,10 @@ __DEV__ &&
1819418200
(function () {
1819518201
var internals = {
1819618202
bundleType: 1,
18197-
version: "19.1.0-www-classic-3e88e97c-20250326",
18203+
version: "19.1.0-www-classic-4280563b-20250326",
1819818204
rendererPackageName: "react-art",
1819918205
currentDispatcherRef: ReactSharedInternals,
18200-
reconcilerVersion: "19.1.0-www-classic-3e88e97c-20250326"
18206+
reconcilerVersion: "19.1.0-www-classic-4280563b-20250326"
1820118207
};
1820218208
internals.overrideHookState = overrideHookState;
1820318209
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18231,7 +18237,7 @@ __DEV__ &&
1823118237
exports.Shape = Shape;
1823218238
exports.Surface = Surface;
1823318239
exports.Text = Text;
18234-
exports.version = "19.1.0-www-classic-3e88e97c-20250326";
18240+
exports.version = "19.1.0-www-classic-4280563b-20250326";
1823518241
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1823618242
"function" ===
1823718243
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10250,6 +10250,10 @@ __DEV__ &&
1025010250
);
1025110251
}
1025210252
}
10253+
function trackEnterViewTransitions(placement) {
10254+
if (30 === placement.tag || 0 !== (placement.subtreeFlags & 33554432))
10255+
shouldStartViewTransition = !0;
10256+
}
1025310257
function applyViewTransitionToHostInstancesRecursive(
1025410258
child,
1025510259
name,
@@ -10259,10 +10263,10 @@ __DEV__ &&
1025910263
) {
1026010264
for (var inViewport = !1; null !== child; ) {
1026110265
if (5 === child.tag)
10262-
(shouldStartViewTransition = !0),
10263-
null !== collectMeasurements
10264-
? (collectMeasurements.push(null), (inViewport = !0))
10265-
: inViewport || (inViewport = !0);
10266+
null !== collectMeasurements
10267+
? (collectMeasurements.push(null), (inViewport = !0))
10268+
: inViewport || (inViewport = !0),
10269+
(shouldStartViewTransition = !0);
1026610270
else if (22 !== child.tag || null === child.memoizedState)
1026710271
(30 === child.tag && stopAtNestedViewTransitions) ||
1026810272
(applyViewTransitionToHostInstancesRecursive(
@@ -10457,7 +10461,8 @@ __DEV__ &&
1045710461
null === committedLanes.alternate &&
1045810462
0 !== (committedLanes.flags & 2)
1045910463
)
10460-
commitBeforeMutationEffects_complete(root);
10464+
root && trackEnterViewTransitions(committedLanes),
10465+
commitBeforeMutationEffects_complete(root);
1046110466
else {
1046210467
if (enableViewTransition && 22 === committedLanes.tag)
1046310468
if (
@@ -10471,6 +10476,7 @@ __DEV__ &&
1047110476
commitBeforeMutationEffects_complete(root);
1047210477
continue;
1047310478
} else if (null !== deletions && null !== deletions.memoizedState) {
10479+
root && trackEnterViewTransitions(committedLanes);
1047410480
commitBeforeMutationEffects_complete(root);
1047510481
continue;
1047610482
}
@@ -17966,10 +17972,10 @@ __DEV__ &&
1796617972
(function () {
1796717973
var internals = {
1796817974
bundleType: 1,
17969-
version: "19.1.0-www-modern-3e88e97c-20250326",
17975+
version: "19.1.0-www-modern-4280563b-20250326",
1797017976
rendererPackageName: "react-art",
1797117977
currentDispatcherRef: ReactSharedInternals,
17972-
reconcilerVersion: "19.1.0-www-modern-3e88e97c-20250326"
17978+
reconcilerVersion: "19.1.0-www-modern-4280563b-20250326"
1797317979
};
1797417980
internals.overrideHookState = overrideHookState;
1797517981
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18003,7 +18009,7 @@ __DEV__ &&
1800318009
exports.Shape = Shape;
1800418010
exports.Surface = Surface;
1800518011
exports.Text = Text;
18006-
exports.version = "19.1.0-www-modern-3e88e97c-20250326";
18012+
exports.version = "19.1.0-www-modern-4280563b-20250326";
1800718013
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1800818014
"function" ===
1800918015
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)