Skip to content

Commit 379089d

Browse files
authored
[flags] remove enableDeferRootSchedulingToMicrotask (facebook#32008)
Wait for me to merge, but this has landed everywhere and is ready to remove.
1 parent 4268726 commit 379089d

10 files changed

+32
-100
lines changed

packages/react-reconciler/src/ReactFiberRootScheduler.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import type {BatchConfigTransition} from './ReactFiberTracingMarkerComponent';
1414

1515
import {
1616
disableLegacyMode,
17-
enableDeferRootSchedulingToMicrotask,
1817
disableSchedulerTimeoutInWorkLoop,
1918
enableProfilerTimer,
2019
enableProfilerNestedUpdatePhase,
@@ -139,14 +138,6 @@ export function ensureRootIsScheduled(root: FiberRoot): void {
139138
}
140139
}
141140

142-
if (!enableDeferRootSchedulingToMicrotask) {
143-
// While this flag is disabled, we schedule the render task immediately
144-
// instead of waiting a microtask.
145-
// TODO: We need to land enableDeferRootSchedulingToMicrotask ASAP to
146-
// unblock additional features we have planned.
147-
scheduleTaskForRootDuringMicrotask(root, now());
148-
}
149-
150141
if (
151142
__DEV__ &&
152143
!disableLegacyMode &&
@@ -325,10 +316,7 @@ function scheduleTaskForRootDuringMicrotask(
325316
// This function is always called inside a microtask, or at the very end of a
326317
// rendering task right before we yield to the main thread. It should never be
327318
// called synchronously.
328-
//
329-
// TODO: Unless enableDeferRootSchedulingToMicrotask is off. We need to land
330-
// that ASAP to unblock additional features we have planned.
331-
//
319+
332320
// This function also never performs React work synchronously; it should
333321
// only schedule work to be performed later, in a separate task or microtask.
334322

packages/react/src/__tests__/ReactProfiler-test.internal.js

Lines changed: 31 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -161,83 +161,38 @@ describe(`onRender`, () => {
161161
// Restore original mock
162162
jest.mock('scheduler', () => jest.requireActual('scheduler/unstable_mock'));
163163

164-
// TODO: unstable_now is called by more places than just the profiler.
165-
// Rewrite this test so it's less fragile.
166-
if (gate(flags => flags.enableDeferRootSchedulingToMicrotask)) {
167-
if (gate(flags => flags.enableComponentPerformanceTrack)) {
168-
assertLog([
169-
'read current time',
170-
'read current time',
171-
'read current time',
172-
'read current time',
173-
'read current time',
174-
'read current time',
175-
'read current time',
176-
'read current time',
177-
'read current time',
178-
'read current time',
179-
'read current time',
180-
'read current time',
181-
'read current time',
182-
'read current time',
183-
'read current time',
184-
]);
185-
} else {
186-
assertLog([
187-
'read current time',
188-
'read current time',
189-
'read current time',
190-
'read current time',
191-
'read current time',
192-
'read current time',
193-
'read current time',
194-
'read current time',
195-
'read current time',
196-
'read current time',
197-
'read current time',
198-
]);
199-
}
164+
if (gate(flags => flags.enableComponentPerformanceTrack)) {
165+
assertLog([
166+
'read current time',
167+
'read current time',
168+
'read current time',
169+
'read current time',
170+
'read current time',
171+
'read current time',
172+
'read current time',
173+
'read current time',
174+
'read current time',
175+
'read current time',
176+
'read current time',
177+
'read current time',
178+
'read current time',
179+
'read current time',
180+
'read current time',
181+
]);
200182
} else {
201-
if (gate(flags => flags.enableComponentPerformanceTrack)) {
202-
assertLog([
203-
'read current time',
204-
'read current time',
205-
'read current time',
206-
'read current time',
207-
'read current time',
208-
'read current time',
209-
'read current time',
210-
'read current time',
211-
'read current time',
212-
'read current time',
213-
'read current time',
214-
'read current time',
215-
'read current time',
216-
'read current time',
217-
'read current time',
218-
'read current time',
219-
'read current time',
220-
'read current time',
221-
'read current time',
222-
]);
223-
} else {
224-
assertLog([
225-
'read current time',
226-
'read current time',
227-
'read current time',
228-
'read current time',
229-
'read current time',
230-
'read current time',
231-
'read current time',
232-
'read current time',
233-
'read current time',
234-
'read current time',
235-
'read current time',
236-
'read current time',
237-
'read current time',
238-
'read current time',
239-
]);
240-
}
183+
assertLog([
184+
'read current time',
185+
'read current time',
186+
'read current time',
187+
'read current time',
188+
'read current time',
189+
'read current time',
190+
'read current time',
191+
'read current time',
192+
'read current time',
193+
'read current time',
194+
'read current time',
195+
]);
241196
}
242197
});
243198

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export const favorSafetyOverHydrationPerf = true;
3737
// Need to remove didTimeout argument from Scheduler before landing
3838
export const disableSchedulerTimeoutInWorkLoop = false;
3939

40-
// This will break some internal tests at Meta so we need to gate this until
41-
// those can be fixed.
42-
export const enableDeferRootSchedulingToMicrotask = true;
43-
4440
// TODO: Land at Meta before removing.
4541
export const disableDefaultPropsExceptForClasses = true;
4642

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export const enableAsyncDebugInfo = false;
4545
export const enableAsyncIterableChildren = false;
4646
export const enableCPUSuspense = true;
4747
export const enableCreateEventHandleAPI = false;
48-
export const enableDeferRootSchedulingToMicrotask = true;
4948
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
5049
export const enableMoveBefore = true;
5150
export const enableFizzExternalRuntime = true;

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export const enableAsyncDebugInfo = false;
2929
export const enableAsyncIterableChildren = false;
3030
export const enableCPUSuspense = false;
3131
export const enableCreateEventHandleAPI = false;
32-
export const enableDeferRootSchedulingToMicrotask = true;
3332
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
3433
export const enableFabricCompleteRootInCommitPhase = false;
3534
export const enableMoveBefore = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const enableTransitionTracing = false;
5353

5454
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
5555
export const enableFizzExternalRuntime = true;
56-
export const enableDeferRootSchedulingToMicrotask = true;
5756

5857
export const alwaysThrottleRetries = true;
5958

packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export const enableAsyncDebugInfo = false;
2424
export const enableAsyncIterableChildren = false;
2525
export const enableCPUSuspense = true;
2626
export const enableCreateEventHandleAPI = false;
27-
export const enableDeferRootSchedulingToMicrotask = true;
2827
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
2928
export const enableMoveBefore = false;
3029
export const enableFizzExternalRuntime = true;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export const enableTransitionTracing = false;
5555

5656
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
5757
export const enableFizzExternalRuntime = false;
58-
export const enableDeferRootSchedulingToMicrotask = true;
5958

6059
export const alwaysThrottleRetries = true;
6160

packages/shared/forks/ReactFeatureFlags.www-dynamic.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const alwaysThrottleRetries = true;
1717
export const disableDefaultPropsExceptForClasses = __VARIANT__;
1818
export const disableLegacyContextForFunctionComponents = __VARIANT__;
1919
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
20-
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
2120
export const enableDO_NOT_USE_disableStrictPassiveEffect = __VARIANT__;
2221
export const enableHiddenSubtreeInsertionEffectCleanup = __VARIANT__;
2322
export const enableNoCloningMemoCache = __VARIANT__;

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ export const {
1919
disableDefaultPropsExceptForClasses,
2020
disableLegacyContextForFunctionComponents,
2121
disableSchedulerTimeoutInWorkLoop,
22-
enableDeferRootSchedulingToMicrotask,
2322
enableDO_NOT_USE_disableStrictPassiveEffect,
2423
enableHiddenSubtreeInsertionEffectCleanup,
2524
enableInfiniteRenderLoopDetection,

0 commit comments

Comments
 (0)