From b4e314891826da7e65ce600cdcf320041dafc0d2 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Thu, 27 Feb 2020 12:58:15 +0000 Subject: [PATCH] Remove unused flag (#18132) --- packages/react-reconciler/src/ReactFiberWorkLoop.js | 13 +------------ packages/shared/ReactFeatureFlags.js | 2 -- .../shared/forks/ReactFeatureFlags.native-fb.js | 1 - .../shared/forks/ReactFeatureFlags.native-oss.js | 1 - .../shared/forks/ReactFeatureFlags.persistent.js | 1 - .../shared/forks/ReactFeatureFlags.test-renderer.js | 1 - .../forks/ReactFeatureFlags.test-renderer.www.js | 1 - packages/shared/forks/ReactFeatureFlags.testing.js | 1 - .../shared/forks/ReactFeatureFlags.testing.www.js | 1 - packages/shared/forks/ReactFeatureFlags.www.js | 2 -- 10 files changed, 1 insertion(+), 23 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.js b/packages/react-reconciler/src/ReactFiberWorkLoop.js index 1272338f75ad7..8850e8532f901 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.js @@ -28,7 +28,6 @@ import { warnAboutUnmockedScheduler, flushSuspenseFallbacksInTests, disableSchedulerTimeoutBasedOnReactExpirationTime, - enableTrainModelFix, } from 'shared/ReactFeatureFlags'; import ReactSharedInternals from 'shared/ReactSharedInternals'; import invariant from 'shared/invariant'; @@ -548,11 +547,7 @@ function getNextRootExpirationTimeToWorkOn(root: FiberRoot): ExpirationTime { lastPingedTime > nextKnownPendingLevel ? lastPingedTime : nextKnownPendingLevel; - if ( - enableTrainModelFix && - nextLevel <= Idle && - firstPendingTime !== nextLevel - ) { + if (nextLevel <= Idle && firstPendingTime !== nextLevel) { // Don't work on Idle/Never priority unless everything else is committed. return NoWork; } @@ -2478,12 +2473,6 @@ export function pingSuspendedRoot( // Mark the time at which this ping was scheduled. root.lastPingedTime = suspendedTime; - if (!enableTrainModelFix && root.finishedExpirationTime === suspendedTime) { - // If there's a pending fallback waiting to commit, throw it away. - root.finishedExpirationTime = NoWork; - root.finishedWork = null; - } - ensureRootIsScheduled(root); schedulePendingInteractions(root, suspendedTime); } diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 784accd974c29..db731ebe97dd6 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -81,8 +81,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; - export const enableTrustedTypesIntegration = false; // Flag to turn event.target and event.currentTarget in ReactNative from a reactTag to a component instance diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 2a6d0c93962be..dd6c0fea3ee2c 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -41,7 +41,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const disableTextareaChildren = false; export const disableMapsAsChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index 1aa8be179cb3c..e4754dbb00b95 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.persistent.js b/packages/shared/forks/ReactFeatureFlags.persistent.js index 4ec1c8ed30f8e..966f9ccc85c55 100644 --- a/packages/shared/forks/ReactFeatureFlags.persistent.js +++ b/packages/shared/forks/ReactFeatureFlags.persistent.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index c1fae8355a973..0fb4a3652f756 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index 45bb75b5b9d00..e2b46797610fa 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index 30ba2e1f35f23..8040556c580b1 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index 37d53806ff11a..c47dd5705b61a 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -35,7 +35,6 @@ export const warnAboutDefaultPropsOnFunctionComponents = false; export const warnAboutStringRefs = false; export const disableLegacyContext = __EXPERIMENTAL__; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; -export const enableTrainModelFix = true; export const enableTrustedTypesIntegration = false; export const enableNativeTargetAsInstance = false; export const disableTextareaChildren = __EXPERIMENTAL__; diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index 5ff790efe4612..2a45ce22eda95 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -43,8 +43,6 @@ export const disableLegacyContext = __EXPERIMENTAL__; export const warnAboutStringRefs = false; export const warnAboutDefaultPropsOnFunctionComponents = false; -export const enableTrainModelFix = true; - export const enableSuspenseServerRenderer = true; export const enableSelectiveHydration = true;