[flags] remove enableDeferRootSchedulingToMicrotask (#32008)

Wait for me to merge, but this has landed everywhere and is ready to
remove.
This commit is contained in:
Ricky
2025-01-08 12:03:01 -05:00
committed by GitHub
parent 426872679d
commit 379089d288
10 changed files with 32 additions and 100 deletions

View File

@@ -14,7 +14,6 @@ import type {BatchConfigTransition} from './ReactFiberTracingMarkerComponent';
import {
disableLegacyMode,
enableDeferRootSchedulingToMicrotask,
disableSchedulerTimeoutInWorkLoop,
enableProfilerTimer,
enableProfilerNestedUpdatePhase,
@@ -139,14 +138,6 @@ export function ensureRootIsScheduled(root: FiberRoot): void {
}
}
if (!enableDeferRootSchedulingToMicrotask) {
// While this flag is disabled, we schedule the render task immediately
// instead of waiting a microtask.
// TODO: We need to land enableDeferRootSchedulingToMicrotask ASAP to
// unblock additional features we have planned.
scheduleTaskForRootDuringMicrotask(root, now());
}
if (
__DEV__ &&
!disableLegacyMode &&
@@ -325,10 +316,7 @@ function scheduleTaskForRootDuringMicrotask(
// This function is always called inside a microtask, or at the very end of a
// rendering task right before we yield to the main thread. It should never be
// called synchronously.
//
// TODO: Unless enableDeferRootSchedulingToMicrotask is off. We need to land
// that ASAP to unblock additional features we have planned.
//
// This function also never performs React work synchronously; it should
// only schedule work to be performed later, in a separate task or microtask.

View File

@@ -161,83 +161,38 @@ describe(`onRender`, () => {
// Restore original mock
jest.mock('scheduler', () => jest.requireActual('scheduler/unstable_mock'));
// TODO: unstable_now is called by more places than just the profiler.
// Rewrite this test so it's less fragile.
if (gate(flags => flags.enableDeferRootSchedulingToMicrotask)) {
if (gate(flags => flags.enableComponentPerformanceTrack)) {
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
} else {
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
}
if (gate(flags => flags.enableComponentPerformanceTrack)) {
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
} else {
if (gate(flags => flags.enableComponentPerformanceTrack)) {
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
} else {
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
}
assertLog([
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
'read current time',
]);
}
});

View File

@@ -37,10 +37,6 @@ export const favorSafetyOverHydrationPerf = true;
// Need to remove didTimeout argument from Scheduler before landing
export const disableSchedulerTimeoutInWorkLoop = false;
// This will break some internal tests at Meta so we need to gate this until
// those can be fixed.
export const enableDeferRootSchedulingToMicrotask = true;
// TODO: Land at Meta before removing.
export const disableDefaultPropsExceptForClasses = true;

View File

@@ -45,7 +45,6 @@ export const enableAsyncDebugInfo = false;
export const enableAsyncIterableChildren = false;
export const enableCPUSuspense = true;
export const enableCreateEventHandleAPI = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableMoveBefore = true;
export const enableFizzExternalRuntime = true;

View File

@@ -29,7 +29,6 @@ export const enableAsyncDebugInfo = false;
export const enableAsyncIterableChildren = false;
export const enableCPUSuspense = false;
export const enableCreateEventHandleAPI = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFabricCompleteRootInCommitPhase = false;
export const enableMoveBefore = true;

View File

@@ -53,7 +53,6 @@ export const enableTransitionTracing = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFizzExternalRuntime = true;
export const enableDeferRootSchedulingToMicrotask = true;
export const alwaysThrottleRetries = true;

View File

@@ -24,7 +24,6 @@ export const enableAsyncDebugInfo = false;
export const enableAsyncIterableChildren = false;
export const enableCPUSuspense = true;
export const enableCreateEventHandleAPI = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableMoveBefore = false;
export const enableFizzExternalRuntime = true;

View File

@@ -55,7 +55,6 @@ export const enableTransitionTracing = false;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFizzExternalRuntime = false;
export const enableDeferRootSchedulingToMicrotask = true;
export const alwaysThrottleRetries = true;

View File

@@ -17,7 +17,6 @@ export const alwaysThrottleRetries = true;
export const disableDefaultPropsExceptForClasses = __VARIANT__;
export const disableLegacyContextForFunctionComponents = __VARIANT__;
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
export const enableNoCloningMemoCache = __VARIANT__;

View File

@@ -19,7 +19,6 @@ export const {
disableDefaultPropsExceptForClasses,
disableLegacyContextForFunctionComponents,
disableSchedulerTimeoutInWorkLoop,
enableDeferRootSchedulingToMicrotask,
enableDO_NOT_USE_disableStrictPassiveEffect,
enableHiddenSubtreeInsertionEffectCleanup,
enableInfiniteRenderLoopDetection,