@@ -69,7 +69,7 @@ function _assertThisInitialized(self) {
69
69
return self;
70
70
}
71
71
72
- var ReactVersion = "18.3.0-www-classic-d940bd0e ";
72
+ var ReactVersion = "18.3.0-www-classic-3684ffc4 ";
73
73
74
74
var LegacyRoot = 0;
75
75
var ConcurrentRoot = 1;
@@ -24184,109 +24184,89 @@ function queueRecoverableErrors(errors) {
24184
24184
}
24185
24185
24186
24186
function finishConcurrentRender(root, exitStatus, finishedWork, lanes) {
24187
+ // TODO: The fact that most of these branches are identical suggests that some
24188
+ // of the exit statuses are not best modeled as exit statuses and should be
24189
+ // tracked orthogonally.
24187
24190
switch (exitStatus) {
24188
24191
case RootInProgress:
24189
24192
case RootFatalErrored: {
24190
24193
throw new Error("Root did not complete. This is a bug in React.");
24191
24194
}
24192
24195
24193
- case RootErrored: {
24194
- // We should have already attempted to retry this tree. If we reached
24195
- // this point, it errored again. Commit it.
24196
- commitRootWhenReady(
24197
- root,
24198
- finishedWork,
24199
- workInProgressRootRecoverableErrors,
24200
- workInProgressTransitions,
24201
- lanes
24202
- );
24203
- break;
24204
- }
24205
-
24206
- case RootSuspended: {
24207
- markRootSuspended(root, lanes); // We have an acceptable loading state. We need to figure out if we
24208
- // should immediately commit it or wait a bit.
24209
-
24210
- if (
24211
- includesOnlyRetries(lanes) && // do not delay if we're inside an act() scope
24212
- !shouldForceFlushFallbacksInDEV()
24213
- ) {
24214
- // This render only included retries, no updates. Throttle committing
24215
- // retries so that we don't show too many loading states too quickly.
24216
- var msUntilTimeout =
24217
- globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1(); // Don't bother with a very short suspense time.
24218
-
24219
- if (msUntilTimeout > 10) {
24220
- var nextLanes = getNextLanes(root, NoLanes);
24221
-
24222
- if (nextLanes !== NoLanes) {
24223
- // There's additional work on this root.
24224
- break;
24225
- } // The render is suspended, it hasn't timed out, and there's no
24226
- // lower priority work to do. Instead of committing the fallback
24227
- // immediately, wait for more data to arrive.
24228
-
24229
- root.timeoutHandle = scheduleTimeout(
24230
- commitRootWhenReady.bind(
24231
- null,
24232
- root,
24233
- finishedWork,
24234
- workInProgressRootRecoverableErrors,
24235
- workInProgressTransitions,
24236
- lanes
24237
- ),
24238
- msUntilTimeout
24239
- );
24240
- break;
24241
- }
24242
- } // The work expired. Commit immediately.
24243
-
24244
- commitRootWhenReady(
24245
- root,
24246
- finishedWork,
24247
- workInProgressRootRecoverableErrors,
24248
- workInProgressTransitions,
24249
- lanes
24250
- );
24251
- break;
24252
- }
24253
-
24254
24196
case RootSuspendedWithDelay: {
24255
- markRootSuspended(root, lanes);
24256
-
24257
24197
if (includesOnlyTransitions(lanes)) {
24258
24198
// This is a transition, so we should exit without committing a
24259
24199
// placeholder and without scheduling a timeout. Delay indefinitely
24260
24200
// until we receive more data.
24261
- break;
24201
+ markRootSuspended(root, lanes);
24202
+ return;
24262
24203
} // Commit the placeholder.
24263
24204
24264
- commitRootWhenReady(
24265
- root,
24266
- finishedWork,
24267
- workInProgressRootRecoverableErrors,
24268
- workInProgressTransitions,
24269
- lanes
24270
- );
24271
24205
break;
24272
24206
}
24273
24207
24208
+ case RootErrored:
24209
+ case RootSuspended:
24274
24210
case RootCompleted: {
24275
- // The work completed.
24276
- commitRootWhenReady(
24277
- root,
24278
- finishedWork,
24279
- workInProgressRootRecoverableErrors,
24280
- workInProgressTransitions,
24281
- lanes
24282
- );
24283
24211
break;
24284
24212
}
24285
24213
24286
24214
default: {
24287
24215
throw new Error("Unknown root exit status.");
24288
24216
}
24289
24217
}
24218
+
24219
+ if (shouldForceFlushFallbacksInDEV()) {
24220
+ // We're inside an `act` scope. Commit immediately.
24221
+ commitRoot(
24222
+ root,
24223
+ workInProgressRootRecoverableErrors,
24224
+ workInProgressTransitions
24225
+ );
24226
+ } else {
24227
+ if (includesOnlyRetries(lanes)) {
24228
+ // This render only included retries, no updates. Throttle committing
24229
+ // retries so that we don't show too many loading states too quickly.
24230
+ var msUntilTimeout =
24231
+ globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now$1(); // Don't bother with a very short suspense time.
24232
+
24233
+ if (msUntilTimeout > 10) {
24234
+ markRootSuspended(root, lanes);
24235
+ var nextLanes = getNextLanes(root, NoLanes);
24236
+
24237
+ if (nextLanes !== NoLanes) {
24238
+ // There's additional work we can do on this root. We might as well
24239
+ // attempt to work on that while we're suspended.
24240
+ return;
24241
+ } // The render is suspended, it hasn't timed out, and there's no
24242
+ // lower priority work to do. Instead of committing the fallback
24243
+ // immediately, wait for more data to arrive.
24244
+ // TODO: Combine retry throttling with Suspensey commits. Right now they
24245
+ // run one after the other.
24246
+
24247
+ root.timeoutHandle = scheduleTimeout(
24248
+ commitRootWhenReady.bind(
24249
+ null,
24250
+ root,
24251
+ finishedWork,
24252
+ workInProgressRootRecoverableErrors,
24253
+ workInProgressTransitions,
24254
+ lanes
24255
+ ),
24256
+ msUntilTimeout
24257
+ );
24258
+ return;
24259
+ }
24260
+ }
24261
+
24262
+ commitRootWhenReady(
24263
+ root,
24264
+ finishedWork,
24265
+ workInProgressRootRecoverableErrors,
24266
+ workInProgressTransitions,
24267
+ lanes
24268
+ );
24269
+ }
24290
24270
}
24291
24271
24292
24272
function commitRootWhenReady(
@@ -24296,6 +24276,8 @@ function commitRootWhenReady(
24296
24276
transitions,
24297
24277
lanes
24298
24278
) {
24279
+ // TODO: Combine retry throttling with Suspensey commits. Right now they run
24280
+ // one after the other.
24299
24281
if (includesOnlyNonUrgentLanes(lanes)) {
24300
24282
// the suspensey resources. The renderer is responsible for accumulating
24301
24283
// all the load events. This all happens in a single synchronous
@@ -24315,22 +24297,14 @@ function commitRootWhenReady(
24315
24297
// us that it's ready. This will be canceled if we start work on the
24316
24298
// root again.
24317
24299
root.cancelPendingCommit = schedulePendingCommit(
24318
- commitRoot.bind(
24319
- null,
24320
- root,
24321
- workInProgressRootRecoverableErrors,
24322
- workInProgressTransitions
24323
- )
24300
+ commitRoot.bind(null, root, recoverableErrors, transitions)
24324
24301
);
24302
+ markRootSuspended(root, lanes);
24325
24303
return;
24326
24304
}
24327
24305
} // Otherwise, commit immediately.
24328
24306
24329
- commitRoot(
24330
- root,
24331
- workInProgressRootRecoverableErrors,
24332
- workInProgressTransitions
24333
- );
24307
+ commitRoot(root, recoverableErrors, transitions);
24334
24308
}
24335
24309
24336
24310
function isRenderConsistentWithExternalStores(finishedWork) {
0 commit comments