From d08f005d08188fe87e319f099b9514be12bd71cd Mon Sep 17 00:00:00 2001 From: kassens Date: Wed, 10 May 2023 21:32:07 +0000 Subject: [PATCH] [www] reduce dynamic SchedulerFeatureFlags (#26617) For these values we're not using dynamic values. We can statically compile in the values we're running. DiffTrain build for [df12d7eac40c87bd5fdde0aa5a739bce9e7dce27](https://github.com/facebook/react/commit/df12d7eac40c87bd5fdde0aa5a739bce9e7dce27) --- compiled/facebook-www/REVISION | 2 +- compiled/facebook-www/React-dev.classic.js | 2 +- compiled/facebook-www/React-prod.classic.js | 2 +- .../facebook-www/ReactDOM-prod.classic.js | 6 ++-- .../ReactDOM-profiling.classic.js | 6 ++-- .../facebook-www/ReactDOMServer-dev.modern.js | 2 +- .../facebook-www/Scheduler-dev.classic.js | 25 +++++--------- compiled/facebook-www/Scheduler-dev.modern.js | 25 +++++--------- .../facebook-www/Scheduler-prod.classic.js | 32 ++++++----------- .../facebook-www/Scheduler-prod.modern.js | 32 ++++++----------- .../Scheduler-profiling.classic.js | 34 +++++++------------ .../Scheduler-profiling.modern.js | 34 +++++++------------ .../facebook-www/SchedulerMock-dev.classic.js | 12 ++----- .../facebook-www/SchedulerMock-dev.modern.js | 12 ++----- .../SchedulerMock-prod.classic.js | 5 ++- .../facebook-www/SchedulerMock-prod.modern.js | 5 ++- 16 files changed, 82 insertions(+), 154 deletions(-) diff --git a/compiled/facebook-www/REVISION b/compiled/facebook-www/REVISION index c7aea04894..9f7e914f89 100644 --- a/compiled/facebook-www/REVISION +++ b/compiled/facebook-www/REVISION @@ -1 +1 @@ -fda1f0b902b527089fe5ae7b3aa573c633166ec9 +df12d7eac40c87bd5fdde0aa5a739bce9e7dce27 diff --git a/compiled/facebook-www/React-dev.classic.js b/compiled/facebook-www/React-dev.classic.js index 2ddcdf9aa9..a7dca3ed77 100644 --- a/compiled/facebook-www/React-dev.classic.js +++ b/compiled/facebook-www/React-dev.classic.js @@ -27,7 +27,7 @@ if ( } "use strict"; -var ReactVersion = "18.3.0-www-classic-cb3b85f4"; +var ReactVersion = "18.3.0-www-classic-3ad03410"; // ATTENTION // When adding new symbols to this file, diff --git a/compiled/facebook-www/React-prod.classic.js b/compiled/facebook-www/React-prod.classic.js index b5ac16db6d..baa2442d23 100644 --- a/compiled/facebook-www/React-prod.classic.js +++ b/compiled/facebook-www/React-prod.classic.js @@ -649,4 +649,4 @@ exports.useSyncExternalStore = function ( ); }; exports.useTransition = useTransition; -exports.version = "18.3.0-www-classic-f8d70dc8"; +exports.version = "18.3.0-www-classic-14f80a86"; diff --git a/compiled/facebook-www/ReactDOM-prod.classic.js b/compiled/facebook-www/ReactDOM-prod.classic.js index 5694356b37..42d1895212 100644 --- a/compiled/facebook-www/ReactDOM-prod.classic.js +++ b/compiled/facebook-www/ReactDOM-prod.classic.js @@ -16642,7 +16642,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1829 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-39ad496a", + version: "18.3.0-www-classic-fbb135ff", rendererPackageName: "react-dom" }; var internals$jscomp$inline_2203 = { @@ -16672,7 +16672,7 @@ var internals$jscomp$inline_2203 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-39ad496a" + reconcilerVersion: "18.3.0-www-classic-fbb135ff" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { var hook$jscomp$inline_2204 = __REACT_DEVTOOLS_GLOBAL_HOOK__; @@ -16915,4 +16915,4 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-39ad496a"; +exports.version = "18.3.0-www-classic-fbb135ff"; diff --git a/compiled/facebook-www/ReactDOM-profiling.classic.js b/compiled/facebook-www/ReactDOM-profiling.classic.js index 08ef29da76..3ec689da22 100644 --- a/compiled/facebook-www/ReactDOM-profiling.classic.js +++ b/compiled/facebook-www/ReactDOM-profiling.classic.js @@ -17417,7 +17417,7 @@ Internals.Events = [ var devToolsConfig$jscomp$inline_1914 = { findFiberByHostInstance: getClosestInstanceFromNode, bundleType: 0, - version: "18.3.0-www-classic-b562d988", + version: "18.3.0-www-classic-b9ad8cd3", rendererPackageName: "react-dom" }; (function (internals) { @@ -17461,7 +17461,7 @@ var devToolsConfig$jscomp$inline_1914 = { scheduleRoot: null, setRefreshHandler: null, getCurrentFiber: null, - reconcilerVersion: "18.3.0-www-classic-b562d988" + reconcilerVersion: "18.3.0-www-classic-b9ad8cd3" }); assign(Internals, { ReactBrowserEventEmitter: { @@ -17691,7 +17691,7 @@ exports.unstable_renderSubtreeIntoContainer = function ( ); }; exports.unstable_runWithPriority = runWithPriority; -exports.version = "18.3.0-www-classic-b562d988"; +exports.version = "18.3.0-www-classic-b9ad8cd3"; /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if ( diff --git a/compiled/facebook-www/ReactDOMServer-dev.modern.js b/compiled/facebook-www/ReactDOMServer-dev.modern.js index 06ba321e3a..df52b0af67 100644 --- a/compiled/facebook-www/ReactDOMServer-dev.modern.js +++ b/compiled/facebook-www/ReactDOMServer-dev.modern.js @@ -19,7 +19,7 @@ if (__DEV__) { var React = require("react"); var ReactDOM = require("react-dom"); -var ReactVersion = "18.3.0-www-modern-80147166"; +var ReactVersion = "18.3.0-www-modern-8c5679db"; // This refers to a WWW module. var warningWWW = require("warning"); diff --git a/compiled/facebook-www/Scheduler-dev.classic.js b/compiled/facebook-www/Scheduler-dev.classic.js index 6717a1ba7f..e6eb7b4ba3 100644 --- a/compiled/facebook-www/Scheduler-dev.classic.js +++ b/compiled/facebook-www/Scheduler-dev.classic.js @@ -27,18 +27,13 @@ if ( } "use strict"; -// $FlowFixMe[cannot-resolve-module] -var dynamicFeatureFlags = require("SchedulerFeatureFlags"); // Re-export dynamic flags from the www version. - -var enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +var _require = require("SchedulerFeatureFlags"), // $FlowFixMe[cannot-resolve-module] + enableProfilingFeatureFlag = _require.enableProfiling; var enableProfiling = enableProfilingFeatureFlag; +var enableIsInputPendingContinuous = true; +var frameYieldMs = 5; +var continuousYieldMs = 10; +var maxYieldMs = 10; function push(heap, node) { var index = heap.length; @@ -413,10 +408,7 @@ function workLoop(hasTimeRemaining, initialTime) { advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null && !isSchedulerPaused) { if ( currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost()) @@ -711,7 +703,7 @@ function shouldYieldToHost() { // wasn't accompanied by a call to `requestPaint`, or other main thread tasks // like network events. - if (enableIsInputPending) { + { if (needsPaint) { // There's a pending paint (signaled by `requestPaint`). Yield now. return true; @@ -742,7 +734,6 @@ function shouldYieldToHost() { function requestPaint() { if ( - enableIsInputPending && navigator !== undefined && // $FlowFixMe[prop-missing] navigator.scheduling !== undefined && // $FlowFixMe[incompatible-type] navigator.scheduling.isInputPending !== undefined diff --git a/compiled/facebook-www/Scheduler-dev.modern.js b/compiled/facebook-www/Scheduler-dev.modern.js index 6717a1ba7f..e6eb7b4ba3 100644 --- a/compiled/facebook-www/Scheduler-dev.modern.js +++ b/compiled/facebook-www/Scheduler-dev.modern.js @@ -27,18 +27,13 @@ if ( } "use strict"; -// $FlowFixMe[cannot-resolve-module] -var dynamicFeatureFlags = require("SchedulerFeatureFlags"); // Re-export dynamic flags from the www version. - -var enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +var _require = require("SchedulerFeatureFlags"), // $FlowFixMe[cannot-resolve-module] + enableProfilingFeatureFlag = _require.enableProfiling; var enableProfiling = enableProfilingFeatureFlag; +var enableIsInputPendingContinuous = true; +var frameYieldMs = 5; +var continuousYieldMs = 10; +var maxYieldMs = 10; function push(heap, node) { var index = heap.length; @@ -413,10 +408,7 @@ function workLoop(hasTimeRemaining, initialTime) { advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null && !isSchedulerPaused) { if ( currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost()) @@ -711,7 +703,7 @@ function shouldYieldToHost() { // wasn't accompanied by a call to `requestPaint`, or other main thread tasks // like network events. - if (enableIsInputPending) { + { if (needsPaint) { // There's a pending paint (signaled by `requestPaint`). Yield now. return true; @@ -742,7 +734,6 @@ function shouldYieldToHost() { function requestPaint() { if ( - enableIsInputPending && navigator !== undefined && // $FlowFixMe[prop-missing] navigator.scheduling !== undefined && // $FlowFixMe[incompatible-type] navigator.scheduling.isInputPending !== undefined diff --git a/compiled/facebook-www/Scheduler-prod.classic.js b/compiled/facebook-www/Scheduler-prod.classic.js index 4db2d97aa0..7163127e70 100644 --- a/compiled/facebook-www/Scheduler-prod.classic.js +++ b/compiled/facebook-www/Scheduler-prod.classic.js @@ -11,14 +11,7 @@ */ "use strict"; -var dynamicFeatureFlags = require("SchedulerFeatureFlags"), - enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +require("SchedulerFeatureFlags"); function push(heap, node) { var index = heap.length; heap.push(node); @@ -98,7 +91,7 @@ var taskQueue = [], void 0 !== navigator.scheduling.isInputPending ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null, - continuousOptions = { includeContinuous: enableIsInputPendingContinuous }; + continuousOptions = { includeContinuous: !0 }; function advanceTimers(currentTime) { for (var timer = peek(timerQueue); null !== timer; ) { if (null === timer.callback) pop(timerQueue); @@ -137,7 +130,7 @@ function flushWork(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) ); @@ -180,19 +173,17 @@ function flushWork(hasTimeRemaining, initialTime) { var isMessageLoopRunning = !1, scheduledHostCallback = null, taskTimeoutID = -1, - frameInterval = frameYieldMs, + frameInterval = 5, startTime = -1, needsPaint = !1; function shouldYieldToHost() { var timeElapsed = exports.unstable_now() - startTime; if (timeElapsed < frameInterval) return !1; - if (enableIsInputPending) { - if (needsPaint) return !0; - if (timeElapsed < continuousYieldMs) { - if (null !== isInputPending) return isInputPending(); - } else if (timeElapsed < maxYieldMs && null !== isInputPending) - return isInputPending(continuousOptions); - } + if (needsPaint) return !0; + if (10 > timeElapsed) { + if (null !== isInputPending) return isInputPending(); + } else if (10 > timeElapsed && null !== isInputPending) + return isInputPending(continuousOptions); return !0; } function performWorkUntilDeadline() { @@ -256,7 +247,7 @@ exports.unstable_forceFrameRate = function (fps) { ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" ) - : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : frameYieldMs); + : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5); }; exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; @@ -286,8 +277,7 @@ exports.unstable_pauseExecution = function () { isSchedulerPaused = !0; }; exports.unstable_requestPaint = function () { - enableIsInputPending && - void 0 !== navigator && + void 0 !== navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && (needsPaint = !0); diff --git a/compiled/facebook-www/Scheduler-prod.modern.js b/compiled/facebook-www/Scheduler-prod.modern.js index 4db2d97aa0..7163127e70 100644 --- a/compiled/facebook-www/Scheduler-prod.modern.js +++ b/compiled/facebook-www/Scheduler-prod.modern.js @@ -11,14 +11,7 @@ */ "use strict"; -var dynamicFeatureFlags = require("SchedulerFeatureFlags"), - enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +require("SchedulerFeatureFlags"); function push(heap, node) { var index = heap.length; heap.push(node); @@ -98,7 +91,7 @@ var taskQueue = [], void 0 !== navigator.scheduling.isInputPending ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null, - continuousOptions = { includeContinuous: enableIsInputPendingContinuous }; + continuousOptions = { includeContinuous: !0 }; function advanceTimers(currentTime) { for (var timer = peek(timerQueue); null !== timer; ) { if (null === timer.callback) pop(timerQueue); @@ -137,7 +130,7 @@ function flushWork(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) ); @@ -180,19 +173,17 @@ function flushWork(hasTimeRemaining, initialTime) { var isMessageLoopRunning = !1, scheduledHostCallback = null, taskTimeoutID = -1, - frameInterval = frameYieldMs, + frameInterval = 5, startTime = -1, needsPaint = !1; function shouldYieldToHost() { var timeElapsed = exports.unstable_now() - startTime; if (timeElapsed < frameInterval) return !1; - if (enableIsInputPending) { - if (needsPaint) return !0; - if (timeElapsed < continuousYieldMs) { - if (null !== isInputPending) return isInputPending(); - } else if (timeElapsed < maxYieldMs && null !== isInputPending) - return isInputPending(continuousOptions); - } + if (needsPaint) return !0; + if (10 > timeElapsed) { + if (null !== isInputPending) return isInputPending(); + } else if (10 > timeElapsed && null !== isInputPending) + return isInputPending(continuousOptions); return !0; } function performWorkUntilDeadline() { @@ -256,7 +247,7 @@ exports.unstable_forceFrameRate = function (fps) { ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" ) - : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : frameYieldMs); + : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5); }; exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; @@ -286,8 +277,7 @@ exports.unstable_pauseExecution = function () { isSchedulerPaused = !0; }; exports.unstable_requestPaint = function () { - enableIsInputPending && - void 0 !== navigator && + void 0 !== navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && (needsPaint = !0); diff --git a/compiled/facebook-www/Scheduler-profiling.classic.js b/compiled/facebook-www/Scheduler-profiling.classic.js index eaa5254a91..6a9e313a1c 100644 --- a/compiled/facebook-www/Scheduler-profiling.classic.js +++ b/compiled/facebook-www/Scheduler-profiling.classic.js @@ -22,15 +22,8 @@ if ( __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } "use strict"; -var dynamicFeatureFlags = require("SchedulerFeatureFlags"), - enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +var enableProfilingFeatureFlag = + require("SchedulerFeatureFlags").enableProfiling; function push(heap, node) { var index = heap.length; heap.push(node); @@ -150,7 +143,7 @@ var taskQueue = [], void 0 !== navigator.scheduling.isInputPending ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null, - continuousOptions = { includeContinuous: enableIsInputPendingContinuous }; + continuousOptions = { includeContinuous: !0 }; function advanceTimers(currentTime) { for (var timer = peek(timerQueue); null !== timer; ) { if (null === timer.callback) pop(timerQueue); @@ -224,7 +217,7 @@ function workLoop(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) ); @@ -273,19 +266,17 @@ function workLoop(hasTimeRemaining, initialTime) { var isMessageLoopRunning = !1, scheduledHostCallback = null, taskTimeoutID = -1, - frameInterval = frameYieldMs, + frameInterval = 5, startTime = -1, needsPaint = !1; function shouldYieldToHost() { var timeElapsed = exports.unstable_now() - startTime; if (timeElapsed < frameInterval) return !1; - if (enableIsInputPending) { - if (needsPaint) return !0; - if (timeElapsed < continuousYieldMs) { - if (null !== isInputPending) return isInputPending(); - } else if (timeElapsed < maxYieldMs && null !== isInputPending) - return isInputPending(continuousOptions); - } + if (needsPaint) return !0; + if (10 > timeElapsed) { + if (null !== isInputPending) return isInputPending(); + } else if (10 > timeElapsed && null !== isInputPending) + return isInputPending(continuousOptions); return !0; } function performWorkUntilDeadline() { @@ -362,7 +353,7 @@ exports.unstable_forceFrameRate = function (fps) { ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" ) - : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : frameYieldMs); + : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5); }; exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; @@ -392,8 +383,7 @@ exports.unstable_pauseExecution = function () { isSchedulerPaused = !0; }; exports.unstable_requestPaint = function () { - enableIsInputPending && - void 0 !== navigator && + void 0 !== navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && (needsPaint = !0); diff --git a/compiled/facebook-www/Scheduler-profiling.modern.js b/compiled/facebook-www/Scheduler-profiling.modern.js index eaa5254a91..6a9e313a1c 100644 --- a/compiled/facebook-www/Scheduler-profiling.modern.js +++ b/compiled/facebook-www/Scheduler-profiling.modern.js @@ -22,15 +22,8 @@ if ( __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error()); } "use strict"; -var dynamicFeatureFlags = require("SchedulerFeatureFlags"), - enableIsInputPending = dynamicFeatureFlags.enableIsInputPending, - enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling, - enableIsInputPendingContinuous = - dynamicFeatureFlags.enableIsInputPendingContinuous, - frameYieldMs = dynamicFeatureFlags.frameYieldMs, - continuousYieldMs = dynamicFeatureFlags.continuousYieldMs, - maxYieldMs = dynamicFeatureFlags.maxYieldMs; +var enableProfilingFeatureFlag = + require("SchedulerFeatureFlags").enableProfiling; function push(heap, node) { var index = heap.length; heap.push(node); @@ -150,7 +143,7 @@ var taskQueue = [], void 0 !== navigator.scheduling.isInputPending ? navigator.scheduling.isInputPending.bind(navigator.scheduling) : null, - continuousOptions = { includeContinuous: enableIsInputPendingContinuous }; + continuousOptions = { includeContinuous: !0 }; function advanceTimers(currentTime) { for (var timer = peek(timerQueue); null !== timer; ) { if (null === timer.callback) pop(timerQueue); @@ -224,7 +217,7 @@ function workLoop(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) ); @@ -273,19 +266,17 @@ function workLoop(hasTimeRemaining, initialTime) { var isMessageLoopRunning = !1, scheduledHostCallback = null, taskTimeoutID = -1, - frameInterval = frameYieldMs, + frameInterval = 5, startTime = -1, needsPaint = !1; function shouldYieldToHost() { var timeElapsed = exports.unstable_now() - startTime; if (timeElapsed < frameInterval) return !1; - if (enableIsInputPending) { - if (needsPaint) return !0; - if (timeElapsed < continuousYieldMs) { - if (null !== isInputPending) return isInputPending(); - } else if (timeElapsed < maxYieldMs && null !== isInputPending) - return isInputPending(continuousOptions); - } + if (needsPaint) return !0; + if (10 > timeElapsed) { + if (null !== isInputPending) return isInputPending(); + } else if (10 > timeElapsed && null !== isInputPending) + return isInputPending(continuousOptions); return !0; } function performWorkUntilDeadline() { @@ -362,7 +353,7 @@ exports.unstable_forceFrameRate = function (fps) { ? console.error( "forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported" ) - : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : frameYieldMs); + : (frameInterval = 0 < fps ? Math.floor(1e3 / fps) : 5); }; exports.unstable_getCurrentPriorityLevel = function () { return currentPriorityLevel; @@ -392,8 +383,7 @@ exports.unstable_pauseExecution = function () { isSchedulerPaused = !0; }; exports.unstable_requestPaint = function () { - enableIsInputPending && - void 0 !== navigator && + void 0 !== navigator && void 0 !== navigator.scheduling && void 0 !== navigator.scheduling.isInputPending && (needsPaint = !0); diff --git a/compiled/facebook-www/SchedulerMock-dev.classic.js b/compiled/facebook-www/SchedulerMock-dev.classic.js index cdfb60954d..c53731eba4 100644 --- a/compiled/facebook-www/SchedulerMock-dev.classic.js +++ b/compiled/facebook-www/SchedulerMock-dev.classic.js @@ -16,11 +16,8 @@ if (__DEV__) { (function() { "use strict"; -// $FlowFixMe[cannot-resolve-module] -var dynamicFeatureFlags = require("SchedulerFeatureFlags"); // Re-export dynamic flags from the www version. - -var enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling; +var _require = require("SchedulerFeatureFlags"), // $FlowFixMe[cannot-resolve-module] + enableProfilingFeatureFlag = _require.enableProfiling; var enableProfiling = enableProfilingFeatureFlag; function push(heap, node) { @@ -377,10 +374,7 @@ function workLoop(hasTimeRemaining, initialTime) { advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null && !isSchedulerPaused) { if ( currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost()) diff --git a/compiled/facebook-www/SchedulerMock-dev.modern.js b/compiled/facebook-www/SchedulerMock-dev.modern.js index cdfb60954d..c53731eba4 100644 --- a/compiled/facebook-www/SchedulerMock-dev.modern.js +++ b/compiled/facebook-www/SchedulerMock-dev.modern.js @@ -16,11 +16,8 @@ if (__DEV__) { (function() { "use strict"; -// $FlowFixMe[cannot-resolve-module] -var dynamicFeatureFlags = require("SchedulerFeatureFlags"); // Re-export dynamic flags from the www version. - -var enableSchedulerDebugging = dynamicFeatureFlags.enableSchedulerDebugging, - enableProfilingFeatureFlag = dynamicFeatureFlags.enableProfiling; +var _require = require("SchedulerFeatureFlags"), // $FlowFixMe[cannot-resolve-module] + enableProfilingFeatureFlag = _require.enableProfiling; var enableProfiling = enableProfilingFeatureFlag; function push(heap, node) { @@ -377,10 +374,7 @@ function workLoop(hasTimeRemaining, initialTime) { advanceTimers(currentTime); currentTask = peek(taskQueue); - while ( - currentTask !== null && - !(enableSchedulerDebugging && isSchedulerPaused) - ) { + while (currentTask !== null && !isSchedulerPaused) { if ( currentTask.expirationTime > currentTime && (!hasTimeRemaining || shouldYieldToHost()) diff --git a/compiled/facebook-www/SchedulerMock-prod.classic.js b/compiled/facebook-www/SchedulerMock-prod.classic.js index dc45771ad1..03c58b2405 100644 --- a/compiled/facebook-www/SchedulerMock-prod.classic.js +++ b/compiled/facebook-www/SchedulerMock-prod.classic.js @@ -11,8 +11,7 @@ */ "use strict"; -var enableSchedulerDebugging = - require("SchedulerFeatureFlags").enableSchedulerDebugging; +require("SchedulerFeatureFlags"); function push(heap, node) { var index = heap.length; heap.push(node); @@ -121,7 +120,7 @@ function flushWork(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) ); diff --git a/compiled/facebook-www/SchedulerMock-prod.modern.js b/compiled/facebook-www/SchedulerMock-prod.modern.js index dc45771ad1..03c58b2405 100644 --- a/compiled/facebook-www/SchedulerMock-prod.modern.js +++ b/compiled/facebook-www/SchedulerMock-prod.modern.js @@ -11,8 +11,7 @@ */ "use strict"; -var enableSchedulerDebugging = - require("SchedulerFeatureFlags").enableSchedulerDebugging; +require("SchedulerFeatureFlags"); function push(heap, node) { var index = heap.length; heap.push(node); @@ -121,7 +120,7 @@ function flushWork(hasTimeRemaining, initialTime) { currentTask = peek(taskQueue); !( null === currentTask || - (enableSchedulerDebugging && isSchedulerPaused) || + isSchedulerPaused || (currentTask.expirationTime > initialTime && (!hasTimeRemaining || shouldYieldToHost())) );