[crud] Add enableUseResourceEffectHook flag (#31556)
Adds a new feature flag for `enableUseResourceEffectHook`. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/31556). * #31523 * #31557 * __->__ #31556 * #31555
lauren committed
Nov 15, 2024 at 17:49 UTC
7dd6b9e68abed4f37a2dafb649294dafdfd26b63
9 files changed
+16
packages/shared/ReactFeatureFlags.js
+5
@@ -161,6 +161,11 @@ export const transitionLaneExpirationMs = 5000;
161
*/
162
export const enableInfiniteRenderLoopDetection = false;
163
164
+/**
165
+ * Experimental new hook for better managing resources in effects.
166
+ */
167
+export const enableUseResourceEffectHook = false;
168
+
169
// -----------------------------------------------------------------------------
170
// Ready for next major.
171
//
packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
+1
@@ -25,3 +25,4 @@ export const enableShallowPropDiffing = __VARIANT__;
25
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
26
export const enableFabricCompleteRootInCommitPhase = __VARIANT__;
27
export const enableSiblingPrerendering = __VARIANT__;
28
+export const enableUseResourceEffectHook = __VARIANT__;
packages/shared/forks/ReactFeatureFlags.native-fb.js
+1
@@ -25,6 +25,7 @@ export const {
25
enableObjectFiber,
26
enablePersistedModeClonedFlag,
27
enableShallowPropDiffing,
28
+ enableUseResourceEffectHook,
29
passChildrenWhenCloningPersistedNodes,
30
enableSiblingPrerendering,
31
} = dynamicFlags;
packages/shared/forks/ReactFeatureFlags.native-oss.js
+1
@@ -84,6 +84,7 @@ export const syncLaneExpirationMs = 250;
84
export const transitionLaneExpirationMs = 5000;
85
export const useModernStrictMode = true;
86
export const enableSiblingPrerendering = true;
87
+export const enableUseResourceEffectHook = false;
88
89
// Profiling Only
90
export const enableProfilerTimer = __PROFILE__;
packages/shared/forks/ReactFeatureFlags.test-renderer.js
+2
@@ -83,6 +83,8 @@ export const renameElementSymbol = true;
83
export const enableShallowPropDiffing = false;
84
export const enableSiblingPrerendering = true;
85
86
+export const enableUseResourceEffectHook = false;
87
+
88
// TODO: This must be in sync with the main ReactFeatureFlags file because
89
// the Test Renderer's value must be the same as the one used by the
90
// react package.
packages/shared/forks/ReactFeatureFlags.test-renderer.native-fb.js
+1
@@ -80,6 +80,7 @@ export const transitionLaneExpirationMs = 5000;
80
export const useModernStrictMode = true;
81
export const enableFabricCompleteRootInCommitPhase = false;
82
export const enableSiblingPrerendering = true;
83
+export const enableUseResourceEffectHook = false;
84
85
// Flow magic to verify the exports of this file match the original version.
86
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
packages/shared/forks/ReactFeatureFlags.test-renderer.www.js
+2
@@ -94,5 +94,7 @@ export const enableOwnerStacks = false;
94
export const enableShallowPropDiffing = false;
95
export const enableSiblingPrerendering = true;
96
97
+export const enableUseResourceEffectHook = false;
98
+
99
// Flow magic to verify the exports of this file match the original version.
100
((((null: any): ExportsType): FeatureFlagsType): ExportsType);
packages/shared/forks/ReactFeatureFlags.www-dynamic.js
+2
@@ -42,6 +42,8 @@ export const enableSchedulingProfiler = __VARIANT__;
42
export const enableInfiniteRenderLoopDetection = __VARIANT__;
43
export const enableSiblingPrerendering = __VARIANT__;
44
45
+export const enableUseResourceEffectHook = __VARIANT__;
46
+
47
// TODO: These flags are hard-coded to the default values used in open source.
48
// Update the tests so that they pass in either mode, then set these
49
// to __VARIANT__.
packages/shared/forks/ReactFeatureFlags.www.js
+1
@@ -31,6 +31,7 @@ export const {
31
enableSiblingPrerendering,
32
enableTransitionTracing,
33
enableTrustedTypesIntegration,
34
+ enableUseResourceEffectHook,
35
favorSafetyOverHydrationPerf,
36
renameElementSymbol,
37
retryLaneExpirationMs,