clean up isInputPending in Scheduler (#28444)

## Summary

`isInputPending` is not in use. This PR cleans up the flags controlling
its gating and parameters to simplify Scheduler.

Makes `frameYieldMs` feature flag static, set to 10ms in www, which we
found built on the wins provided by a broader yield interval via
`isInputPending`. Flag remains set to 5ms in OSS builds.

## How did you test this change?
`yarn test Scheduler`

DiffTrain build for commit https://github.com/facebook/react/commit/3bcd2de01b5716202eabe8faa338f51bdc59ce26.
This commit is contained in:
noahlemen
2024-02-27 15:43:16 +00:00
parent 54a10b4aed
commit ae4690b594
10 changed files with 14 additions and 30 deletions
@@ -25733,7 +25733,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "18.3.0-canary-172a7f629-20240226";
var ReactVersion = "18.3.0-canary-3bcd2de01-20240227";
// Might add PROFILE later.
@@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1014 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-172a7f629-20240226",
version: "18.3.0-canary-3bcd2de01-20240227",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1195 = {
@@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1195 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-172a7f629-20240226"
reconcilerVersion: "18.3.0-canary-3bcd2de01-20240227"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1196 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1056 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-172a7f629-20240226",
version: "18.3.0-canary-3bcd2de01-20240227",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1236 = {
@@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1236 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-172a7f629-20240226"
reconcilerVersion: "18.3.0-canary-3bcd2de01-20240227"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1237 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -26,7 +26,7 @@ if (__DEV__) {
}
var dynamicFlags = require("ReactNativeInternalFeatureFlags");
var ReactVersion = "18.3.0-canary-172a7f629-20240226";
var ReactVersion = "18.3.0-canary-3bcd2de01-20240227";
// ATTENTION
// When adding new symbols to this file,
@@ -598,4 +598,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-172a7f629-20240226";
exports.version = "18.3.0-canary-3bcd2de01-20240227";
@@ -594,7 +594,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-172a7f629-20240226";
exports.version = "18.3.0-canary-3bcd2de01-20240227";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<329119982dc400f73a57d3f8fddc6fb4>>
* @generated SignedSource<<58af4bb9ea8656229bd048421236ac87>>
*/
"use strict";
@@ -162,12 +162,6 @@ if (__DEV__) {
var localSetImmediate =
typeof setImmediate !== "undefined" ? setImmediate : null; // IE and Node.js + jsdom
typeof navigator !== "undefined" && // $FlowFixMe[prop-missing]
navigator.scheduling !== undefined && // $FlowFixMe[incompatible-type]
navigator.scheduling.isInputPending !== undefined
? navigator.scheduling.isInputPending.bind(navigator.scheduling)
: null;
function advanceTimers(currentTime) {
// Check for tasks that are no longer delayed and add them to the queue.
var timer = peek(timerQueue);
@@ -490,7 +484,7 @@ if (__DEV__) {
// The main thread has only been blocked for a really short amount of time;
// smaller than a single frame. Don't yield yet.
return false;
} // The main thread has been blocked for a non-negligible amount of time. We
} // Yield now.
return true;
}
@@ -540,7 +534,7 @@ if (__DEV__) {
isMessageLoopRunning = false;
}
}
} // Yielding to the browser will give it a chance to paint, so we can
}
};
var schedulePerformWorkUntilDeadline;
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<cd7ed3a069445a95189053c07769d208>>
* @generated SignedSource<<cff8a50048229c976ba8e49d76cca4f5>>
*/
"use strict";
@@ -83,11 +83,6 @@ var taskQueue = [],
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
"undefined" !== typeof navigator &&
void 0 !== navigator.scheduling &&
void 0 !== navigator.scheduling.isInputPending
? navigator.scheduling.isInputPending.bind(navigator.scheduling)
: null;
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
@@ -7,7 +7,7 @@
* @noflow
* @nolint
* @preventMunge
* @generated SignedSource<<685fe42d89ad677c0374d643bebb57cd>>
* @generated SignedSource<<2a1458dad9404c5aa87cab9701762eca>>
*/
"use strict";
@@ -87,11 +87,6 @@ var taskQueue = [],
localSetTimeout = "function" === typeof setTimeout ? setTimeout : null,
localClearTimeout = "function" === typeof clearTimeout ? clearTimeout : null,
localSetImmediate = "undefined" !== typeof setImmediate ? setImmediate : null;
"undefined" !== typeof navigator &&
void 0 !== navigator.scheduling &&
void 0 !== navigator.scheduling.isInputPending
? navigator.scheduling.isInputPending.bind(navigator.scheduling)
: null;
function advanceTimers(currentTime) {
for (var timer = peek(timerQueue); null !== timer; ) {
if (null === timer.callback) pop(timerQueue);
@@ -1 +1 @@
172a7f629a972fedb9e43fbae4fad0e9b1dc7fee
3bcd2de01b5716202eabe8faa338f51bdc59ce26