From ce6a837c0b2aedb637f91fd741b5e44ad6b5ea70 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 3 Oct 2022 15:27:11 +0100 Subject: [PATCH] Remove feature flag enableStrictEffects --- .../react-reconciler/src/ReactFiber.new.js | 11 ++------ .../react-reconciler/src/ReactFiber.old.js | 11 ++------ .../src/ReactFiberClassComponent.new.js | 25 +++---------------- .../src/ReactFiberClassComponent.old.js | 25 +++---------------- .../src/ReactFiberCommitWork.new.js | 9 +++---- .../src/ReactFiberCommitWork.old.js | 9 +++---- .../src/ReactFiberHooks.new.js | 10 +------- .../src/ReactFiberHooks.old.js | 10 +------- .../src/ReactFiberWorkLoop.new.js | 7 +++--- .../src/ReactFiberWorkLoop.old.js | 7 +++--- .../ReactOffscreenStrictMode-test.js | 6 ++--- .../src/__tests__/StrictEffectsMode-test.js | 1 - ...StrictEffectsModeDefaults-test.internal.js | 1 - .../ReactStrictMode-test.internal.js | 3 --- packages/shared/ReactFeatureFlags.js | 4 --- .../forks/ReactFeatureFlags.native-fb.js | 1 - .../forks/ReactFeatureFlags.native-oss.js | 1 - .../forks/ReactFeatureFlags.test-renderer.js | 1 - .../ReactFeatureFlags.test-renderer.native.js | 1 - .../ReactFeatureFlags.test-renderer.www.js | 1 - .../shared/forks/ReactFeatureFlags.testing.js | 1 - .../forks/ReactFeatureFlags.testing.www.js | 1 - .../forks/ReactFeatureFlags.www-dynamic.js | 1 - .../shared/forks/ReactFeatureFlags.www.js | 2 -- 24 files changed, 31 insertions(+), 118 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiber.new.js b/packages/react-reconciler/src/ReactFiber.new.js index 18a3bf721b33c..a36f2b5179d4e 100644 --- a/packages/react-reconciler/src/ReactFiber.new.js +++ b/packages/react-reconciler/src/ReactFiber.new.js @@ -25,7 +25,6 @@ import {supportsResources, isHostResourceType} from './ReactFiberHostConfig'; import { createRootStrictEffectsByDefault, enableCache, - enableStrictEffects, enableProfilerTimer, enableScopeAPI, enableLegacyHidden, @@ -442,13 +441,7 @@ export function createHostRootFiber( let mode; if (tag === ConcurrentRoot) { mode = ConcurrentMode; - if (isStrictMode === true) { - mode |= StrictLegacyMode; - - if (enableStrictEffects) { - mode |= StrictEffectsMode; - } - } else if (enableStrictEffects && createRootStrictEffectsByDefault) { + if (isStrictMode === true || createRootStrictEffectsByDefault) { mode |= StrictLegacyMode | StrictEffectsMode; } if ( @@ -511,7 +504,7 @@ export function createFiberFromTypeAndProps( case REACT_STRICT_MODE_TYPE: fiberTag = Mode; mode |= StrictLegacyMode; - if (enableStrictEffects && (mode & ConcurrentMode) !== NoMode) { + if ((mode & ConcurrentMode) !== NoMode) { // Strict effects should never run on legacy roots mode |= StrictEffectsMode; } diff --git a/packages/react-reconciler/src/ReactFiber.old.js b/packages/react-reconciler/src/ReactFiber.old.js index 94e0050e8b4d6..7e0c084868e89 100644 --- a/packages/react-reconciler/src/ReactFiber.old.js +++ b/packages/react-reconciler/src/ReactFiber.old.js @@ -25,7 +25,6 @@ import {supportsResources, isHostResourceType} from './ReactFiberHostConfig'; import { createRootStrictEffectsByDefault, enableCache, - enableStrictEffects, enableProfilerTimer, enableScopeAPI, enableLegacyHidden, @@ -442,13 +441,7 @@ export function createHostRootFiber( let mode; if (tag === ConcurrentRoot) { mode = ConcurrentMode; - if (isStrictMode === true) { - mode |= StrictLegacyMode; - - if (enableStrictEffects) { - mode |= StrictEffectsMode; - } - } else if (enableStrictEffects && createRootStrictEffectsByDefault) { + if (isStrictMode === true || createRootStrictEffectsByDefault) { mode |= StrictLegacyMode | StrictEffectsMode; } if ( @@ -511,7 +504,7 @@ export function createFiberFromTypeAndProps( case REACT_STRICT_MODE_TYPE: fiberTag = Mode; mode |= StrictLegacyMode; - if (enableStrictEffects && (mode & ConcurrentMode) !== NoMode) { + if ((mode & ConcurrentMode) !== NoMode) { // Strict effects should never run on legacy roots mode |= StrictEffectsMode; } diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.new.js b/packages/react-reconciler/src/ReactFiberClassComponent.new.js index de7e7bbba77f5..408265d329673 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.new.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.new.js @@ -26,7 +26,6 @@ import { enableSchedulingProfiler, warnAboutDeprecatedLifecycles, enableLazyContextPropagation, - enableStrictEffects, } from 'shared/ReactFeatureFlags'; import ReactStrictModeWarnings from './ReactStrictModeWarnings.new'; import {isMounted} from './ReactFiberTreeReflection'; @@ -908,11 +907,7 @@ function mountClassInstance( if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -986,11 +981,7 @@ function resumeMountClassInstance( // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -1037,11 +1028,7 @@ function resumeMountClassInstance( } if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -1051,11 +1038,7 @@ function resumeMountClassInstance( // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; diff --git a/packages/react-reconciler/src/ReactFiberClassComponent.old.js b/packages/react-reconciler/src/ReactFiberClassComponent.old.js index 5625c682c68b1..c587dfe01b7f8 100644 --- a/packages/react-reconciler/src/ReactFiberClassComponent.old.js +++ b/packages/react-reconciler/src/ReactFiberClassComponent.old.js @@ -26,7 +26,6 @@ import { enableSchedulingProfiler, warnAboutDeprecatedLifecycles, enableLazyContextPropagation, - enableStrictEffects, } from 'shared/ReactFeatureFlags'; import ReactStrictModeWarnings from './ReactStrictModeWarnings.old'; import {isMounted} from './ReactFiberTreeReflection'; @@ -908,11 +907,7 @@ function mountClassInstance( if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -986,11 +981,7 @@ function resumeMountClassInstance( // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -1037,11 +1028,7 @@ function resumeMountClassInstance( } if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; @@ -1051,11 +1038,7 @@ function resumeMountClassInstance( // effect even though we're bailing out, so that cWU/cDU are called. if (typeof instance.componentDidMount === 'function') { let fiberFlags: Flags = Update | LayoutStatic; - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { fiberFlags |= MountLayoutDev; } workInProgress.flags |= fiberFlags; diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.new.js b/packages/react-reconciler/src/ReactFiberCommitWork.new.js index 71937836b59d0..efdc0025a31f4 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.new.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.new.js @@ -50,7 +50,6 @@ import { enableCache, enableTransitionTracing, enableUseEventHook, - enableStrictEffects, enableFloat, } from 'shared/ReactFeatureFlags'; import { @@ -4183,7 +4182,7 @@ function commitPassiveUnmountInsideDeletedTreeOnFiber( } function invokeLayoutEffectMountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4211,7 +4210,7 @@ function invokeLayoutEffectMountInDEV(fiber: Fiber): void { } function invokePassiveEffectMountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4230,7 +4229,7 @@ function invokePassiveEffectMountInDEV(fiber: Fiber): void { } function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4260,7 +4259,7 @@ function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { } function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { diff --git a/packages/react-reconciler/src/ReactFiberCommitWork.old.js b/packages/react-reconciler/src/ReactFiberCommitWork.old.js index f54bfe22d9652..f9fe81ccb8f8a 100644 --- a/packages/react-reconciler/src/ReactFiberCommitWork.old.js +++ b/packages/react-reconciler/src/ReactFiberCommitWork.old.js @@ -50,7 +50,6 @@ import { enableCache, enableTransitionTracing, enableUseEventHook, - enableStrictEffects, enableFloat, } from 'shared/ReactFeatureFlags'; import { @@ -4183,7 +4182,7 @@ function commitPassiveUnmountInsideDeletedTreeOnFiber( } function invokeLayoutEffectMountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4211,7 +4210,7 @@ function invokeLayoutEffectMountInDEV(fiber: Fiber): void { } function invokePassiveEffectMountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4230,7 +4229,7 @@ function invokePassiveEffectMountInDEV(fiber: Fiber): void { } function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { @@ -4260,7 +4259,7 @@ function invokeLayoutEffectUnmountInDEV(fiber: Fiber): void { } function invokePassiveEffectUnmountInDEV(fiber: Fiber): void { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { // We don't need to re-check StrictEffectsMode here. // This function is only called if that check has already passed. switch (fiber.tag) { diff --git a/packages/react-reconciler/src/ReactFiberHooks.new.js b/packages/react-reconciler/src/ReactFiberHooks.new.js index a1c8fb605fb5c..979cdd0424bbe 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.new.js +++ b/packages/react-reconciler/src/ReactFiberHooks.new.js @@ -42,7 +42,6 @@ import { enableUseHook, enableUseMemoCacheHook, enableUseEventHook, - enableStrictEffects, } from 'shared/ReactFeatureFlags'; import { REACT_CONTEXT_TYPE, @@ -600,11 +599,7 @@ export function bailoutHooks( workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { workInProgress.flags &= ~( MountPassiveDevEffect | MountLayoutDevEffect | @@ -1884,7 +1879,6 @@ function mountEffect( ): void { if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { return mountEffectImpl( @@ -1979,7 +1973,6 @@ function mountLayoutEffect( let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDevEffect; @@ -2046,7 +2039,6 @@ function mountImperativeHandle( let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDevEffect; diff --git a/packages/react-reconciler/src/ReactFiberHooks.old.js b/packages/react-reconciler/src/ReactFiberHooks.old.js index d536ab25fb96c..6395dca29ec0e 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.old.js +++ b/packages/react-reconciler/src/ReactFiberHooks.old.js @@ -42,7 +42,6 @@ import { enableUseHook, enableUseMemoCacheHook, enableUseEventHook, - enableStrictEffects, } from 'shared/ReactFeatureFlags'; import { REACT_CONTEXT_TYPE, @@ -600,11 +599,7 @@ export function bailoutHooks( workInProgress.updateQueue = current.updateQueue; // TODO: Don't need to reset the flags here, because they're reset in the // complete phase (bubbleProperties). - if ( - __DEV__ && - enableStrictEffects && - (workInProgress.mode & StrictEffectsMode) !== NoMode - ) { + if (__DEV__ && (workInProgress.mode & StrictEffectsMode) !== NoMode) { workInProgress.flags &= ~( MountPassiveDevEffect | MountLayoutDevEffect | @@ -1884,7 +1879,6 @@ function mountEffect( ): void { if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { return mountEffectImpl( @@ -1979,7 +1973,6 @@ function mountLayoutEffect( let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDevEffect; @@ -2046,7 +2039,6 @@ function mountImperativeHandle( let fiberFlags: Flags = UpdateEffect | LayoutStaticEffect; if ( __DEV__ && - enableStrictEffects && (currentlyRenderingFiber.mode & StrictEffectsMode) !== NoMode ) { fiberFlags |= MountLayoutDevEffect; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js index e0add4c8db6fd..837fd6c2fb4eb 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.new.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.new.js @@ -35,7 +35,6 @@ import { enableDebugTracing, enableSchedulingProfiler, disableSchedulerTimeoutInWorkLoop, - enableStrictEffects, skipUnmountedBoundaries, enableUpdaterTracking, enableCache, @@ -2580,7 +2579,7 @@ function commitRootImpl( legacyErrorBoundariesThatAlreadyFailed = null; } - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { if (!rootDidHavePassiveEffects) { commitDoubleInvokeEffectsInDEV(root, false); } @@ -2857,7 +2856,7 @@ function flushPassiveEffectsImpl() { markPassiveEffectsStopped(); } - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { commitDoubleInvokeEffectsInDEV(root, true); } @@ -3325,7 +3324,7 @@ function commitDoubleInvokeEffectsInDEV( root: FiberRoot, hasPassiveEffects: boolean, ) { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { if (useModernStrictMode) { let doubleInvokeEffects = true; diff --git a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js index e5774487dc2cf..60896ec0b1016 100644 --- a/packages/react-reconciler/src/ReactFiberWorkLoop.old.js +++ b/packages/react-reconciler/src/ReactFiberWorkLoop.old.js @@ -35,7 +35,6 @@ import { enableDebugTracing, enableSchedulingProfiler, disableSchedulerTimeoutInWorkLoop, - enableStrictEffects, skipUnmountedBoundaries, enableUpdaterTracking, enableCache, @@ -2580,7 +2579,7 @@ function commitRootImpl( legacyErrorBoundariesThatAlreadyFailed = null; } - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { if (!rootDidHavePassiveEffects) { commitDoubleInvokeEffectsInDEV(root, false); } @@ -2857,7 +2856,7 @@ function flushPassiveEffectsImpl() { markPassiveEffectsStopped(); } - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { commitDoubleInvokeEffectsInDEV(root, true); } @@ -3325,7 +3324,7 @@ function commitDoubleInvokeEffectsInDEV( root: FiberRoot, hasPassiveEffects: boolean, ) { - if (__DEV__ && enableStrictEffects) { + if (__DEV__) { if (useModernStrictMode) { let doubleInvokeEffects = true; diff --git a/packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js b/packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js index 0771e596d9111..a3f45d8aa1ac6 100644 --- a/packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js +++ b/packages/react-reconciler/src/__tests__/ReactOffscreenStrictMode-test.js @@ -31,7 +31,7 @@ describe('ReactOffscreenStrictMode', () => { return label; } - // @gate __DEV__ && enableStrictEffects && enableOffscreen + // @gate __DEV__ && enableOffscreen it('should trigger strict effects when offscreen is visible', () => { act(() => { ReactNoop.render( @@ -55,7 +55,7 @@ describe('ReactOffscreenStrictMode', () => { ]); }); - // @gate __DEV__ && enableStrictEffects && enableOffscreen && useModernStrictMode + // @gate __DEV__ && enableOffscreen && useModernStrictMode it('should not trigger strict effects when offscreen is hidden', () => { act(() => { ReactNoop.render( @@ -154,7 +154,7 @@ describe('ReactOffscreenStrictMode', () => { }); }); - // @gate __DEV__ && enableStrictEffects && enableOffscreen + // @gate __DEV__ && enableOffscreen it('should double invoke effects on unsuspended child', async () => { let shouldSuspend = true; let resolve; diff --git a/packages/react-reconciler/src/__tests__/StrictEffectsMode-test.js b/packages/react-reconciler/src/__tests__/StrictEffectsMode-test.js index a6210a82e3569..2225cb8574e0a 100644 --- a/packages/react-reconciler/src/__tests__/StrictEffectsMode-test.js +++ b/packages/react-reconciler/src/__tests__/StrictEffectsMode-test.js @@ -27,7 +27,6 @@ describe('StrictEffectsMode', () => { return gate( flags => flags.build === 'development' && - flags.enableStrictEffects && flags.createRootStrictEffectsByDefault && flags.dfsEffectsRefactor, ); diff --git a/packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js b/packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js index 3090fcc99138d..85900d40cefbe 100644 --- a/packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js +++ b/packages/react-reconciler/src/__tests__/StrictEffectsModeDefaults-test.internal.js @@ -24,7 +24,6 @@ describe('StrictEffectsMode defaults', () => { act = require('jest-react').act; const ReactFeatureFlags = require('shared/ReactFeatureFlags'); - ReactFeatureFlags.enableStrictEffects = __DEV__; ReactFeatureFlags.createRootStrictEffectsByDefault = __DEV__; }); diff --git a/packages/react/src/__tests__/ReactStrictMode-test.internal.js b/packages/react/src/__tests__/ReactStrictMode-test.internal.js index 18f5a4a3caa4c..f59db723ce139 100644 --- a/packages/react/src/__tests__/ReactStrictMode-test.internal.js +++ b/packages/react/src/__tests__/ReactStrictMode-test.internal.js @@ -20,9 +20,6 @@ describe('ReactStrictMode', () => { ReactDOMClient = require('react-dom/client'); act = require('jest-react').act; - - const ReactFeatureFlags = require('shared/ReactFeatureFlags'); - ReactFeatureFlags.enableStrictEffects = __DEV__; }); describe('levels', () => { diff --git a/packages/shared/ReactFeatureFlags.js b/packages/shared/ReactFeatureFlags.js index 67a9ac2014d6e..05e3ffe21b9d4 100644 --- a/packages/shared/ReactFeatureFlags.js +++ b/packages/shared/ReactFeatureFlags.js @@ -223,10 +223,6 @@ export const enableSchedulingProfiler = __PROFILE__; // reducers by double invoking them in StrictLegacyMode. export const debugRenderPhaseSideEffectsForStrictMode = __DEV__; -// Helps identify code that is not safe for planned Offscreen API and Suspense semantics; -// this feature flag only impacts StrictEffectsMode. -export const enableStrictEffects = __DEV__; - // To preserve the "Pause on caught exceptions" behavior of the debugger, we // replay the begin phase of a failed component inside invokeGuardedCallback. export const replayFailedUnitOfWorkWithInvokeGuardedCallback = __DEV__; diff --git a/packages/shared/forks/ReactFeatureFlags.native-fb.js b/packages/shared/forks/ReactFeatureFlags.native-fb.js index 821f947415dcd..d994608500b4a 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-fb.js +++ b/packages/shared/forks/ReactFeatureFlags.native-fb.js @@ -65,7 +65,6 @@ export const enableGetInspectorDataForInstanceInProduction = true; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = __DEV__; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.native-oss.js b/packages/shared/forks/ReactFeatureFlags.native-oss.js index c63c2187005ae..5cf092e6c9e05 100644 --- a/packages/shared/forks/ReactFeatureFlags.native-oss.js +++ b/packages/shared/forks/ReactFeatureFlags.native-oss.js @@ -55,7 +55,6 @@ export const enableGetInspectorDataForInstanceInProduction = false; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = false; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.js index 665c42cb8f84d..c9b3d160fb2ca 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.js @@ -55,7 +55,6 @@ export const enableGetInspectorDataForInstanceInProduction = false; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = false; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js index c48df6576ef6b..bea7b20b940b2 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.native.js @@ -54,7 +54,6 @@ export const enableUseMemoCacheHook = false; export const enableUseEventHook = false; export const enableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay = true; export const enableClientRenderFallbackOnTextMismatch = true; -export const enableStrictEffects = false; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js index d4e135d655a05..798229ce5acdf 100644 --- a/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js +++ b/packages/shared/forks/ReactFeatureFlags.test-renderer.www.js @@ -55,7 +55,6 @@ export const enableGetInspectorDataForInstanceInProduction = false; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = true; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.js b/packages/shared/forks/ReactFeatureFlags.testing.js index f77ed6fa13620..ee4e15b72204f 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.js @@ -55,7 +55,6 @@ export const enableGetInspectorDataForInstanceInProduction = false; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = false; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.testing.www.js b/packages/shared/forks/ReactFeatureFlags.testing.www.js index 1c78538140e1b..01e37c27b20e2 100644 --- a/packages/shared/forks/ReactFeatureFlags.testing.www.js +++ b/packages/shared/forks/ReactFeatureFlags.testing.www.js @@ -55,7 +55,6 @@ export const enableGetInspectorDataForInstanceInProduction = false; export const enableNewReconciler = false; export const deferRenderPhaseUpdateToNextBatch = false; -export const enableStrictEffects = false; export const createRootStrictEffectsByDefault = false; export const enableUseRefAccessWarning = false; diff --git a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js index 67812e36dae55..3c86451c60227 100644 --- a/packages/shared/forks/ReactFeatureFlags.www-dynamic.js +++ b/packages/shared/forks/ReactFeatureFlags.www-dynamic.js @@ -57,7 +57,6 @@ export const enableTrustedTypesIntegration = false; export const disableSchedulerTimeoutBasedOnReactExpirationTime = false; export const disableNativeComponentFrames = false; export const createRootStrictEffectsByDefault = false; -export const enableStrictEffects = false; export const allowConcurrentByDefault = true; export const enableFloat = false; // You probably *don't* want to add more hardcoded ones. diff --git a/packages/shared/forks/ReactFeatureFlags.www.js b/packages/shared/forks/ReactFeatureFlags.www.js index f8566f9ecb2bd..351e95b0fa662 100644 --- a/packages/shared/forks/ReactFeatureFlags.www.js +++ b/packages/shared/forks/ReactFeatureFlags.www.js @@ -39,8 +39,6 @@ export const { // On WWW, __EXPERIMENTAL__ is used for a new modern build. // It's not used anywhere in production yet. -export const enableStrictEffects: boolean = - __DEV__ && dynamicFeatureFlags.enableStrictEffects; export const debugRenderPhaseSideEffectsForStrictMode = __DEV__; export const enableProfilerTimer = __PROFILE__; export const enableProfilerCommitHooks = __PROFILE__;