mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
[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 [df12d7eac4](https://github.com/facebook/react/commit/df12d7eac40c87bd5fdde0aa5a739bce9e7dce27)
This commit is contained in:
@@ -1 +1 @@
|
||||
fda1f0b902b527089fe5ae7b3aa573c633166ec9
|
||||
df12d7eac40c87bd5fdde0aa5a739bce9e7dce27
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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 (
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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()))
|
||||
);
|
||||
|
||||
@@ -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()))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user