[www] reduce dynamic SchedulerFeatureFlags (#26617)

For these values we're not using dynamic values. We can statically
compile in the values we're running.
This commit is contained in:
Jan Kassens
2023-05-10 17:26:05 -04:00
committed by GitHub
parent 7cd98ef2bc
commit df12d7eac4
3 changed files with 13 additions and 23 deletions
@@ -344,7 +344,7 @@ describe('SchedulerBrowser', () => {
// about, like a network event.
gate(flags =>
flags.enableIsInputPending
? 'Yield at 300ms'
? 'Yield at 10ms'
: // When isInputPending is disabled, we always yield quickly
'Yield at 5ms',
),
@@ -398,7 +398,7 @@ describe('SchedulerBrowser', () => {
// about, like a network event.
gate(flags =>
flags.enableIsInputPending
? 'Yield at 300ms'
? 'Yield at 10ms'
: // When isInputPending is disabled, we always yield quickly
'Yield at 5ms',
),
@@ -423,7 +423,7 @@ describe('SchedulerBrowser', () => {
// as quickly as for a discrete event.
gate(flags =>
flags.enableIsInputPending
? 'Yield at 50ms'
? 'Yield at 10ms'
: // When isInputPending is disabled, we always yield quickly
'Yield at 5ms',
),
@@ -453,7 +453,7 @@ describe('SchedulerBrowser', () => {
'Task with no paint',
gate(flags =>
flags.enableIsInputPending
? 'Yield at 300ms'
? 'Yield at 10ms'
: // When isInputPending is disabled, we always yield quickly
'Yield at 5ms',
),
@@ -11,10 +11,4 @@
// Use __VARIANT__ to simulate a GK. The tests will be run twice: once
// with the __VARIANT__ set to `true`, and once set to `false`.
export const enableIsInputPending = __VARIANT__;
export const enableSchedulerDebugging = __VARIANT__;
export const enableProfiling = __VARIANT__;
export const enableIsInputPendingContinuous = __VARIANT__;
export const frameYieldMs = 5;
export const continuousYieldMs = 50;
export const maxYieldMs = 300;
@@ -7,19 +7,15 @@
* @flow
*/
// $FlowFixMe[cannot-resolve-module]
const dynamicFeatureFlags = require('SchedulerFeatureFlags');
// Re-export dynamic flags from the www version.
export const {
enableIsInputPending,
enableSchedulerDebugging,
enableProfiling: enableProfilingFeatureFlag,
enableIsInputPendingContinuous,
frameYieldMs,
continuousYieldMs,
maxYieldMs,
} = dynamicFeatureFlags;
const {enableProfiling: enableProfilingFeatureFlag} =
// $FlowFixMe[cannot-resolve-module]
require('SchedulerFeatureFlags');
export const enableSchedulerDebugging = true;
export const enableProfiling: boolean =
__PROFILE__ && enableProfilingFeatureFlag;
export const enableIsInputPending = true;
export const enableIsInputPendingContinuous = true;
export const frameYieldMs = 5;
export const continuousYieldMs = 10;
export const maxYieldMs = 10;