Skip to content

Commit 962dfc2

Browse files
authored
Remove experimental scheduler flags (#16672)
1 parent ff00645 commit 962dfc2

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

packages/scheduler/src/SchedulerFeatureFlags.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,5 @@
88

99
export const enableSchedulerDebugging = false;
1010
export const enableIsInputPending = false;
11-
export const requestIdleCallbackBeforeFirstFrame = false;
12-
export const requestTimerEventBeforeFirstFrame = false;
1311
export const enableMessageLoopImplementation = true;
1412
export const enableProfiling = __PROFILE__;

packages/scheduler/src/forks/SchedulerFeatureFlags.www.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,4 @@ export const {
1212
} = require('SchedulerFeatureFlags');
1313

1414
export const enableProfiling = __PROFILE__;
15-
export const requestIdleCallbackBeforeFirstFrame = false;
16-
export const requestTimerEventBeforeFirstFrame = false;
1715
export const enableMessageLoopImplementation = true;

packages/scheduler/src/forks/SchedulerHostConfig.default.js

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
import {
99
enableIsInputPending,
10-
requestIdleCallbackBeforeFirstFrame as requestIdleCallbackBeforeFirstFrameFlag,
11-
requestTimerEventBeforeFirstFrame,
1210
enableMessageLoopImplementation,
1311
} from '../SchedulerFeatureFlags';
1412

@@ -87,7 +85,6 @@ if (
8785
const clearTimeout = window.clearTimeout;
8886
const requestAnimationFrame = window.requestAnimationFrame;
8987
const cancelAnimationFrame = window.cancelAnimationFrame;
90-
const requestIdleCallback = window.requestIdleCallback;
9188

9289
if (typeof console !== 'undefined') {
9390
// TODO: Remove fb.me link
@@ -107,11 +104,6 @@ if (
107104
}
108105
}
109106

110-
const requestIdleCallbackBeforeFirstFrame =
111-
requestIdleCallbackBeforeFirstFrameFlag &&
112-
typeof requestIdleCallback === 'function' &&
113-
typeof cancelIdleCallback === 'function';
114-
115107
if (
116108
typeof performance === 'object' &&
117109
typeof performance.now === 'function'
@@ -359,50 +351,8 @@ if (
359351
// Start a rAF loop.
360352
isRAFLoopRunning = true;
361353
requestAnimationFrame(rAFTime => {
362-
if (requestIdleCallbackBeforeFirstFrame) {
363-
cancelIdleCallback(idleCallbackID);
364-
}
365-
if (requestTimerEventBeforeFirstFrame) {
366-
clearTimeout(idleTimeoutID);
367-
}
368354
onAnimationFrame(rAFTime);
369355
});
370-
371-
// If we just missed the last vsync, the next rAF might not happen for
372-
// another frame. To claim as much idle time as possible, post a
373-
// callback with `requestIdleCallback`, which should fire if there's
374-
// idle time left in the frame.
375-
//
376-
// This should only be an issue for the first rAF in the loop;
377-
// subsequent rAFs are scheduled at the beginning of the
378-
// preceding frame.
379-
let idleCallbackID;
380-
if (requestIdleCallbackBeforeFirstFrame) {
381-
idleCallbackID = requestIdleCallback(
382-
function onIdleCallbackBeforeFirstFrame() {
383-
if (requestTimerEventBeforeFirstFrame) {
384-
clearTimeout(idleTimeoutID);
385-
}
386-
frameDeadline = getCurrentTime() + frameLength;
387-
performWorkUntilDeadline();
388-
},
389-
);
390-
}
391-
// Alternate strategy to address the same problem. Scheduler a timer
392-
// with no delay. If this fires before the rAF, that likely indicates
393-
// that there's idle time before the next vsync. This isn't always the
394-
// case, but we'll be aggressive and assume it is, as a trade off to
395-
// prevent idle periods.
396-
let idleTimeoutID;
397-
if (requestTimerEventBeforeFirstFrame) {
398-
idleTimeoutID = setTimeout(function onTimerEventBeforeFirstFrame() {
399-
if (requestIdleCallbackBeforeFirstFrame) {
400-
cancelIdleCallback(idleCallbackID);
401-
}
402-
frameDeadline = getCurrentTime() + frameLength;
403-
performWorkUntilDeadline();
404-
}, 0);
405-
}
406356
}
407357
}
408358
};

0 commit comments

Comments
 (0)