Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSS feature flag updates #21597

Merged
merged 3 commits into from
Jun 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/shared/ReactFeatureFlags.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ 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 = false;
export const enableStrictEffects = __DEV__;

// If TRUE, trees rendered with createRoot will be StrictEffectsMode.
// If FALSE, these trees will be StrictLegacyMode.
Expand Down Expand Up @@ -128,7 +128,7 @@ export const deletedTreeCleanUpLevel = 1;
// Destroy layout effects for components that are hidden because something suspended in an update
// and recreate them when they are shown again (after the suspended boundary has resolved).
// Note that this should be an uncommon use case and can be avoided by using the transition API.
export const enableSuspenseLayoutEffectSemantics = false;
export const enableSuspenseLayoutEffectSemantics = true;

// --------------------------
// Future APIs to be deprecated
Expand Down
3 changes: 2 additions & 1 deletion packages/shared/forks/ReactFeatureFlags.www.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const {
deferRenderPhaseUpdateToNextBatch,
enableDebugTracing,
skipUnmountedBoundaries,
enableStrictEffects,
createRootStrictEffectsByDefault,
enableSuspenseLayoutEffectSemantics,
enableUseRefAccessWarning,
Expand All @@ -39,6 +38,8 @@ export const {
// On WWW, __EXPERIMENTAL__ is used for a new modern build.
// It's not used anywhere in production yet.

export const enableStrictEffects =
__DEV__ && dynamicFeatureFlags.enableStrictEffects;
Copy link
Collaborator

@sebmarkbage sebmarkbage Jun 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In theory these __DEV__ flags shouldn't be needed since every usage of this flag should also be wrapped in __DEV__. Otherwise, when we remove the flag, we might have missed to wrap it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, they are wrapped.

This change is a follow up to this thread/suggestion:
#21590 (comment)

export const debugRenderPhaseSideEffectsForStrictMode = __DEV__;
export const enableProfilerTimer = __PROFILE__;
export const enableProfilerCommitHooks = __PROFILE__;
Expand Down