Skip to content

Commit 395e7f7

Browse files
committed
[Fiber] Track Appearing Named ViewTransition in the accumulateSuspenseyCommit Phase (facebook#32254)
When a named ViewTransition component unmounts in one place and mounts in a different place we need to match these up so we know a pair has been created. Since the unmounts are tracked in the snapshot phase we need some way to track the mounts before that. Originally the way I did that is by reusing the render phase since there was no other phase in the commit before that. However, that's not quite correct. Just because something is visited in render doesn't mean it'll commit. E.g. if that tree ends up suspending or erroring. Which would lead to a false positive on match. The unmount shouldn't animate in that case. (Un)fortunately we have already added a traversal before the snapshot phase for tracking suspensey CSS. The `accumulateSuspenseyCommit` phase. This needs to find new mounts of Suspensey CSS or if there was a reappearing Offscreen boundary it needs to find any Suspensey CSS already inside that tree. This is exactly the same traversal we need to find newly appearing View Transition components. So we can just reuse that. DiffTrain build for [4b3728f](facebook@4b3728f)
1 parent e3cd7a8 commit 395e7f7

23 files changed

+590
-807
lines changed

compiled-rn/VERSION_NATIVE_FB

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
19.1.0-native-fb-bb9a24d9-20250130
1+
19.1.0-native-fb-4b3728f0-20250130

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-dev.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<8d5e7d372fe2fd0f37a10f34d40bbb1a>>
10+
* @generated SignedSource<<72ca7e17e4fb434a3af16bb4f42c2eee>>
1111
*/
1212

1313
"use strict";
@@ -428,5 +428,5 @@ __DEV__ &&
428428
exports.useFormStatus = function () {
429429
return resolveDispatcher().useHostTransitionStatus();
430430
};
431-
exports.version = "19.1.0-native-fb-bb9a24d9-20250130";
431+
exports.version = "19.1.0-native-fb-4b3728f0-20250130";
432432
})();

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-prod.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b9ff6276b3a71ecf83952af1e68c394c>>
10+
* @generated SignedSource<<8def3f8abeae965eb21062caf3412e9b>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-bb9a24d9-20250130";
206+
exports.version = "19.1.0-native-fb-4b3728f0-20250130";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOM-profiling.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<b9ff6276b3a71ecf83952af1e68c394c>>
10+
* @generated SignedSource<<8def3f8abeae965eb21062caf3412e9b>>
1111
*/
1212

1313
"use strict";
@@ -203,4 +203,4 @@ exports.useFormState = function (action, initialState, permalink) {
203203
exports.useFormStatus = function () {
204204
return ReactSharedInternals.H.useHostTransitionStatus();
205205
};
206-
exports.version = "19.1.0-native-fb-bb9a24d9-20250130";
206+
exports.version = "19.1.0-native-fb-4b3728f0-20250130";

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-dev.js

Lines changed: 171 additions & 187 deletions
Large diffs are not rendered by default.

compiled-rn/facebook-fbsource/xplat/js/RKJSModules/vendor/react/react-dom/cjs/ReactDOMClient-prod.js

Lines changed: 32 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<6bdd9b6624ee084c8fac56a8ac35f8db>>
10+
* @generated SignedSource<<b88187312b21ec96d233aa6e221126a2>>
1111
*/
1212

1313
/*
@@ -10919,7 +10919,6 @@ var DefaultAsyncDispatcher = {
1091910919
workInProgressSuspendedRetryLanes = 0,
1092010920
workInProgressRootConcurrentErrors = null,
1092110921
workInProgressRootRecoverableErrors = null,
10922-
workInProgressAppearingViewTransitions = null,
1092310922
workInProgressRootDidIncludeRecursiveRenderUpdate = !1,
1092410923
globalMostRecentFallbackTime = 0,
1092510924
workInProgressRootRenderTargetTime = Infinity,
@@ -11119,7 +11118,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
1111911118
forceSync,
1112011119
workInProgressRootRecoverableErrors,
1112111120
workInProgressTransitions,
11122-
workInProgressAppearingViewTransitions,
1112311121
workInProgressRootDidIncludeRecursiveRenderUpdate,
1112411122
lanes,
1112511123
workInProgressDeferredLane,
@@ -11140,7 +11138,6 @@ function performWorkOnRoot(root$jscomp$0, lanes, forceSync) {
1114011138
forceSync,
1114111139
workInProgressRootRecoverableErrors,
1114211140
workInProgressTransitions,
11143-
workInProgressAppearingViewTransitions,
1114411141
workInProgressRootDidIncludeRecursiveRenderUpdate,
1114511142
lanes,
1114611143
workInProgressDeferredLane,
@@ -11163,7 +11160,6 @@ function commitRootWhenReady(
1116311160
finishedWork,
1116411161
recoverableErrors,
1116511162
transitions,
11166-
appearingViewTransitions,
1116711163
didIncludeRenderPhaseUpdate,
1116811164
lanes,
1116911165
spawnedLane,
@@ -11178,13 +11174,12 @@ function commitRootWhenReady(
1117811174
root.timeoutHandle = -1;
1117911175
suspendedCommitReason = finishedWork.subtreeFlags;
1118011176
if (
11181-
(suspendedCommitReason =
11182-
suspendedCommitReason & 8192 ||
11183-
16785408 === (suspendedCommitReason & 16785408))
11177+
suspendedCommitReason & 8192 ||
11178+
16785408 === (suspendedCommitReason & 16785408)
1118411179
)
1118511180
if (
1118611181
((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }),
11187-
suspendedCommitReason && accumulateSuspenseyCommitOnFiber(finishedWork),
11182+
accumulateSuspenseyCommitOnFiber(finishedWork),
1118811183
(suspendedCommitReason = waitForCommitToBeReady()),
1118911184
null !== suspendedCommitReason)
1119011185
) {
@@ -11196,7 +11191,6 @@ function commitRootWhenReady(
1119611191
lanes,
1119711192
recoverableErrors,
1119811193
transitions,
11199-
appearingViewTransitions,
1120011194
didIncludeRenderPhaseUpdate,
1120111195
spawnedLane,
1120211196
updatedLanes,
@@ -11216,7 +11210,6 @@ function commitRootWhenReady(
1121611210
lanes,
1121711211
recoverableErrors,
1121811212
transitions,
11219-
appearingViewTransitions,
1122011213
didIncludeRenderPhaseUpdate,
1122111214
spawnedLane,
1122211215
updatedLanes,
@@ -11328,7 +11321,6 @@ function prepareFreshStack(root, lanes) {
1132811321
workInProgressRootRecoverableErrors = workInProgressRootConcurrentErrors =
1132911322
null;
1133011323
workInProgressRootDidIncludeRecursiveRenderUpdate = !1;
11331-
workInProgressAppearingViewTransitions = null;
1133211324
0 !== (lanes & 8) && (lanes |= lanes & 32);
1133311325
var allEntangledLanes = root.entangledLanes;
1133411326
if (0 !== allEntangledLanes)
@@ -11771,7 +11763,6 @@ function commitRoot(
1177111763
lanes,
1177211764
recoverableErrors,
1177311765
transitions,
11774-
appearingViewTransitions,
1177511766
didIncludeRenderPhaseUpdate,
1177611767
spawnedLane,
1177711768
updatedLanes,
@@ -11820,12 +11811,7 @@ function commitRoot(
1182011811
spawnedLane = executionContext;
1182111812
executionContext |= 4;
1182211813
try {
11823-
commitBeforeMutationEffects(
11824-
root,
11825-
finishedWork,
11826-
lanes,
11827-
appearingViewTransitions
11828-
);
11814+
commitBeforeMutationEffects(root, finishedWork, lanes);
1182911815
} finally {
1183011816
(executionContext = spawnedLane),
1183111817
(ReactDOMSharedInternals.p = transitions),
@@ -12512,20 +12498,20 @@ function extractEvents$1(
1251212498
}
1251312499
}
1251412500
for (
12515-
var i$jscomp$inline_1544 = 0;
12516-
i$jscomp$inline_1544 < simpleEventPluginEvents.length;
12517-
i$jscomp$inline_1544++
12501+
var i$jscomp$inline_1543 = 0;
12502+
i$jscomp$inline_1543 < simpleEventPluginEvents.length;
12503+
i$jscomp$inline_1543++
1251812504
) {
12519-
var eventName$jscomp$inline_1545 =
12520-
simpleEventPluginEvents[i$jscomp$inline_1544],
12521-
domEventName$jscomp$inline_1546 =
12522-
eventName$jscomp$inline_1545.toLowerCase(),
12523-
capitalizedEvent$jscomp$inline_1547 =
12524-
eventName$jscomp$inline_1545[0].toUpperCase() +
12525-
eventName$jscomp$inline_1545.slice(1);
12505+
var eventName$jscomp$inline_1544 =
12506+
simpleEventPluginEvents[i$jscomp$inline_1543],
12507+
domEventName$jscomp$inline_1545 =
12508+
eventName$jscomp$inline_1544.toLowerCase(),
12509+
capitalizedEvent$jscomp$inline_1546 =
12510+
eventName$jscomp$inline_1544[0].toUpperCase() +
12511+
eventName$jscomp$inline_1544.slice(1);
1252612512
registerSimpleEvent(
12527-
domEventName$jscomp$inline_1546,
12528-
"on" + capitalizedEvent$jscomp$inline_1547
12513+
domEventName$jscomp$inline_1545,
12514+
"on" + capitalizedEvent$jscomp$inline_1546
1252912515
);
1253012516
}
1253112517
registerSimpleEvent(ANIMATION_END, "onAnimationEnd");
@@ -16015,16 +16001,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1601516001
0 === i && attemptExplicitHydrationTarget(target);
1601616002
}
1601716003
};
16018-
var isomorphicReactPackageVersion$jscomp$inline_1787 = React.version;
16004+
var isomorphicReactPackageVersion$jscomp$inline_1786 = React.version;
1601916005
if (
16020-
"19.1.0-native-fb-bb9a24d9-20250130" !==
16021-
isomorphicReactPackageVersion$jscomp$inline_1787
16006+
"19.1.0-native-fb-4b3728f0-20250130" !==
16007+
isomorphicReactPackageVersion$jscomp$inline_1786
1602216008
)
1602316009
throw Error(
1602416010
formatProdErrorMessage(
1602516011
527,
16026-
isomorphicReactPackageVersion$jscomp$inline_1787,
16027-
"19.1.0-native-fb-bb9a24d9-20250130"
16012+
isomorphicReactPackageVersion$jscomp$inline_1786,
16013+
"19.1.0-native-fb-4b3728f0-20250130"
1602816014
)
1602916015
);
1603016016
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -16044,24 +16030,24 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1604416030
null === componentOrElement ? null : componentOrElement.stateNode;
1604516031
return componentOrElement;
1604616032
};
16047-
var internals$jscomp$inline_2243 = {
16033+
var internals$jscomp$inline_2242 = {
1604816034
bundleType: 0,
16049-
version: "19.1.0-native-fb-bb9a24d9-20250130",
16035+
version: "19.1.0-native-fb-4b3728f0-20250130",
1605016036
rendererPackageName: "react-dom",
1605116037
currentDispatcherRef: ReactSharedInternals,
16052-
reconcilerVersion: "19.1.0-native-fb-bb9a24d9-20250130"
16038+
reconcilerVersion: "19.1.0-native-fb-4b3728f0-20250130"
1605316039
};
1605416040
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
16055-
var hook$jscomp$inline_2244 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
16041+
var hook$jscomp$inline_2243 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1605616042
if (
16057-
!hook$jscomp$inline_2244.isDisabled &&
16058-
hook$jscomp$inline_2244.supportsFiber
16043+
!hook$jscomp$inline_2243.isDisabled &&
16044+
hook$jscomp$inline_2243.supportsFiber
1605916045
)
1606016046
try {
16061-
(rendererID = hook$jscomp$inline_2244.inject(
16062-
internals$jscomp$inline_2243
16047+
(rendererID = hook$jscomp$inline_2243.inject(
16048+
internals$jscomp$inline_2242
1606316049
)),
16064-
(injectedHook = hook$jscomp$inline_2244);
16050+
(injectedHook = hook$jscomp$inline_2243);
1606516051
} catch (err) {}
1606616052
}
1606716053
exports.createRoot = function (container, options) {
@@ -16155,4 +16141,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1615516141
listenToAllSupportedEvents(container);
1615616142
return new ReactDOMHydrationRoot(initialChildren);
1615716143
};
16158-
exports.version = "19.1.0-native-fb-bb9a24d9-20250130";
16144+
exports.version = "19.1.0-native-fb-4b3728f0-20250130";

0 commit comments

Comments
 (0)