mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Add back disableSchedulerTimeoutInWorkLoop flag (#20482)
* Add back enableSchedulerTimeoutInWorkLoop flag * Nvm, keep it as disableSchedulerTimeoutInWorkLoop
This commit is contained in:
@@ -31,6 +31,7 @@ import {
|
||||
enableDebugTracing,
|
||||
enableSchedulingProfiler,
|
||||
enableScopeAPI,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import invariant from 'shared/invariant';
|
||||
@@ -767,7 +768,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) {
|
||||
if (enableProfilerTimer && enableProfilerNestedUpdatePhase) {
|
||||
resetNestedUpdateFlag();
|
||||
}
|
||||
@@ -811,6 +812,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 (
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
enableSchedulingProfiler,
|
||||
enableScopeAPI,
|
||||
enableDoubleInvokingEffects,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} from 'shared/ReactFeatureFlags';
|
||||
import ReactSharedInternals from 'shared/ReactSharedInternals';
|
||||
import invariant from 'shared/invariant';
|
||||
@@ -775,7 +776,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) {
|
||||
if (enableProfilerTimer && enableProfilerNestedUpdatePhase) {
|
||||
resetNestedUpdateFlag();
|
||||
}
|
||||
@@ -819,6 +820,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 (
|
||||
|
||||
@@ -141,3 +141,5 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
@@ -56,6 +56,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = true;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -55,6 +55,7 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = false;
|
||||
|
||||
export const enableRecursiveCommitTraversal = false;
|
||||
export const disableSchedulerTimeoutInWorkLoop = false;
|
||||
|
||||
// Flow magic to verify the exports of this file match the original version.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
|
||||
@@ -53,3 +53,4 @@ export const enableDoubleInvokingEffects = false;
|
||||
export const enableUseRefAccessWarning = __VARIANT__;
|
||||
|
||||
export const enableProfilerNestedUpdateScheduledHook = __VARIANT__;
|
||||
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
|
||||
|
||||
@@ -29,6 +29,7 @@ export const {
|
||||
enableDoubleInvokingEffects,
|
||||
enableUseRefAccessWarning,
|
||||
disableNativeComponentFrames,
|
||||
disableSchedulerTimeoutInWorkLoop,
|
||||
} = dynamicFeatureFlags;
|
||||
|
||||
// On WWW, __EXPERIMENTAL__ is used for a new modern build.
|
||||
|
||||
Reference in New Issue
Block a user