Skip to content

Commit 02e0b59

Browse files
committed
Remove Mutation Check Around commit/measureUpdateViewTransition (#32617)
There's two ways to find updated View Transitions. One is the "commit/measureNestedViewTransitions" pass which is used to find things in unchanged subtrees. This can only lead to the relayout case since there's can't possibly be any mutations in the subtree. This is only triggered when none of the direct siblings have any mutations at all. The other case is "commit/measureUpdateViewTransition" which is for a ViewTransition that itself has mutations scheduled inside of it which leads to the "update" case. However, there's a case between these two cases. When a direct sibling has a mutation but there's also a ViewTransition exactly at the same level. In that case we can't bail out on the whole set of children so we won't trigger the "nested" case. Previously we also didn't trigger the "commit/measureUpdateViewTransition" case because we first checked if that had any mutations inside of it at all. This leads to neither case picking up this boundary. We could check if the ViewTransition itself has any mutations inside and if not trigger the nested path. There's a simpler way though. Because `commit/measureUpdateViewTransition` is actually just optimistic. The flags are pessimistic and we don't know for sure if there will actually be a mutation until we've traversed the tree. It can sometimes lead to the "relayout" case. So we can just use that same path, knowing that it'll just lead to the layout pass. Therefore it's safe to just remove this check. DiffTrain build for [17d274d](17d274d)
1 parent 97ae80f commit 02e0b59

32 files changed

+1694
-1866
lines changed

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

+1-1
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-6b5d9fd3-20250314";
1535+
exports.version = "19.1.0-www-classic-17d274dc-20250314";
15361536
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15371537
"function" ===
15381538
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
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-6b5d9fd3-20250314";
1535+
exports.version = "19.1.0-www-modern-17d274dc-20250314";
15361536
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15371537
"function" ===
15381538
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
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-6b5d9fd3-20250314";
644+
exports.version = "19.1.0-www-classic-17d274dc-20250314";

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

+1-1
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-6b5d9fd3-20250314";
644+
exports.version = "19.1.0-www-modern-17d274dc-20250314";

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

+1-1
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-6b5d9fd3-20250314";
648+
exports.version = "19.1.0-www-classic-17d274dc-20250314";
649649
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
650650
"function" ===
651651
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+1-1
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-6b5d9fd3-20250314";
648+
exports.version = "19.1.0-www-modern-17d274dc-20250314";
649649
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
650650
"function" ===
651651
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+5-9
Original file line numberDiff line numberDiff line change
@@ -10781,7 +10781,7 @@ __DEV__ &&
1078110781
root =
1078210782
enableViewTransition && (committedLanes & 335544064) === committedLanes;
1078310783
nextEffect = firstChild;
10784-
for (firstChild = root ? 9238 : 9236; null !== nextEffect; ) {
10784+
for (firstChild = root ? 9270 : 9236; null !== nextEffect; ) {
1078510785
committedLanes = nextEffect;
1078610786
var deletions = committedLanes.deletions;
1078710787
if (null !== deletions)
@@ -10892,11 +10892,7 @@ __DEV__ &&
1089210892
break;
1089310893
case 30:
1089410894
if (enableViewTransition) {
10895-
if (
10896-
isViewTransitionEligible &&
10897-
null !== current &&
10898-
0 !== (finishedWork.subtreeFlags & 8246)
10899-
)
10895+
if (isViewTransitionEligible && null !== current)
1090010896
a: {
1090110897
isViewTransitionEligible = current;
1090210898
current = finishedWork;
@@ -18507,10 +18503,10 @@ __DEV__ &&
1850718503
(function () {
1850818504
var internals = {
1850918505
bundleType: 1,
18510-
version: "19.1.0-www-classic-6b5d9fd3-20250314",
18506+
version: "19.1.0-www-classic-17d274dc-20250314",
1851118507
rendererPackageName: "react-art",
1851218508
currentDispatcherRef: ReactSharedInternals,
18513-
reconcilerVersion: "19.1.0-www-classic-6b5d9fd3-20250314"
18509+
reconcilerVersion: "19.1.0-www-classic-17d274dc-20250314"
1851418510
};
1851518511
internals.overrideHookState = overrideHookState;
1851618512
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18544,7 +18540,7 @@ __DEV__ &&
1854418540
exports.Shape = Shape;
1854518541
exports.Surface = Surface;
1854618542
exports.Text = Text;
18547-
exports.version = "19.1.0-www-classic-6b5d9fd3-20250314";
18543+
exports.version = "19.1.0-www-classic-17d274dc-20250314";
1854818544
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1854918545
"function" ===
1855018546
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+5-9
Original file line numberDiff line numberDiff line change
@@ -10599,7 +10599,7 @@ __DEV__ &&
1059910599
root =
1060010600
enableViewTransition && (committedLanes & 335544064) === committedLanes;
1060110601
nextEffect = firstChild;
10602-
for (firstChild = root ? 9238 : 9236; null !== nextEffect; ) {
10602+
for (firstChild = root ? 9270 : 9236; null !== nextEffect; ) {
1060310603
committedLanes = nextEffect;
1060410604
var deletions = committedLanes.deletions;
1060510605
if (null !== deletions)
@@ -10710,11 +10710,7 @@ __DEV__ &&
1071010710
break;
1071110711
case 30:
1071210712
if (enableViewTransition) {
10713-
if (
10714-
isViewTransitionEligible &&
10715-
null !== current &&
10716-
0 !== (finishedWork.subtreeFlags & 8246)
10717-
)
10713+
if (isViewTransitionEligible && null !== current)
1071810714
a: {
1071910715
isViewTransitionEligible = current;
1072010716
current = finishedWork;
@@ -18279,10 +18275,10 @@ __DEV__ &&
1827918275
(function () {
1828018276
var internals = {
1828118277
bundleType: 1,
18282-
version: "19.1.0-www-modern-6b5d9fd3-20250314",
18278+
version: "19.1.0-www-modern-17d274dc-20250314",
1828318279
rendererPackageName: "react-art",
1828418280
currentDispatcherRef: ReactSharedInternals,
18285-
reconcilerVersion: "19.1.0-www-modern-6b5d9fd3-20250314"
18281+
reconcilerVersion: "19.1.0-www-modern-17d274dc-20250314"
1828618282
};
1828718283
internals.overrideHookState = overrideHookState;
1828818284
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18316,7 +18312,7 @@ __DEV__ &&
1831618312
exports.Shape = Shape;
1831718313
exports.Surface = Surface;
1831818314
exports.Text = Text;
18319-
exports.version = "19.1.0-www-modern-6b5d9fd3-20250314";
18315+
exports.version = "19.1.0-www-modern-17d274dc-20250314";
1832018316
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1832118317
"function" ===
1832218318
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

+12-16
Original file line numberDiff line numberDiff line change
@@ -7510,7 +7510,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) {
75107510
root =
75117511
enableViewTransition && (committedLanes & 335544064) === committedLanes;
75127512
nextEffect = firstChild;
7513-
for (firstChild = root ? 9238 : 9236; null !== nextEffect; ) {
7513+
for (firstChild = root ? 9270 : 9236; null !== nextEffect; ) {
75147514
committedLanes = nextEffect;
75157515
var deletions = committedLanes.deletions;
75167516
if (null !== deletions)
@@ -7632,11 +7632,7 @@ function commitBeforeMutationEffects_complete(
76327632
break;
76337633
case 30:
76347634
if (enableViewTransition) {
7635-
if (
7636-
isViewTransitionEligible &&
7637-
null !== current &&
7638-
0 !== (fiber.subtreeFlags & 8246)
7639-
)
7635+
if (isViewTransitionEligible && null !== current)
76407636
a: {
76417637
isViewTransitionEligible = getViewTransitionName(
76427638
current.memoizedProps,
@@ -11304,24 +11300,24 @@ var slice = Array.prototype.slice,
1130411300
};
1130511301
return Text;
1130611302
})(React.Component);
11307-
var internals$jscomp$inline_1562 = {
11303+
var internals$jscomp$inline_1561 = {
1130811304
bundleType: 0,
11309-
version: "19.1.0-www-classic-6b5d9fd3-20250314",
11305+
version: "19.1.0-www-classic-17d274dc-20250314",
1131011306
rendererPackageName: "react-art",
1131111307
currentDispatcherRef: ReactSharedInternals,
11312-
reconcilerVersion: "19.1.0-www-classic-6b5d9fd3-20250314"
11308+
reconcilerVersion: "19.1.0-www-classic-17d274dc-20250314"
1131311309
};
1131411310
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
11315-
var hook$jscomp$inline_1563 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
11311+
var hook$jscomp$inline_1562 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1131611312
if (
11317-
!hook$jscomp$inline_1563.isDisabled &&
11318-
hook$jscomp$inline_1563.supportsFiber
11313+
!hook$jscomp$inline_1562.isDisabled &&
11314+
hook$jscomp$inline_1562.supportsFiber
1131911315
)
1132011316
try {
11321-
(rendererID = hook$jscomp$inline_1563.inject(
11322-
internals$jscomp$inline_1562
11317+
(rendererID = hook$jscomp$inline_1562.inject(
11318+
internals$jscomp$inline_1561
1132311319
)),
11324-
(injectedHook = hook$jscomp$inline_1563);
11320+
(injectedHook = hook$jscomp$inline_1562);
1132511321
} catch (err) {}
1132611322
}
1132711323
var Path = Mode$1.Path;
@@ -11335,4 +11331,4 @@ exports.RadialGradient = RadialGradient;
1133511331
exports.Shape = TYPES.SHAPE;
1133611332
exports.Surface = Surface;
1133711333
exports.Text = Text;
11338-
exports.version = "19.1.0-www-classic-6b5d9fd3-20250314";
11334+
exports.version = "19.1.0-www-classic-17d274dc-20250314";

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

+12-16
Original file line numberDiff line numberDiff line change
@@ -7264,7 +7264,7 @@ function commitBeforeMutationEffects(root, firstChild, committedLanes) {
72647264
root =
72657265
enableViewTransition && (committedLanes & 335544064) === committedLanes;
72667266
nextEffect = firstChild;
7267-
for (firstChild = root ? 9238 : 9236; null !== nextEffect; ) {
7267+
for (firstChild = root ? 9270 : 9236; null !== nextEffect; ) {
72687268
committedLanes = nextEffect;
72697269
var deletions = committedLanes.deletions;
72707270
if (null !== deletions)
@@ -7386,11 +7386,7 @@ function commitBeforeMutationEffects_complete(
73867386
break;
73877387
case 30:
73887388
if (enableViewTransition) {
7389-
if (
7390-
isViewTransitionEligible &&
7391-
null !== current &&
7392-
0 !== (fiber.subtreeFlags & 8246)
7393-
)
7389+
if (isViewTransitionEligible && null !== current)
73947390
a: {
73957391
isViewTransitionEligible = getViewTransitionName(
73967392
current.memoizedProps,
@@ -11019,24 +11015,24 @@ var slice = Array.prototype.slice,
1101911015
};
1102011016
return Text;
1102111017
})(React.Component);
11022-
var internals$jscomp$inline_1535 = {
11018+
var internals$jscomp$inline_1534 = {
1102311019
bundleType: 0,
11024-
version: "19.1.0-www-modern-6b5d9fd3-20250314",
11020+
version: "19.1.0-www-modern-17d274dc-20250314",
1102511021
rendererPackageName: "react-art",
1102611022
currentDispatcherRef: ReactSharedInternals,
11027-
reconcilerVersion: "19.1.0-www-modern-6b5d9fd3-20250314"
11023+
reconcilerVersion: "19.1.0-www-modern-17d274dc-20250314"
1102811024
};
1102911025
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
11030-
var hook$jscomp$inline_1536 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
11026+
var hook$jscomp$inline_1535 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
1103111027
if (
11032-
!hook$jscomp$inline_1536.isDisabled &&
11033-
hook$jscomp$inline_1536.supportsFiber
11028+
!hook$jscomp$inline_1535.isDisabled &&
11029+
hook$jscomp$inline_1535.supportsFiber
1103411030
)
1103511031
try {
11036-
(rendererID = hook$jscomp$inline_1536.inject(
11037-
internals$jscomp$inline_1535
11032+
(rendererID = hook$jscomp$inline_1535.inject(
11033+
internals$jscomp$inline_1534
1103811034
)),
11039-
(injectedHook = hook$jscomp$inline_1536);
11035+
(injectedHook = hook$jscomp$inline_1535);
1104011036
} catch (err) {}
1104111037
}
1104211038
var Path = Mode$1.Path;
@@ -11050,4 +11046,4 @@ exports.RadialGradient = RadialGradient;
1105011046
exports.Shape = TYPES.SHAPE;
1105111047
exports.Surface = Surface;
1105211048
exports.Text = Text;
11053-
exports.version = "19.1.0-www-modern-6b5d9fd3-20250314";
11049+
exports.version = "19.1.0-www-modern-17d274dc-20250314";

0 commit comments

Comments
 (0)