Fork Scheduler feature flags for native-fb (#31859)
#31787 introduces an experimental scheduler flag: `enableAlwaysYieldScheduler`, which is turned off for www. There wasn't a SchedulerFeatureFlags fork for native-fb, so the experimental change was enabled in the Scheduler-dev build there which causes test failures and is blocking the sync. #31805 introduces another scheduler flag `enableRequestPaint`, which is set as a `__VARIANT__` on www. I've set this to `true` here to preserve the existing behavior. We can follow up with dynamic flags for native-fb after unblocking the sync.
Jack Pope committed
Dec 19, 2024 at 11:49 UTC
bd76ce54d93153cc84d861bd59e906bc28e1c160
2 files changed
+29
-7
packages/scheduler/src/forks/SchedulerFeatureFlags.native-fb.js
new
+18
@@ -0,0 +1,18 @@
1
+/**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ * @flow
8
+ */
9
+
10
+export const enableProfiling = __DEV__;
11
+export const frameYieldMs = 5;
12
+
13
+export const userBlockingPriorityTimeout = 250;
14
+export const normalPriorityTimeout = 5000;
15
+export const lowPriorityTimeout = 10000;
16
+export const enableRequestPaint = true;
17
+
18
+export const enableAlwaysYieldScheduler = false;
scripts/rollup/forks.js
+11
-7
@@ -195,14 +195,18 @@ const forks = Object.freeze({
195
entry,
196
dependencies
197
) => {
198
- if (
199
- bundleType === FB_WWW_DEV ||
200
- bundleType === FB_WWW_PROD ||
201
- bundleType === FB_WWW_PROFILING
202
- ) {
203
- return './packages/scheduler/src/forks/SchedulerFeatureFlags.www.js';
198
+ switch (bundleType) {
199
+ case FB_WWW_DEV:
200
+ case FB_WWW_PROD:
201
+ case FB_WWW_PROFILING:
202
+ return './packages/scheduler/src/forks/SchedulerFeatureFlags.www.js';
203
+ case RN_FB_DEV:
204
+ case RN_FB_PROD:
205
+ case RN_FB_PROFILING:
206
+ return './packages/scheduler/src/forks/SchedulerFeatureFlags.native-fb.js';
207
+ default:
208
+ return './packages/scheduler/src/SchedulerFeatureFlags.js';
209
}
205
- return './packages/scheduler/src/SchedulerFeatureFlags.js';
210
},
211
212
'./packages/shared/consoleWithStackDev.js': (bundleType, entry) => {