From a2db0ba9c454e33f115fd681b039b9648ba6d797 Mon Sep 17 00:00:00 2001 From: Jorge Cabiedes Acosta Date: Thu, 12 Dec 2024 13:55:35 -0800 Subject: [PATCH] Add `expectedReleaseValue` to RN Feature Flags (#48073) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48073 Small change so we can know what the final value of the feature flag will be Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D64077789 fbshipit-source-id: 2a9e2c7ceeb18813b4556f92db547697bba966a5 --- .../ReactNativeFeatureFlags.config.js | 65 +++++++++++++++++++ .../scripts/featureflags/types.js | 2 + 2 files changed, 67 insertions(+) diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 59267744fc5..068c51f119f 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -27,6 +27,7 @@ const testDefinitions: FeatureFlagDefinitions = { defaultValue: false, metadata: { description: 'Common flag for testing. Do NOT modify.', + expectedReleaseValue: true, purpose: 'operational', }, }, @@ -35,6 +36,7 @@ const testDefinitions: FeatureFlagDefinitions = { metadata: { description: 'Common flag for testing (without native implementation). Do NOT modify.', + expectedReleaseValue: true, purpose: 'operational', }, skipNativeAPI: true, @@ -45,6 +47,7 @@ const testDefinitions: FeatureFlagDefinitions = { defaultValue: false, metadata: { description: 'JS-only flag for testing. Do NOT modify.', + expectedReleaseValue: true, purpose: 'operational', }, }, @@ -59,6 +62,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Do not wait for a main-thread dispatch to complete init to start executing work on the JS thread on Android', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -67,6 +71,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'The bridgeless architecture enables the event loop by default. This feature flag allows us to force disabling it in specific instances.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -76,6 +81,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-10-26', description: 'Prevent FabricMountingManager from reordering mountitems, which may lead to invalid state on the UI thread', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -85,6 +91,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-10', description: 'Kill-switch to turn off support for aling-items:baseline on Fabric iOS.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -93,6 +100,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'When enabled, custom line height calculation will be centered from top to bottom.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -101,6 +109,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Feature flag to enable the new bridgeless architecture. Note: Enabling this will force enable the following flags: `useTurboModules` & `enableFabricRenderer.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -110,6 +119,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-09-13', description: 'Enable prop iterator setter-style construction of Props in C++ (this flag is not used in Java).', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -119,6 +129,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-09-13', description: 'Deletes views that were pre-allocated but never mounted on the screen.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -128,6 +139,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-28', description: 'Feature flag to configure eager attachment of the root view/initialisation of the JS code.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -137,6 +149,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-08-08', description: 'Enables the retention of EventEmitterWrapper on Android till the touch gesture is over to fix a bug on pressable (#44610)', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -144,6 +157,7 @@ const definitions: FeatureFlagDefinitions = { defaultValue: false, metadata: { description: 'This feature flag enables logs for Fabric.', + expectedReleaseValue: true, purpose: 'operational', }, }, @@ -151,6 +165,7 @@ const definitions: FeatureFlagDefinitions = { defaultValue: false, metadata: { description: 'Enables the use of the Fabric renderer in the whole app.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -160,6 +175,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-11-14', description: 'Synchronise the view command dispatching with mounting of new transaction', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -169,6 +185,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-05-01', description: 'When enabled, the renderer would only fail commits when they propagate state and the last commit that updated state changed before committing.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -177,6 +194,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { dateAdded: '2024-08-30', description: 'iOS Views will clip to their padding box vs border box', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -186,6 +204,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-11-19', description: 'When enabled, Andoid will build and initiate image prefetch requests on ImageShadowNode::layout', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -194,6 +213,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'When enabled, LayoutAnimations API will animate state changes on Android.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -202,6 +222,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'When enabled, LayoutAnimations API will animate state changes on iOS.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -210,6 +231,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Enables the reporting of long tasks through `PerformanceObserver`. Only works if the event loop is enabled.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -219,6 +241,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-09-24', description: 'Use BackgroundDrawable and BorderDrawable instead of CSSBackgroundDrawable', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -228,6 +251,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-09-19', description: 'Moves execution of pre-mount items to outside the choregrapher in the main thread, so we can estimate idle time more precisely (Android only).', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -237,6 +261,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-12', description: 'When enabled, Android will receive prop updates based on the differences between the last rendered shadow node and the last committed shadow node.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -245,6 +270,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Report paint time inside the Event Timing API implementation (PerformanceObserver).', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -254,6 +280,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-04-25', description: 'Dispatches state updates synchronously in Fabric (e.g.: updates the scroll position in the shadow tree synchronously from the main thread).', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -263,6 +290,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-04-25', description: 'Ensures that JavaScript always has a consistent view of the state of the UI (e.g.: commits done in other threads are not immediately propagated to JS during its execution).', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -272,6 +300,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-31', description: 'Enables View Recycling. When enabled, individual ViewManagers must still opt-in.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -281,6 +310,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-22', description: 'When enabled, rawProps in Props will not include Yoga specific props.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -289,6 +319,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: "Fixes a bug in Differentiator where parent views may be referenced before they're created", + expectedReleaseValue: true, purpose: 'release', }, }, @@ -298,6 +329,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-06-18', description: 'Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -307,6 +339,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-08-27', description: 'Fixes a limitation on Android where the mounting coordinator would report there are no pending transactions but some of them were actually not processed due to the use of the push model.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -315,6 +348,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in debug builds. This flag is global and should not be changed across React Host lifetimes.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -323,6 +357,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Flag determining if the React Native DevTools (Fusebox) CDP backend should be enabled in release builds. This flag is global and should not be changed across React Host lifetimes.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -331,6 +366,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Construct modules that requires eager init on the dedicate native modules thread', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -340,6 +376,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-05-01', description: 'Only enqueue Choreographer calls if there is an ongoing animation, instead of enqueueing every frame.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -349,6 +386,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-12', description: 'Adds support for loading vector drawable assets in the Image component (only on Android)', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -357,6 +395,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Enables storing js caller stack when creating promise in native module. This is useful in case of Promise rejection and tracing the cause.', + expectedReleaseValue: true, purpose: 'operational', }, }, @@ -365,6 +404,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'In Bridgeless mode, use the always available javascript error reporting pipeline.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -373,6 +413,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Should this application enable the Fabric Interop Layer for Android? If yes, the application will behave so that it can accept non-Fabric components and render them on Fabric. This toggle is controlling extra logic such as custom event dispatching that are needed for the Fabric Interop Layer to work correctly.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -381,6 +422,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Invoke callbacks immediately on the ReactInstance rather than going through a background thread for synchronization', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -390,6 +432,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-04-03', description: 'When enabled, the native view configs are used in bridgeless mode.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -399,6 +442,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-23', description: 'Moves more of the work in view preallocation to the main thread to free up JS thread.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -408,6 +452,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-08-29', description: 'Uses an optimized mechanism for event batching on Android that does not need to wait for a Choreographer frame callback.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -417,6 +462,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-12-02', description: 'Instead of using folly::dynamic as internal representation in RawProps and RawValue, use jsi::Value', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -426,6 +472,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-06-03', description: 'When enabled, cloning shadow nodes within react native will update the reference held by the current JS fiber tree.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -435,6 +482,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-28', description: 'In Bridgeless mode, should legacy NativeModules use the TurboModule system?', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -443,6 +491,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'When enabled, NativeModules will be executed by using the TurboModule system', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -457,6 +506,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-02-05', description: 'Enables an experimental flush-queue debouncing in Animated.js.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -466,6 +516,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-02-05', description: 'Enables an experimental mega-operation for Animated.js that replaces many calls to native with a single call into native, to reduce JSI/JNI traffic.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -475,6 +526,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-11-06', description: 'Disables InteractionManager and replaces its scheduler with `setImmediate`.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -484,6 +536,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-11-18', description: 'Skips InteractionManager in `Batchinator` and invokes callbacks synchronously.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -492,6 +545,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Enables access to the host tree in Fabric using DOM-compatible APIs.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -500,6 +554,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Enables Animated to skip non-allowlisted props and styles.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -509,6 +564,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-09-17', description: 'Enables an experimental to use the proper clearIntermediate instead of calling the wrong clearTimeout and canceling another timer.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -517,6 +573,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Enables Animated to analyze props to minimize invalidating `AnimatedProps`.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -526,6 +583,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-11-22', description: 'Fixing an edge case where the current window size is not properly calculated with fast scrolling. Window size collapsed to 1 element even if windowSize more than the current amount of elements', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -534,6 +592,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Function used to enable / disabled Layout Animations in React Native.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -543,6 +602,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-25', description: 'If the animation is within Animated.loop, we do not send state updates to React.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -552,6 +612,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-02-05', description: 'Enables use of AnimatedObject for animating transform values.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -561,6 +622,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-02-05', description: 'removeClippedSubviews prop will be used as the default in FlatList on iOS to match Android', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -569,6 +631,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { dateAdded: '2024-03-05', description: 'Enables use of setNativeProps in JS driven animations.', + expectedReleaseValue: true, purpose: 'experimentation', }, }, @@ -577,6 +640,7 @@ const definitions: FeatureFlagDefinitions = { metadata: { description: 'Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`.', + expectedReleaseValue: true, purpose: 'release', }, }, @@ -586,6 +650,7 @@ const definitions: FeatureFlagDefinitions = { dateAdded: '2024-07-08', description: 'Enable a variant of TextInput that moves some state to refs to avoid unnecessary re-renders', + expectedReleaseValue: true, purpose: 'experimentation', }, }, diff --git a/packages/react-native/scripts/featureflags/types.js b/packages/react-native/scripts/featureflags/types.js index 48a5bed11a0..79acece8797 100644 --- a/packages/react-native/scripts/featureflags/types.js +++ b/packages/react-native/scripts/featureflags/types.js @@ -45,10 +45,12 @@ export type FeatureFlagMetadata = */ dateAdded: string, description: string, + expectedReleaseValue: boolean, }> | $ReadOnly<{ purpose: 'operational' | 'release', description: string, + expectedReleaseValue: boolean, }>; export type GeneratorConfig = $ReadOnly<{