mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 00:20:04 +01:00
Add feature flag to disable scheduler timeout in work loop (#19771)
This commit is contained in:
parent
eabd18c73f
commit
36df483af4
|
|
@ -30,6 +30,7 @@ import {
|
|||
enableSchedulingProfiler,
|
||||
enableScopeAPI,
|
||||
skipUnmountedBoundaries,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import invariant from 'shared/invariant';
|
||||
|
|
@ -750,7 +751,7 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
|
|||
|
||||
// This is the entry point for every concurrent task, i.e. anything that
|
||||
// goes through Scheduler.
|
||||
function performConcurrentWorkOnRoot(root) {
|
||||
function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
// Since we know we're in a React event, we can clear the current
|
||||
// event time. The next update will compute a new event time.
|
||||
currentEventTime = NoTimestamp;
|
||||
|
|
@ -790,6 +791,18 @@ function performConcurrentWorkOnRoot(root) {
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO: We only check `didTimeout` defensively, to account for a Scheduler
|
||||
// bug we're still investigating. Once the bug in Scheduler is fixed,
|
||||
// we can remove this, since we track expiration ourselves.
|
||||
if (!disableSchedulerTimeoutInWorkLoop && didTimeout) {
|
||||
// Something expired. Flush synchronously until there's no expired
|
||||
// work left.
|
||||
markRootExpired(root, lanes);
|
||||
// This will schedule a synchronous callback.
|
||||
ensureRootIsScheduled(root, now());
|
||||
return null;
|
||||
}
|
||||
|
||||
let exitStatus = renderRootConcurrent(root, lanes);
|
||||
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import {
|
|||
enableSchedulingProfiler,
|
||||
enableScopeAPI,
|
||||
skipUnmountedBoundaries,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import invariant from 'shared/invariant';
|
||||
|
|
@ -738,7 +739,7 @@ function ensureRootIsScheduled(root: FiberRoot, currentTime: number) {
|
|||
|
||||
// This is the entry point for every concurrent task, i.e. anything that
|
||||
// goes through Scheduler.
|
||||
function performConcurrentWorkOnRoot(root) {
|
||||
function performConcurrentWorkOnRoot(root, didTimeout) {
|
||||
// Since we know we're in a React event, we can clear the current
|
||||
// event time. The next update will compute a new event time.
|
||||
currentEventTime = NoTimestamp;
|
||||
|
|
@ -778,6 +779,18 @@ function performConcurrentWorkOnRoot(root) {
|
|||
return null;
|
||||
}
|
||||
|
||||
// TODO: We only check `didTimeout` defensively, to account for a Scheduler
|
||||
// bug we're still investigating. Once the bug in Scheduler is fixed,
|
||||
// we can remove this, since we track expiration ourselves.
|
||||
if (!disableSchedulerTimeoutInWorkLoop && didTimeout) {
|
||||
// Something expired. Flush synchronously until there's no expired
|
||||
// work left.
|
||||
markRootExpired(root, lanes);
|
||||
// This will schedule a synchronous callback.
|
||||
ensureRootIsScheduled(root, now());
|
||||
return null;
|
||||
}
|
||||
|
||||
let exitStatus = renderRootConcurrent(root, lanes);
|
||||
|
||||
if (
|
||||
|
|
|
|||
|
|
@ -137,3 +137,5 @@ export const enableDiscreteEventFlushingChange = false;
|
|||
export const enablePassiveEventIntervention = true;
|
||||
|
||||
export const enableEagerRootListeners = true;
|
||||
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = false;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ export const decoupleUpdatePriorityFromScheduler = false;
|
|||
export const enableDiscreteEventFlushingChange = true;
|
||||
export const enablePassiveEventIntervention = true;
|
||||
export const enableEagerRootListeners = true;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
|
|
|||
|
|
@ -48,3 +48,4 @@ export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
|||
// to __VARIANT__.
|
||||
export const enableTrustedTypesIntegration = false;
|
||||
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export const {
|
|||
skipUnmountedBoundaries,
|
||||
enablePassiveEventIntervention,
|
||||
enableEagerRootListeners,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} = dynamicFeatureFlags;
|
||||
|
||||
// On WWW, __EXPERIMENTAL__ is used for a new modern build.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user