@samitouri / QOS-React-2 / commits / a48e54f2b7

[cleanup] remove old feature flag warnAboutDeprecatedLifecycles (#25978)

This feature flag was always set to true, we can easily clean it up.

Jan Kassens committed Jan 10, 2023 at 15:30 UTC a48e54f2b74d87d90b0a3bff3a9b52fd9188308b
12 files changed +7 -29
packages/react-reconciler/src/ReactFiberClassComponent.js
+4 -7
@@ -23,7 +23,6 @@ import {
23 disableLegacyContext,
24 enableDebugTracing,
25 enableSchedulingProfiler,
26 - warnAboutDeprecatedLifecycles,
26 enableLazyContextPropagation,
27 } from 'shared/ReactFeatureFlags';
28 import ReactStrictModeWarnings from './ReactStrictModeWarnings';
@@ -868,12 +867,10 @@ function mountClassInstance(
867 );
868 }
869
871 - if (warnAboutDeprecatedLifecycles) {
872 - ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
873 - workInProgress,
874 - instance,
875 - );
876 - }
870 + ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
871 + workInProgress,
872 + instance,
873 + );
874 }
875
876 instance.state = workInProgress.memoizedState;
packages/react-reconciler/src/ReactFiberWorkLoop.js
+1 -5
@@ -24,7 +24,6 @@ import type {
24 import type {OffscreenInstance} from './ReactFiberOffscreenComponent';
25
26 import {
27 - warnAboutDeprecatedLifecycles,
27 replayFailedUnitOfWorkWithInvokeGuardedCallback,
28 enableCreateEventHandleAPI,
29 enableProfilerTimer,
@@ -3534,10 +3533,7 @@ export function throwIfInfiniteUpdateLoopDetected() {
3533 function flushRenderPhaseStrictModeWarningsInDEV() {
3534 if (__DEV__) {
3535 ReactStrictModeWarnings.flushLegacyContextWarning();
3537 -
3538 - if (warnAboutDeprecatedLifecycles) {
3539 - ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
3540 - }
3536 + ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
3537 }
3538 }
3539
packages/react-server/src/ReactFizzClassComponent.js
+2 -8
@@ -10,10 +10,7 @@
10 import {emptyContextObject} from './ReactFizzContext';
11 import {readContext} from './ReactFizzNewContext';
12
13 -import {
14 - disableLegacyContext,
15 - warnAboutDeprecatedLifecycles,
16 -} from 'shared/ReactFeatureFlags';
13 +import {disableLegacyContext} from 'shared/ReactFeatureFlags';
14 import {get as getInstance, set as setInstance} from 'shared/ReactInstanceMap';
15 import getComponentNameFromType from 'shared/getComponentNameFromType';
16 import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols';
@@ -539,10 +536,7 @@ function callComponentWillMount(type: any, instance: any) {
536
537 if (typeof instance.componentWillMount === 'function') {
538 if (__DEV__) {
542 - if (
543 - warnAboutDeprecatedLifecycles &&
544 - instance.componentWillMount.__suppressDeprecationWarning !== true
545 - ) {
539 + if (instance.componentWillMount.__suppressDeprecationWarning !== true) {
540 const componentName = getComponentNameFromType(type) || 'Unknown';
541
542 if (!didWarnAboutDeprecatedWillMount[componentName]) {
packages/shared/ReactFeatureFlags.js
-1
@@ -13,7 +13,6 @@
13 // Flags that can likely be deleted or landed without consequences
14 // -----------------------------------------------------------------------------
15
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const enableComponentStackLocations = true;
17 export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
18
packages/shared/forks/ReactFeatureFlags.native-fb.js
-1
@@ -37,7 +37,6 @@ export const disableJavaScriptURLs = false;
37 export const disableCommentsAsDOMContainers = true;
38 export const disableInputAttributeSyncing = false;
39 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
40 -export const warnAboutDeprecatedLifecycles = true;
40 export const enableScopeAPI = false;
41 export const enableCreateEventHandleAPI = false;
42 export const enableSuspenseCallback = false;
packages/shared/forks/ReactFeatureFlags.native-oss.js
-1
@@ -14,7 +14,6 @@ export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = false;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
17 -export const warnAboutDeprecatedLifecycles = true;
17 export const enableProfilerTimer = __PROFILE__;
18 export const enableProfilerCommitHooks = __PROFILE__;
19 export const enableProfilerNestedUpdatePhase = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
-1
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
13 export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = false;
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
17 export const enableProfilerTimer = __PROFILE__;
18 export const enableProfilerCommitHooks = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.test-renderer.native.js
-1
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
13 export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = false;
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
17 export const enableProfilerTimer = __PROFILE__;
18 export const enableProfilerCommitHooks = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
-1
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer.www';
13 export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = false;
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
17 export const enableProfilerTimer = __PROFILE__;
18 export const enableProfilerCommitHooks = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.testing.js
-1
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.testing';
13 export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = __PROFILE__;
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
17 export const enableProfilerTimer = __PROFILE__;
18 export const enableProfilerCommitHooks = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.testing.www.js
-1
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.testing.www';
13 export const debugRenderPhaseSideEffectsForStrictMode = false;
14 export const enableDebugTracing = false;
15 export const enableSchedulingProfiler = false;
16 -export const warnAboutDeprecatedLifecycles = true;
16 export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
17 export const enableProfilerTimer = false;
18 export const enableProfilerCommitHooks = false;
packages/shared/forks/ReactFeatureFlags.www.js
-1
@@ -65,7 +65,6 @@ export const enableSchedulingProfiler: boolean =
65 // For now, we'll turn it on for everyone because it's *already* on for everyone in practice.
66 // At least this will let us stop shipping <Profiler> implementation to all users.
67 export const enableSchedulerDebugging = true;
68 -export const warnAboutDeprecatedLifecycles = true;
68 export const disableLegacyContext = __EXPERIMENTAL__;
69 export const warnAboutStringRefs = true;
70 export const warnAboutDefaultPropsOnFunctionComponents = true;