Skip to content

Commit

Permalink
Setup Wave 2 of Feature Flags for React Native (#28990)
Browse files Browse the repository at this point in the history
## Summary

Sets up dynamic feature flags for `disableStringRefs`, `enableFastJSX`,
and `enableRefAsProp` in React Native (at Meta).

## How did you test this change?

```
$ yarn test
$ yarn flow fabric
```
  • Loading branch information
yungsters authored May 6, 2024
1 parent 5d29478 commit 9b13002
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
9 changes: 6 additions & 3 deletions packages/shared/forks/ReactFeatureFlags.native-fb-dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@

export const alwaysThrottleRetries = __VARIANT__;
export const consoleManagedByDevToolsDuringStrictMode = __VARIANT__;
export const enableEarlyReturnForPropDiffing = __VARIANT__;
export const disableDefaultPropsExceptForClasses = __VARIANT__;
export const disableStringRefs = __VARIANT__;
export const enableAddPropertiesFastPath = __VARIANT__;
export const enableDeferRootSchedulingToMicrotask = __VARIANT__;
export const enableEarlyReturnForPropDiffing = __VARIANT__;
export const enableFastJSX = __VARIANT__;
export const enableInfiniteRenderLoopDetection = __VARIANT__;
export const enableRefAsProp = __VARIANT__;
export const enableUnifiedSyncLane = __VARIANT__;
export const passChildrenWhenCloningPersistedNodes = __VARIANT__;
export const disableDefaultPropsExceptForClasses = __VARIANT__;
export const enableAddPropertiesFastPath = __VARIANT__;
15 changes: 6 additions & 9 deletions packages/shared/forks/ReactFeatureFlags.native-fb.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ const dynamicFlags: DynamicExportsType = (dynamicFlagsUntyped: any);
export const {
alwaysThrottleRetries,
consoleManagedByDevToolsDuringStrictMode,
enableEarlyReturnForPropDiffing,
disableDefaultPropsExceptForClasses,
disableStringRefs,
enableAddPropertiesFastPath,
enableDeferRootSchedulingToMicrotask,
enableEarlyReturnForPropDiffing,
enableFastJSX,
enableInfiniteRenderLoopDetection,
enableRefAsProp,
enableUnifiedSyncLane,
passChildrenWhenCloningPersistedNodes,
disableDefaultPropsExceptForClasses,
enableAddPropertiesFastPath,
} = dynamicFlags;

// The rest of the flags are static for better dead code elimination.
Expand Down Expand Up @@ -94,12 +97,6 @@ export const disableClientCache = true;
export const enableServerComponentKeys = true;
export const enableServerComponentLogs = true;

// TODO: Roll out with GK. Don't keep as dynamic flag for too long, though,
// because JSX is an extremely hot path.
export const enableRefAsProp = false;
export const disableStringRefs = false;
export const enableFastJSX = false;

export const enableReactTestRendererWarning = false;
export const disableLegacyMode = false;
export const disableDOMTestUtils = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ export const disableClientCache = true;
export const enableServerComponentKeys = true;
export const enableServerComponentLogs = true;

export const enableRefAsProp = false;
export const disableStringRefs = false;
export const enableFastJSX = false;
export const enableRefAsProp = true;
export const disableStringRefs = true;
export const enableFastJSX = true;

export const enableReactTestRendererWarning = false;
export const disableLegacyMode = false;
Expand Down

0 comments on commit 9b13002

Please sign in to comment.