mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
b1a56abd6a
Adds a feature flag `enableNewScheduler` that toggles between two implementations of ReactFiberScheduler. This will let us land changes in master while preserving the ability to quickly rollback. Ideally this will be a short-lived fork. Once we've tested the new scheduler for a week or so without issues, we will get rid of it. Until then, we'll need to maintain two parallel implementations and run tests against both of them. We rarely land changes to ReactFiberScheduler, so I don't expect this will be a huge burden. This commit does not implement anything new. The flag is still off and tests run against the existing implementation. Use `yarn test-new-scheduler` to run tests against the new one.
46 lines
1.7 KiB
JavaScript
46 lines
1.7 KiB
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @flow
|
|
*/
|
|
|
|
import invariant from 'shared/invariant';
|
|
|
|
import typeof * as FeatureFlagsType from 'shared/ReactFeatureFlags';
|
|
import typeof * as FeatureFlagsShimType from './ReactFeatureFlags.native-fb';
|
|
|
|
// Re-export dynamic flags from the fbsource version.
|
|
export const {debugRenderPhaseSideEffects} = require('ReactFeatureFlags');
|
|
|
|
// The rest of the flags are static for better dead code elimination.
|
|
export const enableUserTimingAPI = __DEV__;
|
|
export const enableProfilerTimer = __PROFILE__;
|
|
export const enableSchedulerTracing = __PROFILE__;
|
|
export const enableSuspenseServerRenderer = false;
|
|
export const enableStableConcurrentModeAPIs = false;
|
|
export const warnAboutShorthandPropertyCollision = false;
|
|
export const enableSchedulerDebugging = false;
|
|
export const debugRenderPhaseSideEffectsForStrictMode = true;
|
|
export const disableJavaScriptURLs = false;
|
|
export const disableYielding = false;
|
|
export const disableInputAttributeSyncing = false;
|
|
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
|
|
export const warnAboutDeprecatedLifecycles = true;
|
|
export const warnAboutDeprecatedSetNativeProps = true;
|
|
export const enableEventAPI = false;
|
|
export const enableNewScheduler = false;
|
|
|
|
// Only used in www builds.
|
|
export function addUserTimingListener() {
|
|
invariant(false, 'Not implemented.');
|
|
}
|
|
|
|
// Flow magic to verify the exports of this file match the original version.
|
|
// eslint-disable-next-line no-unused-vars
|
|
type Check<_X, Y: _X, X: Y = _X> = null;
|
|
// eslint-disable-next-line no-unused-expressions
|
|
(null: Check<FeatureFlagsShimType, FeatureFlagsType>);
|