Skip to content

Commit a48e54f

Browse files
authored
[cleanup] remove old feature flag warnAboutDeprecatedLifecycles (#25978)
This feature flag was always set to true, we can easily clean it up.
1 parent 0f4a835 commit a48e54f

12 files changed

+7
-29
lines changed

packages/react-reconciler/src/ReactFiberClassComponent.js

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import {
2323
disableLegacyContext,
2424
enableDebugTracing,
2525
enableSchedulingProfiler,
26-
warnAboutDeprecatedLifecycles,
2726
enableLazyContextPropagation,
2827
} from 'shared/ReactFeatureFlags';
2928
import ReactStrictModeWarnings from './ReactStrictModeWarnings';
@@ -868,12 +867,10 @@ function mountClassInstance(
868867
);
869868
}
870869

871-
if (warnAboutDeprecatedLifecycles) {
872-
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
873-
workInProgress,
874-
instance,
875-
);
876-
}
870+
ReactStrictModeWarnings.recordUnsafeLifecycleWarnings(
871+
workInProgress,
872+
instance,
873+
);
877874
}
878875

879876
instance.state = workInProgress.memoizedState;

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import type {
2424
import type {OffscreenInstance} from './ReactFiberOffscreenComponent';
2525

2626
import {
27-
warnAboutDeprecatedLifecycles,
2827
replayFailedUnitOfWorkWithInvokeGuardedCallback,
2928
enableCreateEventHandleAPI,
3029
enableProfilerTimer,
@@ -3534,10 +3533,7 @@ export function throwIfInfiniteUpdateLoopDetected() {
35343533
function flushRenderPhaseStrictModeWarningsInDEV() {
35353534
if (__DEV__) {
35363535
ReactStrictModeWarnings.flushLegacyContextWarning();
3537-
3538-
if (warnAboutDeprecatedLifecycles) {
3539-
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
3540-
}
3536+
ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings();
35413537
}
35423538
}
35433539

packages/react-server/src/ReactFizzClassComponent.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
import {emptyContextObject} from './ReactFizzContext';
1111
import {readContext} from './ReactFizzNewContext';
1212

13-
import {
14-
disableLegacyContext,
15-
warnAboutDeprecatedLifecycles,
16-
} from 'shared/ReactFeatureFlags';
13+
import {disableLegacyContext} from 'shared/ReactFeatureFlags';
1714
import {get as getInstance, set as setInstance} from 'shared/ReactInstanceMap';
1815
import getComponentNameFromType from 'shared/getComponentNameFromType';
1916
import {REACT_CONTEXT_TYPE, REACT_PROVIDER_TYPE} from 'shared/ReactSymbols';
@@ -539,10 +536,7 @@ function callComponentWillMount(type: any, instance: any) {
539536

540537
if (typeof instance.componentWillMount === 'function') {
541538
if (__DEV__) {
542-
if (
543-
warnAboutDeprecatedLifecycles &&
544-
instance.componentWillMount.__suppressDeprecationWarning !== true
545-
) {
539+
if (instance.componentWillMount.__suppressDeprecationWarning !== true) {
546540
const componentName = getComponentNameFromType(type) || 'Unknown';
547541

548542
if (!didWarnAboutDeprecatedWillMount[componentName]) {

packages/shared/ReactFeatureFlags.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
// Flags that can likely be deleted or landed without consequences
1414
// -----------------------------------------------------------------------------
1515

16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const enableComponentStackLocations = true;
1817
export const disableSchedulerTimeoutBasedOnReactExpirationTime = false;
1918

packages/shared/forks/ReactFeatureFlags.native-fb.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const disableJavaScriptURLs = false;
3737
export const disableCommentsAsDOMContainers = true;
3838
export const disableInputAttributeSyncing = false;
3939
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
40-
export const warnAboutDeprecatedLifecycles = true;
4140
export const enableScopeAPI = false;
4241
export const enableCreateEventHandleAPI = false;
4342
export const enableSuspenseCallback = false;

packages/shared/forks/ReactFeatureFlags.native-oss.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = false;
1616
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__;
17-
export const warnAboutDeprecatedLifecycles = true;
1817
export const enableProfilerTimer = __PROFILE__;
1918
export const enableProfilerCommitHooks = __PROFILE__;
2019
export const enableProfilerNestedUpdatePhase = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.test-renderer.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
1313
export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = false;
16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
1817
export const enableProfilerTimer = __PROFILE__;
1918
export const enableProfilerCommitHooks = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.test-renderer.native.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer';
1313
export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = false;
16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
1817
export const enableProfilerTimer = __PROFILE__;
1918
export const enableProfilerCommitHooks = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.test-renderer.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.test-renderer.www';
1313
export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = false;
16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
1817
export const enableProfilerTimer = __PROFILE__;
1918
export const enableProfilerCommitHooks = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.testing.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.testing';
1313
export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = __PROFILE__;
16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
1817
export const enableProfilerTimer = __PROFILE__;
1918
export const enableProfilerCommitHooks = __PROFILE__;

packages/shared/forks/ReactFeatureFlags.testing.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import typeof * as ExportsType from './ReactFeatureFlags.testing.www';
1313
export const debugRenderPhaseSideEffectsForStrictMode = false;
1414
export const enableDebugTracing = false;
1515
export const enableSchedulingProfiler = false;
16-
export const warnAboutDeprecatedLifecycles = true;
1716
export const replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
1817
export const enableProfilerTimer = false;
1918
export const enableProfilerCommitHooks = false;

packages/shared/forks/ReactFeatureFlags.www.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ export const enableSchedulingProfiler: boolean =
6565
// For now, we'll turn it on for everyone because it's *already* on for everyone in practice.
6666
// At least this will let us stop shipping <Profiler> implementation to all users.
6767
export const enableSchedulerDebugging = true;
68-
export const warnAboutDeprecatedLifecycles = true;
6968
export const disableLegacyContext = __EXPERIMENTAL__;
7069
export const warnAboutStringRefs = true;
7170
export const warnAboutDefaultPropsOnFunctionComponents = true;

0 commit comments

Comments
 (0)