Skip to content

Commit 8728b3b

Browse files
committed
[Fiber] Trigger default indicator for isomorphic async actions with no root associated (facebook#33190)
Stacked on facebook#33160, facebook#33162, facebook#33186 and facebook#33188. We have a special case that's awkward for default indicators. When you start a new async Transition from `React.startTransition` then there's not yet any associated root with the Transition because you haven't necessarily `setState` on anything yet until the promise resolves. That's what `entangleAsyncAction` handles by creating a lane that everything entangles with until all async actions are done. If there are no sync updates before the end of the event, we should trigger a default indicator until either the async action completes without update or if it gets entangled with some roots we should keep it going until those roots are done. DiffTrain build for [3a5b326](facebook@3a5b326)
1 parent db01104 commit 8728b3b

34 files changed

+2006
-1484
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3820740a7fbfc3b27a5127b43bdad44382ff3ce0
1+
3a5b326d8180f005a10e34a07ded6d5632efe337
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3820740a7fbfc3b27a5127b43bdad44382ff3ce0
1+
3a5b326d8180f005a10e34a07ded6d5632efe337

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-3820740a-20250509";
1540+
exports.version = "19.2.0-www-classic-3a5b326d-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-3820740a-20250509";
1540+
exports.version = "19.2.0-www-modern-3a5b326d-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-3820740a-20250509";
638+
exports.version = "19.2.0-www-classic-3a5b326d-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-3820740a-20250509";
638+
exports.version = "19.2.0-www-modern-3a5b326d-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-3820740a-20250509";
642+
exports.version = "19.2.0-www-classic-3a5b326d-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-3820740a-20250509";
642+
exports.version = "19.2.0-www-modern-3a5b326d-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: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2753,6 +2753,7 @@ __DEV__ &&
27532753
for (var child = fiber.child; child; )
27542754
(fiber.actualDuration += child.actualDuration), (child = child.sibling);
27552755
}
2756+
function noop() {}
27562757
function ensureRootIsScheduled(root) {
27572758
root !== lastScheduledRoot &&
27582759
null === root.next &&
@@ -2818,7 +2819,6 @@ __DEV__ &&
28182819
didScheduleMicrotask_act =
28192820
didScheduleMicrotask =
28202821
!1;
2821-
0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
28222822
for (
28232823
var currentTime = now$1(), prev = null, root = firstScheduledRoot;
28242824
null !== root;
@@ -2837,6 +2837,7 @@ __DEV__ &&
28372837
(pendingEffectsStatus !== NO_PENDING_EFFECTS &&
28382838
pendingEffectsStatus !== PENDING_PASSIVE_PHASE) ||
28392839
flushSyncWorkAcrossRoots_impl(0, !1);
2840+
0 !== currentEventTransitionLane && (currentEventTransitionLane = 0);
28402841
}
28412842
function scheduleTaskForRootDuringMicrotask(root, currentTime) {
28422843
var pendingLanes = root.pendingLanes,
@@ -2971,8 +2972,11 @@ __DEV__ &&
29712972
scheduleCallback$3(ImmediatePriority, processRootScheduleInImmediateTask);
29722973
}
29732974
function requestTransitionLane() {
2974-
0 === currentEventTransitionLane &&
2975-
(currentEventTransitionLane = claimNextTransitionLane());
2975+
if (0 === currentEventTransitionLane) {
2976+
var actionScopeLane = currentEntangledLane;
2977+
currentEventTransitionLane =
2978+
0 !== actionScopeLane ? actionScopeLane : claimNextTransitionLane();
2979+
}
29762980
return currentEventTransitionLane;
29772981
}
29782982
function entangleAsyncAction(transition, thenable) {
@@ -3096,7 +3100,6 @@ __DEV__ &&
30963100
}
30973101
return !0;
30983102
}
3099-
function noop() {}
31003103
function createThenableState() {
31013104
return { didWarnAboutUncachedPromise: !1, thenables: [] };
31023105
}
@@ -12121,9 +12124,11 @@ __DEV__ &&
1212112124
break;
1212212125
case 3:
1212312126
flags = pushNestedEffectDurations();
12127+
enableViewTransition && (viewTransitionMutationContext = !1);
1212412128
recursivelyTraverseMutationEffects(root, finishedWork, lanes);
1212512129
commitReconciliationEffects(finishedWork);
1212612130
root.effectDuration += popNestedEffectDurations(flags);
12131+
enableViewTransition && (viewTransitionMutationContext = !1);
1212712132
break;
1212812133
case 4:
1212912134
flags = pushMutationContext();
@@ -13911,8 +13916,7 @@ __DEV__ &&
1391113916
return null !== transition
1391213917
? (transition._updatedFibers || (transition._updatedFibers = new Set()),
1391313918
transition._updatedFibers.add(fiber),
13914-
(fiber = currentEntangledLane),
13915-
0 !== fiber ? fiber : requestTransitionLane())
13919+
requestTransitionLane())
1391613920
: currentUpdatePriority || DefaultEventPriority;
1391713921
}
1391813922
function requestDeferredLane() {
@@ -15535,9 +15539,9 @@ __DEV__ &&
1553515539
if (0 !== (finishedWork.subtreeFlags & 8772) || rootHasLayoutEffect) {
1553615540
rootHasLayoutEffect = ReactSharedInternals.T;
1553715541
ReactSharedInternals.T = null;
15538-
var previousPriority = currentUpdatePriority;
15542+
var _previousPriority = currentUpdatePriority;
1553915543
currentUpdatePriority = DiscreteEventPriority;
15540-
var prevExecutionContext = executionContext;
15544+
var _prevExecutionContext = executionContext;
1554115545
executionContext |= CommitContext;
1554215546
try {
1554315547
enableSchedulingProfiler &&
@@ -15562,8 +15566,8 @@ __DEV__ &&
1556215566
typeof injectedProfilingHooks.markLayoutEffectsStopped &&
1556315567
injectedProfilingHooks.markLayoutEffectsStopped();
1556415568
} finally {
15565-
(executionContext = prevExecutionContext),
15566-
(currentUpdatePriority = previousPriority),
15569+
(executionContext = _prevExecutionContext),
15570+
(currentUpdatePriority = _previousPriority),
1556715571
(ReactSharedInternals.T = rootHasLayoutEffect);
1556815572
}
1556915573
}
@@ -17014,6 +17018,35 @@ __DEV__ &&
1701417018
};
1701517019
}
1701617020
var objectIs = "function" === typeof Object.is ? Object.is : is,
17021+
reportGlobalError =
17022+
"function" === typeof reportError
17023+
? reportError
17024+
: function (error) {
17025+
if (
17026+
"object" === typeof window &&
17027+
"function" === typeof window.ErrorEvent
17028+
) {
17029+
var event = new window.ErrorEvent("error", {
17030+
bubbles: !0,
17031+
cancelable: !0,
17032+
message:
17033+
"object" === typeof error &&
17034+
null !== error &&
17035+
"string" === typeof error.message
17036+
? String(error.message)
17037+
: String(error),
17038+
error: error
17039+
});
17040+
if (!window.dispatchEvent(event)) return;
17041+
} else if (
17042+
"object" === typeof process &&
17043+
"function" === typeof process.emit
17044+
) {
17045+
process.emit("uncaughtException", error);
17046+
return;
17047+
}
17048+
console.error(error);
17049+
},
1701717050
supportsUserTiming =
1701817051
"undefined" !== typeof console &&
1701917052
"function" === typeof console.timeStamp,
@@ -18665,35 +18698,6 @@ __DEV__ &&
1866518698
injectedProfilingHooks.markForceUpdateScheduled(inst, lane);
1866618699
}
1866718700
},
18668-
reportGlobalError =
18669-
"function" === typeof reportError
18670-
? reportError
18671-
: function (error) {
18672-
if (
18673-
"object" === typeof window &&
18674-
"function" === typeof window.ErrorEvent
18675-
) {
18676-
var event = new window.ErrorEvent("error", {
18677-
bubbles: !0,
18678-
cancelable: !0,
18679-
message:
18680-
"object" === typeof error &&
18681-
null !== error &&
18682-
"string" === typeof error.message
18683-
? String(error.message)
18684-
: String(error),
18685-
error: error
18686-
});
18687-
if (!window.dispatchEvent(event)) return;
18688-
} else if (
18689-
"object" === typeof process &&
18690-
"function" === typeof process.emit
18691-
) {
18692-
process.emit("uncaughtException", error);
18693-
return;
18694-
}
18695-
console.error(error);
18696-
},
1869718701
componentName = null,
1869818702
errorBoundaryName = null,
1869918703
TransitionRoot = 0,
@@ -19065,10 +19069,10 @@ __DEV__ &&
1906519069
(function () {
1906619070
var internals = {
1906719071
bundleType: 1,
19068-
version: "19.2.0-www-classic-3820740a-20250509",
19072+
version: "19.2.0-www-classic-3a5b326d-20250513",
1906919073
rendererPackageName: "react-art",
1907019074
currentDispatcherRef: ReactSharedInternals,
19071-
reconcilerVersion: "19.2.0-www-classic-3820740a-20250509"
19075+
reconcilerVersion: "19.2.0-www-classic-3a5b326d-20250513"
1907219076
};
1907319077
internals.overrideHookState = overrideHookState;
1907419078
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -19102,7 +19106,7 @@ __DEV__ &&
1910219106
exports.Shape = Shape;
1910319107
exports.Surface = Surface;
1910419108
exports.Text = Text;
19105-
exports.version = "19.2.0-www-classic-3820740a-20250509";
19109+
exports.version = "19.2.0-www-classic-3a5b326d-20250513";
1910619110
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1910719111
"function" ===
1910819112
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)