Skip to content

Commit 4a0575d

Browse files
committed
[Fiber] Stash the entangled async action lane on currentEventTransitionLane (#33188)
When we're entangled with an async action lane we use that lane instead of the currentEventTransitionLane. Conversely, if we start a new async action lane we reuse the currentEventTransitionLane. So they're basically supposed to be in sync but they're not if you resolve the async action and then schedule new stuff in the same event. Then you end up with two transitions in the same event with different lanes. By stashing it like this we fix that but it also gives us an opportunity to check just the currentEventTransitionLane to see if this event scheduled any regular Transition updates or Async Transitions. DiffTrain build for [0cac32d](0cac32d)
1 parent 282bf23 commit 4a0575d

24 files changed

+204
-186
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.2.0-native-fb-997c7bc9-20250513
1+
19.2.0-native-fb-0cac32d6-20250513

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<<0eb1c939f2a48a302b150ffd5ba2a699>>
10+
* @generated SignedSource<<0f52cfad487070feec8dc822fddc969c>>
1111
*/
1212

1313
"use strict";
@@ -404,5 +404,5 @@ __DEV__ &&
404404
exports.useFormStatus = function () {
405405
return resolveDispatcher().useHostTransitionStatus();
406406
};
407-
exports.version = "19.2.0-native-fb-997c7bc9-20250513";
407+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";
408408
})();

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<<70fc5e6f78933604f9d0f366a0529fac>>
10+
* @generated SignedSource<<dd3f276e77b7c33875d1134c3da76c74>>
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.2.0-native-fb-997c7bc9-20250513";
206+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";

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<<70fc5e6f78933604f9d0f366a0529fac>>
10+
* @generated SignedSource<<dd3f276e77b7c33875d1134c3da76c74>>
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.2.0-native-fb-997c7bc9-20250513";
206+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<540483d236be7d3946d88c26277f3c7f>>
10+
* @generated SignedSource<<9a261a3370c9821d3f95679cea3c74c6>>
1111
*/
1212

1313
/*
@@ -15616,8 +15616,7 @@ __DEV__ &&
1561615616
return null !== transition
1561715617
? (transition._updatedFibers || (transition._updatedFibers = new Set()),
1561815618
transition._updatedFibers.add(fiber),
15619-
(fiber = currentEntangledLane),
15620-
0 !== fiber ? fiber : requestTransitionLane())
15619+
requestTransitionLane())
1562115620
: resolveUpdatePriority();
1562215621
}
1562315622
function requestDeferredLane() {
@@ -17508,9 +17507,8 @@ __DEV__ &&
1750817507
!1;
1750917508
var syncTransitionLanes = 0;
1751017509
0 !== currentEventTransitionLane &&
17511-
(shouldAttemptEagerTransition() &&
17512-
(syncTransitionLanes = currentEventTransitionLane),
17513-
(currentEventTransitionLane = 0));
17510+
shouldAttemptEagerTransition() &&
17511+
(syncTransitionLanes = currentEventTransitionLane);
1751417512
for (
1751517513
var currentTime = now$1(), prev = null, root = firstScheduledRoot;
1751617514
null !== root;
@@ -17531,6 +17529,7 @@ __DEV__ &&
1753117529
(pendingEffectsStatus !== NO_PENDING_EFFECTS &&
1753217530
pendingEffectsStatus !== PENDING_PASSIVE_PHASE) ||
1753317531
flushSyncWorkAcrossRoots_impl(syncTransitionLanes, !1);
17532+
currentEventTransitionLane = 0;
1753417533
}
1753517534
function scheduleTaskForRootDuringMicrotask(root, currentTime) {
1753617535
for (
@@ -17668,8 +17667,11 @@ __DEV__ &&
1766817667
});
1766917668
}
1767017669
function requestTransitionLane() {
17671-
0 === currentEventTransitionLane &&
17672-
(currentEventTransitionLane = claimNextTransitionLane());
17670+
if (0 === currentEventTransitionLane) {
17671+
var actionScopeLane = currentEntangledLane;
17672+
currentEventTransitionLane =
17673+
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
17674+
}
1767317675
return currentEventTransitionLane;
1767417676
}
1767517677
function coerceFormActionProp(actionProp) {
@@ -26958,11 +26960,11 @@ __DEV__ &&
2695826960
};
2695926961
(function () {
2696026962
var isomorphicReactPackageVersion = React.version;
26961-
if ("19.2.0-native-fb-997c7bc9-20250513" !== isomorphicReactPackageVersion)
26963+
if ("19.2.0-native-fb-0cac32d6-20250513" !== isomorphicReactPackageVersion)
2696226964
throw Error(
2696326965
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
2696426966
(isomorphicReactPackageVersion +
26965-
"\n - react-dom: 19.2.0-native-fb-997c7bc9-20250513\nLearn more: https://react.dev/warnings/version-mismatch")
26967+
"\n - react-dom: 19.2.0-native-fb-0cac32d6-20250513\nLearn more: https://react.dev/warnings/version-mismatch")
2696626968
);
2696726969
})();
2696826970
("function" === typeof Map &&
@@ -26999,10 +27001,10 @@ __DEV__ &&
2699927001
!(function () {
2700027002
var internals = {
2700127003
bundleType: 1,
27002-
version: "19.2.0-native-fb-997c7bc9-20250513",
27004+
version: "19.2.0-native-fb-0cac32d6-20250513",
2700327005
rendererPackageName: "react-dom",
2700427006
currentDispatcherRef: ReactSharedInternals,
27005-
reconcilerVersion: "19.2.0-native-fb-997c7bc9-20250513"
27007+
reconcilerVersion: "19.2.0-native-fb-0cac32d6-20250513"
2700627008
};
2700727009
internals.overrideHookState = overrideHookState;
2700827010
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -27140,5 +27142,5 @@ __DEV__ &&
2714027142
listenToAllSupportedEvents(container);
2714127143
return new ReactDOMHydrationRoot(initialChildren);
2714227144
};
27143-
exports.version = "19.2.0-native-fb-997c7bc9-20250513";
27145+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";
2714427146
})();

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<d2ac2c6fc1d7b173066eae37c84b37cb>>
10+
* @generated SignedSource<<eb8466fdbf7af6b8a349efb548a03fa0>>
1111
*/
1212

1313
/*
@@ -11350,8 +11350,7 @@ function requestUpdateLane(fiber) {
1135011350
: 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes
1135111351
? workInProgressRootRenderLanes & -workInProgressRootRenderLanes
1135211352
: null !== ReactSharedInternals.T
11353-
? ((fiber = currentEntangledLane),
11354-
0 !== fiber ? fiber : requestTransitionLane())
11353+
? requestTransitionLane()
1135511354
: resolveUpdatePriority();
1135611355
}
1135711356
function requestDeferredLane() {
@@ -12700,9 +12699,8 @@ function processRootScheduleInMicrotask() {
1270012699
mightHavePendingSyncWork = didScheduleMicrotask = !1;
1270112700
var syncTransitionLanes = 0;
1270212701
0 !== currentEventTransitionLane &&
12703-
(shouldAttemptEagerTransition() &&
12704-
(syncTransitionLanes = currentEventTransitionLane),
12705-
(currentEventTransitionLane = 0));
12702+
shouldAttemptEagerTransition() &&
12703+
(syncTransitionLanes = currentEventTransitionLane);
1270612704
for (
1270712705
var currentTime = now(), prev = null, root = firstScheduledRoot;
1270812706
null !== root;
@@ -12722,6 +12720,7 @@ function processRootScheduleInMicrotask() {
1272212720
}
1272312721
(0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) ||
1272412722
flushSyncWorkAcrossRoots_impl(syncTransitionLanes, !1);
12723+
currentEventTransitionLane = 0;
1272512724
}
1272612725
function scheduleTaskForRootDuringMicrotask(root, currentTime) {
1272712726
for (
@@ -12829,8 +12828,11 @@ function scheduleImmediateRootScheduleTask() {
1282912828
});
1283012829
}
1283112830
function requestTransitionLane() {
12832-
0 === currentEventTransitionLane &&
12833-
(currentEventTransitionLane = claimNextTransitionLane());
12831+
if (0 === currentEventTransitionLane) {
12832+
var actionScopeLane = currentEntangledLane;
12833+
currentEventTransitionLane =
12834+
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
12835+
}
1283412836
return currentEventTransitionLane;
1283512837
}
1283612838
function coerceFormActionProp(actionProp) {
@@ -17049,14 +17051,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1704917051
};
1705017052
var isomorphicReactPackageVersion$jscomp$inline_2015 = React.version;
1705117053
if (
17052-
"19.2.0-native-fb-997c7bc9-20250513" !==
17054+
"19.2.0-native-fb-0cac32d6-20250513" !==
1705317055
isomorphicReactPackageVersion$jscomp$inline_2015
1705417056
)
1705517057
throw Error(
1705617058
formatProdErrorMessage(
1705717059
527,
1705817060
isomorphicReactPackageVersion$jscomp$inline_2015,
17059-
"19.2.0-native-fb-997c7bc9-20250513"
17061+
"19.2.0-native-fb-0cac32d6-20250513"
1706017062
)
1706117063
);
1706217064
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17078,10 +17080,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1707817080
};
1707917081
var internals$jscomp$inline_2534 = {
1708017082
bundleType: 0,
17081-
version: "19.2.0-native-fb-997c7bc9-20250513",
17083+
version: "19.2.0-native-fb-0cac32d6-20250513",
1708217084
rendererPackageName: "react-dom",
1708317085
currentDispatcherRef: ReactSharedInternals,
17084-
reconcilerVersion: "19.2.0-native-fb-997c7bc9-20250513"
17086+
reconcilerVersion: "19.2.0-native-fb-0cac32d6-20250513"
1708517087
};
1708617088
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
1708717089
var hook$jscomp$inline_2535 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -17179,4 +17181,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1717917181
listenToAllSupportedEvents(container);
1718017182
return new ReactDOMHydrationRoot(initialChildren);
1718117183
};
17182-
exports.version = "19.2.0-native-fb-997c7bc9-20250513";
17184+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";

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

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @noflow
88
* @nolint
99
* @preventMunge
10-
* @generated SignedSource<<3fb4670193e95757eac18d243b3931bc>>
10+
* @generated SignedSource<<bad1d41cd1db7e78d4a00b325614c341>>
1111
*/
1212

1313
/*
@@ -11911,8 +11911,7 @@ function requestUpdateLane(fiber) {
1191111911
: 0 !== (executionContext & 2) && 0 !== workInProgressRootRenderLanes
1191211912
? workInProgressRootRenderLanes & -workInProgressRootRenderLanes
1191311913
: null !== ReactSharedInternals.T
11914-
? ((fiber = currentEntangledLane),
11915-
0 !== fiber ? fiber : requestTransitionLane())
11914+
? requestTransitionLane()
1191611915
: resolveUpdatePriority();
1191711916
}
1191811917
function requestDeferredLane() {
@@ -13399,9 +13398,8 @@ function processRootScheduleInMicrotask() {
1339913398
mightHavePendingSyncWork = didScheduleMicrotask = !1;
1340013399
var syncTransitionLanes = 0;
1340113400
0 !== currentEventTransitionLane &&
13402-
(shouldAttemptEagerTransition() &&
13403-
(syncTransitionLanes = currentEventTransitionLane),
13404-
(currentEventTransitionLane = 0));
13401+
shouldAttemptEagerTransition() &&
13402+
(syncTransitionLanes = currentEventTransitionLane);
1340513403
for (
1340613404
var currentTime = now$1(), prev = null, root = firstScheduledRoot;
1340713405
null !== root;
@@ -13421,6 +13419,7 @@ function processRootScheduleInMicrotask() {
1342113419
}
1342213420
(0 !== pendingEffectsStatus && 5 !== pendingEffectsStatus) ||
1342313421
flushSyncWorkAcrossRoots_impl(syncTransitionLanes, !1);
13422+
currentEventTransitionLane = 0;
1342413423
}
1342513424
function scheduleTaskForRootDuringMicrotask(root, currentTime) {
1342613425
for (
@@ -13531,8 +13530,11 @@ function scheduleImmediateRootScheduleTask() {
1353113530
});
1353213531
}
1353313532
function requestTransitionLane() {
13534-
0 === currentEventTransitionLane &&
13535-
(currentEventTransitionLane = claimNextTransitionLane());
13533+
if (0 === currentEventTransitionLane) {
13534+
var actionScopeLane = currentEntangledLane;
13535+
currentEventTransitionLane =
13536+
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
13537+
}
1353613538
return currentEventTransitionLane;
1353713539
}
1353813540
function coerceFormActionProp(actionProp) {
@@ -17759,14 +17761,14 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) {
1775917761
};
1776017762
var isomorphicReactPackageVersion$jscomp$inline_2118 = React.version;
1776117763
if (
17762-
"19.2.0-native-fb-997c7bc9-20250513" !==
17764+
"19.2.0-native-fb-0cac32d6-20250513" !==
1776317765
isomorphicReactPackageVersion$jscomp$inline_2118
1776417766
)
1776517767
throw Error(
1776617768
formatProdErrorMessage(
1776717769
527,
1776817770
isomorphicReactPackageVersion$jscomp$inline_2118,
17769-
"19.2.0-native-fb-997c7bc9-20250513"
17771+
"19.2.0-native-fb-0cac32d6-20250513"
1777017772
)
1777117773
);
1777217774
ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
@@ -17788,10 +17790,10 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) {
1778817790
};
1778917791
var internals$jscomp$inline_2125 = {
1779017792
bundleType: 0,
17791-
version: "19.2.0-native-fb-997c7bc9-20250513",
17793+
version: "19.2.0-native-fb-0cac32d6-20250513",
1779217794
rendererPackageName: "react-dom",
1779317795
currentDispatcherRef: ReactSharedInternals,
17794-
reconcilerVersion: "19.2.0-native-fb-997c7bc9-20250513",
17796+
reconcilerVersion: "19.2.0-native-fb-0cac32d6-20250513",
1779517797
getLaneLabelMap: function () {
1779617798
for (
1779717799
var map = new Map(), lane = 1, index$313 = 0;
@@ -17904,4 +17906,4 @@ exports.hydrateRoot = function (container, initialChildren, options) {
1790417906
listenToAllSupportedEvents(container);
1790517907
return new ReactDOMHydrationRoot(initialChildren);
1790617908
};
17907-
exports.version = "19.2.0-native-fb-997c7bc9-20250513";
17909+
exports.version = "19.2.0-native-fb-0cac32d6-20250513";

0 commit comments

Comments
 (0)