Skip to content

Commit d23c7aa

Browse files
committed
Reset currentEventTransitionLane after flushing sync work (#33159)
This keeps track of the transition lane allocated for this event. I want to be able to use the current one within sync work flushing to know which lane needs its loading indicator cleared. It's also a bit weird that transition work scheduled inside sync updates in the same event aren't entangled with other transitions in that event when `flushSync` is. Therefore this moves it to reset after flushing. It should have no impact. Just splitting it out into a separate PR for an abundance of caution. The only thing this might affect would be if the React internals throws and it doesn't reset after. But really it doesn't really have to reset and they're all entangled anyway. DiffTrain build for [676f087](676f087)
1 parent d76abdf commit d23c7aa

34 files changed

+216
-246
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0cac32d60dd4482b27fe8a54dffbabceb22c6272
1+
676f0879f315130309262ff3532707029f0288bb
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0cac32d60dd4482b27fe8a54dffbabceb22c6272
1+
676f0879f315130309262ff3532707029f0288bb

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-classic-0cac32d6-20250513";
1540+
exports.version = "19.2.0-www-classic-676f0879-20250513";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
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
@@ -1537,7 +1537,7 @@ __DEV__ &&
15371537
exports.useTransition = function () {
15381538
return resolveDispatcher().useTransition();
15391539
};
1540-
exports.version = "19.2.0-www-modern-0cac32d6-20250513";
1540+
exports.version = "19.2.0-www-modern-676f0879-20250513";
15411541
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15421542
"function" ===
15431543
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
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.2.0-www-classic-0cac32d6-20250513";
638+
exports.version = "19.2.0-www-classic-676f0879-20250513";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,4 +635,4 @@ exports.useSyncExternalStore = function (
635635
exports.useTransition = function () {
636636
return ReactSharedInternals.H.useTransition();
637637
};
638-
exports.version = "19.2.0-www-modern-0cac32d6-20250513";
638+
exports.version = "19.2.0-www-modern-676f0879-20250513";

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.2.0-www-classic-0cac32d6-20250513";
642+
exports.version = "19.2.0-www-classic-676f0879-20250513";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
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
@@ -639,7 +639,7 @@ exports.useSyncExternalStore = function (
639639
exports.useTransition = function () {
640640
return ReactSharedInternals.H.useTransition();
641641
};
642-
exports.version = "19.2.0-www-modern-0cac32d6-20250513";
642+
exports.version = "19.2.0-www-modern-676f0879-20250513";
643643
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
644644
"function" ===
645645
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2971,11 +2971,8 @@ __DEV__ &&
29712971
scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask);
29722972
}
29732973
function requestTransitionLane() {
2974-
if (0 === currentEventTransitionLane) {
2975-
var actionScopeLane = currentEntangledLane;
2976-
currentEventTransitionLane =
2977-
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
2978-
}
2974+
0 === currentEventTransitionLane &&
2975+
(currentEventTransitionLane = claimNextTransitionLane());
29792976
return currentEventTransitionLane;
29802977
}
29812978
function entangleAsyncAction(transition, thenable) {
@@ -13914,7 +13911,8 @@ __DEV__ &&
1391413911
return null !== transition
1391513912
? (transition._updatedFibers || (transition._updatedFibers = new Set()),
1391613913
transition._updatedFibers.add(fiber),
13917-
requestTransitionLane())
13914+
(fiber = currentEntangledLane),
13915+
0 !== fiber ? fiber : requestTransitionLane())
1391813916
: currentUpdatePriority || DefaultEventPriority;
1391913917
}
1392013918
function requestDeferredLane() {
@@ -19067,10 +19065,10 @@ __DEV__ &&
1906719065
(function () {
1906819066
var internals = {
1906919067
bundleType: 1,
19070-
version: "19.2.0-www-classic-0cac32d6-20250513",
19068+
version: "19.2.0-www-classic-676f0879-20250513",
1907119069
rendererPackageName: "react-art",
1907219070
currentDispatcherRef: ReactSharedInternals,
19073-
reconcilerVersion: "19.2.0-www-classic-0cac32d6-20250513"
19071+
reconcilerVersion: "19.2.0-www-classic-676f0879-20250513"
1907419072
};
1907519073
internals.overrideHookState = overrideHookState;
1907619074
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19104,7 +19102,7 @@ __DEV__ &&
1910419102
exports.Shape = Shape;
1910519103
exports.Surface = Surface;
1910619104
exports.Text = Text;
19107-
exports.version = "19.2.0-www-classic-0cac32d6-20250513";
19105+
exports.version = "19.2.0-www-classic-676f0879-20250513";
1910819106
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1910919107
"function" ===
1911019108
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

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

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2877,11 +2877,8 @@ __DEV__ &&
28772877
scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask);
28782878
}
28792879
function requestTransitionLane() {
2880-
if (0 === currentEventTransitionLane) {
2881-
var actionScopeLane = currentEntangledLane;
2882-
currentEventTransitionLane =
2883-
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
2884-
}
2880+
0 === currentEventTransitionLane &&
2881+
(currentEventTransitionLane = claimNextTransitionLane());
28852882
return currentEventTransitionLane;
28862883
}
28872884
function entangleAsyncAction(transition, thenable) {
@@ -13732,7 +13729,8 @@ __DEV__ &&
1373213729
return null !== transition
1373313730
? (transition._updatedFibers || (transition._updatedFibers = new Set()),
1373413731
transition._updatedFibers.add(fiber),
13735-
requestTransitionLane())
13732+
(fiber = currentEntangledLane),
13733+
0 !== fiber ? fiber : requestTransitionLane())
1373613734
: currentUpdatePriority || DefaultEventPriority;
1373713735
}
1373813736
function requestDeferredLane() {
@@ -18839,10 +18837,10 @@ __DEV__ &&
1883918837
(function () {
1884018838
var internals = {
1884118839
bundleType: 1,
18842-
version: "19.2.0-www-modern-0cac32d6-20250513",
18840+
version: "19.2.0-www-modern-676f0879-20250513",
1884318841
rendererPackageName: "react-art",
1884418842
currentDispatcherRef: ReactSharedInternals,
18845-
reconcilerVersion: "19.2.0-www-modern-0cac32d6-20250513"
18843+
reconcilerVersion: "19.2.0-www-modern-676f0879-20250513"
1884618844
};
1884718845
internals.overrideHookState = overrideHookState;
1884818846
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -18876,7 +18874,7 @@ __DEV__ &&
1887618874
exports.Shape = Shape;
1887718875
exports.Surface = Surface;
1887818876
exports.Text = Text;
18879-
exports.version = "19.2.0-www-modern-0cac32d6-20250513";
18877+
exports.version = "19.2.0-www-modern-676f0879-20250513";
1888018878
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1888118879
"function" ===
1888218880
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)