Skip to content

Commit

Permalink
Create separate SchedulerFeatureFlags instead of using ReactFeatureFl…
Browse files Browse the repository at this point in the history
…ags (#14455)
  • Loading branch information
acdlite committed Dec 18, 2018
1 parent 8bfef0d commit 653bc58
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
9 changes: 9 additions & 0 deletions packages/scheduler/forks/SchedulerFeatureFlags.www.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

export const enableSchedulerDebugging = true;
2 changes: 1 addition & 1 deletion packages/scheduler/src/Scheduler.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/* eslint-disable no-var */

import {enableSchedulerDebugging} from 'shared/ReactFeatureFlags';
import {enableSchedulerDebugging} from './SchedulerFeatureFlags';

// TODO: Use symbols?
var ImmediatePriority = 1;
Expand Down
9 changes: 9 additions & 0 deletions packages/scheduler/src/SchedulerFeatureFlags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/

export const enableSchedulerDebugging = false;
12 changes: 12 additions & 0 deletions scripts/rollup/forks.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,18 @@ const forks = Object.freeze({
}
},

'scheduler/src/SchedulerFeatureFlags': (bundleType, entry, dependencies) => {
if (
entry === 'scheduler' &&
(bundleType === FB_WWW_DEV ||
bundleType === FB_WWW_PROD ||
bundleType === FB_WWW_PROFILING)
) {
return 'scheduler/forks/SchedulerFeatureFlags.www.js';
}
return 'scheduler/src/SchedulerFeatureFlags';
},

// This logic is forked on www to fork the formatting function.
'shared/invariant': (bundleType, entry) => {
switch (bundleType) {
Expand Down

0 comments on commit 653bc58

Please sign in to comment.