Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[www] reduce dynamic SchedulerFeatureFlags #26617

Merged
merged 3 commits into from
May 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/scheduler/src/__tests__/Scheduler-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
),
Expand Down Expand Up @@ -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',
),
Expand All @@ -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',
),
Expand Down Expand Up @@ -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',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
22 changes: 9 additions & 13 deletions packages/scheduler/src/forks/SchedulerFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;