[flags] Remove enableModernStrictMode (#31838)

This is enabled everywhere.
This commit is contained in:
Ricky
2024-12-18 14:45:37 -05:00
committed by GitHub
parent e1d843f4d8
commit 74dd2da9ac
11 changed files with 21 additions and 44 deletions
+1 -2
View File
@@ -32,7 +32,6 @@ import {
enableSchedulingProfiler,
enableUpdaterTracking,
enableTransitionTracing,
useModernStrictMode,
disableLegacyContext,
alwaysThrottleRetries,
enableInfiniteRenderLoopDetection,
@@ -4205,7 +4204,7 @@ function commitDoubleInvokeEffectsInDEV(
hasPassiveEffects: boolean,
) {
if (__DEV__) {
if (useModernStrictMode && (disableLegacyMode || root.tag !== LegacyRoot)) {
if (disableLegacyMode || root.tag !== LegacyRoot) {
let doubleInvokeEffects = true;
if (
@@ -77,7 +77,7 @@ describe('Activity StrictMode', () => {
]);
});
// @gate __DEV__ && enableActivity && useModernStrictMode
// @gate __DEV__ && enableActivity
it('should not trigger strict effects when offscreen is hidden', async () => {
await act(() => {
ReactNoop.render(
@@ -945,34 +945,25 @@ describe('StrictEffectsMode', () => {
shouldSuspend = false;
});
if (gate(flags => flags.useModernStrictMode)) {
expect(log).toEqual([
'Child rendered',
'Child rendered',
// !!! Committed, destroy and create effect.
// !!! The other effect is not destroyed and created
// !!! because the dep didn't change
'Child dep destroy',
'Child dep create',
expect(log).toEqual([
'Child rendered',
'Child rendered',
// !!! Committed, destroy and create effect.
// !!! The other effect is not destroyed and created
// !!! because the dep didn't change
'Child dep destroy',
'Child dep create',
// Double invoke both effects
'Child destroy',
'Child dep destroy',
'Child create',
'Child dep create',
// Fires setState
'-----------------------after setState',
'Child rendered',
'Child rendered',
'Child dep create',
]);
} else {
expect(log).toEqual([
'Child rendered',
'Child rendered',
'Child dep destroy',
'Child dep create',
]);
}
// Double invoke both effects
'Child destroy',
'Child dep destroy',
'Child create',
'Child dep create',
// Fires setState
'-----------------------after setState',
'Child rendered',
'Child rendered',
'Child dep create',
]);
});
});
@@ -461,7 +461,6 @@ describe('StrictEffectsMode defaults', () => {
expect(log).toEqual([]);
});
//@gate useModernStrictMode
it('disconnects refs during double invoking', async () => {
const onRefMock = jest.fn();
function App({text}) {
-6
View File
@@ -186,12 +186,6 @@ export const disableLegacyContext = true;
*/
export const disableLegacyContextForFunctionComponents = true;
// Not ready to break experimental yet.
// Modern <StrictMode /> behaviour aligns more with what components
// components will encounter in production, especially when used With <Offscreen />.
// TODO: clean up legacy <StrictMode /> once tests pass WWW.
export const useModernStrictMode = true;
// Enable the moveBefore() alternative to insertBefore(). This preserves states of moves.
export const enableMoveBefore = false;
@@ -80,7 +80,6 @@ export const renameElementSymbol = false;
export const retryLaneExpirationMs = 5000;
export const syncLaneExpirationMs = 250;
export const transitionLaneExpirationMs = 5000;
export const useModernStrictMode = true;
export const enableHydrationLaneScheduling = true;
export const enableYieldingBeforePassive = false;
@@ -70,7 +70,6 @@ export const renameElementSymbol = true;
export const retryLaneExpirationMs = 5000;
export const syncLaneExpirationMs = 250;
export const transitionLaneExpirationMs = 5000;
export const useModernStrictMode = true;
export const enableSiblingPrerendering = true;
export const enableUseResourceEffectHook = false;
@@ -52,7 +52,6 @@ export const enableLegacyHidden = false;
export const enableTransitionTracing = false;
export const useModernStrictMode = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFizzExternalRuntime = true;
export const enableDeferRootSchedulingToMicrotask = true;
@@ -65,7 +65,6 @@ export const renameElementSymbol = false;
export const retryLaneExpirationMs = 5000;
export const syncLaneExpirationMs = 250;
export const transitionLaneExpirationMs = 5000;
export const useModernStrictMode = true;
export const enableFabricCompleteRootInCommitPhase = false;
export const enableSiblingPrerendering = true;
export const enableUseResourceEffectHook = true;
@@ -54,7 +54,6 @@ export const enableLegacyHidden = false;
export const enableTransitionTracing = false;
export const useModernStrictMode = true;
export const enableDO_NOT_USE_disableStrictPassiveEffect = false;
export const enableFizzExternalRuntime = false;
export const enableDeferRootSchedulingToMicrotask = true;
@@ -106,7 +106,6 @@ export const disableClientCache = true;
export const enableServerComponentLogs = true;
export const enableReactTestRendererWarning = false;
export const useModernStrictMode = true;
export const disableLegacyMode = true;