diff --git a/packages/scheduler/src/SchedulerFeatureFlags.js b/packages/scheduler/src/SchedulerFeatureFlags.js index a5166f9813193..6828d0105ebb5 100644 --- a/packages/scheduler/src/SchedulerFeatureFlags.js +++ b/packages/scheduler/src/SchedulerFeatureFlags.js @@ -7,7 +7,6 @@ * @flow strict */ -export const enableSchedulerDebugging = false; export const enableProfiling = false; export const frameYieldMs = 5; diff --git a/packages/scheduler/src/forks/Scheduler.js b/packages/scheduler/src/forks/Scheduler.js index 3fe4d1720fc38..8b34f26bd0551 100644 --- a/packages/scheduler/src/forks/Scheduler.js +++ b/packages/scheduler/src/forks/Scheduler.js @@ -12,7 +12,6 @@ import type {PriorityLevel} from '../SchedulerPriorities'; import { - enableSchedulerDebugging, enableProfiling, frameYieldMs, userBlockingPriorityTimeout, @@ -83,9 +82,6 @@ var timerQueue: Array = []; // Incrementing id counter. Used to maintain insertion order. var taskIdCounter = 1; -// Pausing the scheduler is useful for debugging. -var isSchedulerPaused = false; - var currentTask = null; var currentPriorityLevel = NormalPriority; @@ -193,10 +189,7 @@ function workLoop(initialTime: number) { let currentTime = initialTime; advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null) { if (!enableAlwaysYieldScheduler) { if (currentTask.expirationTime > currentTime && shouldYieldToHost()) { // This currentTask hasn't expired, and we've reached the deadline. @@ -422,22 +415,6 @@ function unstable_scheduleCallback( return newTask; } -function unstable_pauseExecution() { - isSchedulerPaused = true; -} - -function unstable_continueExecution() { - isSchedulerPaused = false; - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(); - } -} - -function unstable_getFirstCallbackNode(): Task | null { - return peek(taskQueue); -} - function unstable_cancelCallback(task: Task) { if (enableProfiling) { if (task.isQueued) { @@ -606,9 +583,6 @@ export { unstable_getCurrentPriorityLevel, shouldYieldToHost as unstable_shouldYield, requestPaint as unstable_requestPaint, - unstable_continueExecution, - unstable_pauseExecution, - unstable_getFirstCallbackNode, getCurrentTime as unstable_now, forceFrameRate as unstable_forceFrameRate, }; diff --git a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js index 1d6b955eb8888..2873dee099787 100644 --- a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js +++ b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js @@ -12,7 +12,6 @@ const dynamicFeatureFlags = require('SchedulerFeatureFlags'); export const {enableRequestPaint} = dynamicFeatureFlags; -export const enableSchedulerDebugging = false; export const enableProfiling = __DEV__; export const frameYieldMs = 10; diff --git a/packages/scheduler/src/forks/SchedulerMock.js b/packages/scheduler/src/forks/SchedulerMock.js index 7f148c45be3e4..2fd23dbbc7610 100644 --- a/packages/scheduler/src/forks/SchedulerMock.js +++ b/packages/scheduler/src/forks/SchedulerMock.js @@ -12,10 +12,7 @@ import type {PriorityLevel} from '../SchedulerPriorities'; -import { - enableSchedulerDebugging, - enableProfiling, -} from '../SchedulerFeatureFlags'; +import {enableProfiling} from '../SchedulerFeatureFlags'; import {push, pop, peek} from '../SchedulerMinHeap'; // TODO: Use symbols? @@ -72,9 +69,6 @@ var timerQueue: Array = []; // Incrementing id counter. Used to maintain insertion order. var taskIdCounter = 1; -// Pausing the scheduler is useful for debugging. -var isSchedulerPaused = false; - var currentTask = null; var currentPriorityLevel = NormalPriority; @@ -195,10 +189,7 @@ function workLoop(hasTimeRemaining: boolean, initialTime: number): boolean { let currentTime = initialTime; advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null) { if ( currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost()) @@ -422,22 +413,6 @@ function unstable_scheduleCallback( return newTask; } -function unstable_pauseExecution() { - isSchedulerPaused = true; -} - -function unstable_continueExecution() { - isSchedulerPaused = false; - if (!isHostCallbackScheduled && !isPerformingWork) { - isHostCallbackScheduled = true; - requestHostCallback(flushWork); - } -} - -function unstable_getFirstCallbackNode(): Task | null { - return peek(taskQueue); -} - function unstable_cancelCallback(task: Task) { if (enableProfiling) { if (task.isQueued) { diff --git a/packages/scheduler/src/forks/SchedulerNative.js b/packages/scheduler/src/forks/SchedulerNative.js index 3832cbc69753e..33f9ae3313534 100644 --- a/packages/scheduler/src/forks/SchedulerNative.js +++ b/packages/scheduler/src/forks/SchedulerNative.js @@ -97,9 +97,6 @@ export const unstable_now: () => number | DOMHighResTimeStamp = export const unstable_next: any = throwNotImplemented; export const unstable_runWithPriority: any = throwNotImplemented; export const unstable_wrapCallback: any = throwNotImplemented; -export const unstable_continueExecution: any = throwNotImplemented; -export const unstable_pauseExecution: any = throwNotImplemented; -export const unstable_getFirstCallbackNode: any = throwNotImplemented; export const unstable_forceFrameRate: any = throwNotImplemented; export const unstable_Profiling: any = null; diff --git a/packages/scheduler/src/forks/SchedulerPostTask.js b/packages/scheduler/src/forks/SchedulerPostTask.js index a029fce0cbfcc..7465c38b92f8a 100644 --- a/packages/scheduler/src/forks/SchedulerPostTask.js +++ b/packages/scheduler/src/forks/SchedulerPostTask.js @@ -234,13 +234,5 @@ export function unstable_wrapCallback(callback: () => T): () => T { export function unstable_forceFrameRate() {} -export function unstable_pauseExecution() {} - -export function unstable_continueExecution() {} - -export function unstable_getFirstCallbackNode(): null { - return null; -} - // Currently no profiling build export const unstable_Profiling = null; diff --git a/scripts/jest/setupTests.www.js b/scripts/jest/setupTests.www.js index efee213861ca6..b0b653bb78ff9 100644 --- a/scripts/jest/setupTests.www.js +++ b/scripts/jest/setupTests.www.js @@ -34,9 +34,9 @@ jest.mock('scheduler/src/SchedulerFeatureFlags', () => { schedulerSrcPath + '/src/forks/SchedulerFeatureFlags.www' ); - // These flags are not a dynamic on www, but we still want to run - // tests in both versions. - actual.enableSchedulerDebugging = __VARIANT__; + // Add flags here that are not a dynamic on www, + // but we still want to run tests in both versions. + // return actual; });