Skip to content

Commit

Permalink
RN: Enable enableAnimatedAllowlist and enableAnimatedPropsMemo (#…
Browse files Browse the repository at this point in the history
…47502)

Summary:
Pull Request resolved: #47502

Enables the two following feature flags:

- `enableAnimatedAllowlist`
- `enableAnimatedPropsMemo`

The former enables the use of an experimental optimization to provide `unstable_createAnimatedComponentWithAllowlist` and `useAnimatedProps` an allowlist of props that reduces the set of props iterated over by to find props with `AnimatedNode` (e.g. `Animated.Value`) instance values.

The latter enables improved memoization logic in `Animated` so that its intenal state is invalidated less frequently, reducing the cost of updating `Animated` components.

Changelog:
[General][Changed] - Optimized the performance of updating `Animated` components.

Reviewed By: rozele

Differential Revision: D65645985

fbshipit-source-id: 85f9e53072f09a59589d76d0c096f4cedd17bb4b
  • Loading branch information
yungsters authored and facebook-github-bot committed Nov 8, 2024
1 parent cbab004 commit f0ffcd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,11 @@ const definitions: FeatureFlagDefinitions = {
},
},
enableAnimatedAllowlist: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2024-09-10',
description:
'Enables Animated to skip non-allowlisted props and styles.',
purpose: 'experimentation',
purpose: 'release',
},
},
enableAnimatedClearImmediateFix: {
Expand All @@ -537,12 +536,11 @@ const definitions: FeatureFlagDefinitions = {
},
},
enableAnimatedPropsMemo: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2024-09-11',
description:
'Enables Animated to analyze props to minimize invalidating `AnimatedProps`.',
purpose: 'experimentation',
purpose: 'release',
},
},
enableOptimisedVirtualizedCells: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated SignedSource<<141c9d17083660b8726d2780813168dd>>
* @generated SignedSource<<650ba11a0ac49b9779c6c98f57f7369f>>
* @flow strict
*/

Expand Down Expand Up @@ -132,7 +132,7 @@ export const enableAccessToHostTreeInFabric: Getter<boolean> = createJavaScriptF
/**
* Enables Animated to skip non-allowlisted props and styles.
*/
export const enableAnimatedAllowlist: Getter<boolean> = createJavaScriptFlagGetter('enableAnimatedAllowlist', false);
export const enableAnimatedAllowlist: Getter<boolean> = createJavaScriptFlagGetter('enableAnimatedAllowlist', true);

/**
* Enables an experimental to use the proper clearIntermediate instead of calling the wrong clearTimeout and canceling another timer.
Expand All @@ -142,7 +142,7 @@ export const enableAnimatedClearImmediateFix: Getter<boolean> = createJavaScript
/**
* Enables Animated to analyze props to minimize invalidating `AnimatedProps`.
*/
export const enableAnimatedPropsMemo: Getter<boolean> = createJavaScriptFlagGetter('enableAnimatedPropsMemo', false);
export const enableAnimatedPropsMemo: Getter<boolean> = createJavaScriptFlagGetter('enableAnimatedPropsMemo', true);

/**
* Removing unnecessary rerenders Virtualized cells after any rerenders of Virualized list. Works with strict=true option
Expand Down

0 comments on commit f0ffcd4

Please sign in to comment.