From a5db64c49a030d5c005f34cf66a79f6fe1925e10 Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Thu, 13 Apr 2023 11:45:46 -0400 Subject: [PATCH 1/2] [www] reduce dynamic SchedulerFeatureFlags --- .../scheduler/src/__tests__/Scheduler-test.js | 8 ++++---- .../SchedulerFeatureFlags.www-dynamic.js | 6 ------ .../src/forks/SchedulerFeatureFlags.www.js | 19 +++++++------------ 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/packages/scheduler/src/__tests__/Scheduler-test.js b/packages/scheduler/src/__tests__/Scheduler-test.js index b705073dea66d..14ef25f3ad4f5 100644 --- a/packages/scheduler/src/__tests__/Scheduler-test.js +++ b/packages/scheduler/src/__tests__/Scheduler-test.js @@ -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', ), diff --git a/packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js b/packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js index 527906eab21ed..8232400b84d32 100644 --- a/packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js +++ b/packages/scheduler/src/forks/SchedulerFeatureFlags.www-dynamic.js @@ -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; diff --git a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js index d6a1b117d87fe..eb039ab1069e0 100644 --- a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js +++ b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js @@ -8,18 +8,13 @@ */ // $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; +import {enableProfiling as enableProfilingFeatureFlag} from '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; From 07e67d19abb6d49502527c9410602e39b4646e0f Mon Sep 17 00:00:00 2001 From: Jan Kassens Date: Thu, 13 Apr 2023 12:01:41 -0400 Subject: [PATCH 2/2] fix yarn build --- packages/scheduler/src/forks/SchedulerFeatureFlags.www.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js index eb039ab1069e0..4ad93cb70e594 100644 --- a/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js +++ b/packages/scheduler/src/forks/SchedulerFeatureFlags.www.js @@ -7,8 +7,9 @@ * @flow */ -// $FlowFixMe[cannot-resolve-module] -import {enableProfiling as enableProfilingFeatureFlag} from 'SchedulerFeatureFlags'; +const {enableProfiling: enableProfilingFeatureFlag} = + // $FlowFixMe[cannot-resolve-module] + require('SchedulerFeatureFlags'); export const enableSchedulerDebugging = true; export const enableProfiling: boolean =