Skip to content

Commit

Permalink
Land enableSyncMicrotasks
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Mar 11, 2021
1 parent b7e6310 commit edd0701
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import type {ReactPriorityLevel} from './ReactInternalTypes';
// CommonJS interop named imports.
import * as Scheduler from 'scheduler';
import {__interactionsRef} from 'scheduler/tracing';
import {
enableSchedulerTracing,
enableSyncMicroTasks,
} from 'shared/ReactFeatureFlags';
import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
import invariant from 'shared/invariant';
import {
SyncLanePriority,
Expand Down Expand Up @@ -139,7 +136,7 @@ export function scheduleSyncCallback(callback: SchedulerCallback) {

// TODO: Figure out how to remove this It's only here as a last resort if we
// forget to explicitly flush.
if (enableSyncMicroTasks && supportsMicrotasks) {
if (supportsMicrotasks) {
// Flush the queue in a microtask.
scheduleMicrotask(flushSyncCallbackQueueImpl);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import type {ReactPriorityLevel} from './ReactInternalTypes';
// CommonJS interop named imports.
import * as Scheduler from 'scheduler';
import {__interactionsRef} from 'scheduler/tracing';
import {
enableSchedulerTracing,
enableSyncMicroTasks,
} from 'shared/ReactFeatureFlags';
import {enableSchedulerTracing} from 'shared/ReactFeatureFlags';
import invariant from 'shared/invariant';
import {
SyncLanePriority,
Expand Down Expand Up @@ -139,7 +136,7 @@ export function scheduleSyncCallback(callback: SchedulerCallback) {

// TODO: Figure out how to remove this It's only here as a last resort if we
// forget to explicitly flush.
if (enableSyncMicroTasks && supportsMicrotasks) {
if (supportsMicrotasks) {
// Flush the queue in a microtask.
scheduleMicrotask(flushSyncCallbackQueueImpl);
} else {
Expand Down
2 changes: 0 additions & 2 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,4 @@ export const enableRecursiveCommitTraversal = false;

export const disableSchedulerTimeoutInWorkLoop = false;

export const enableSyncMicroTasks = false;

export const enableLazyContextPropagation = false;
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.native-oss.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.test-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.testing.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ export const enableUseRefAccessWarning = false;

export const enableRecursiveCommitTraversal = false;
export const disableSchedulerTimeoutInWorkLoop = false;
export const enableSyncMicroTasks = false;
export const enableLazyContextPropagation = false;

// Flow magic to verify the exports of this file match the original version.
Expand Down
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,4 @@ export const enableUseRefAccessWarning = __VARIANT__;

export const enableProfilerNestedUpdateScheduledHook = __VARIANT__;
export const disableSchedulerTimeoutInWorkLoop = __VARIANT__;
export const enableSyncMicroTasks = __VARIANT__;
export const enableLazyContextPropagation = __VARIANT__;
1 change: 0 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const {
enableUseRefAccessWarning,
disableNativeComponentFrames,
disableSchedulerTimeoutInWorkLoop,
enableSyncMicroTasks,
enableLazyContextPropagation,
} = dynamicFeatureFlags;

Expand Down

0 comments on commit edd0701

Please sign in to comment.