From 2053a550efaee0fa2aa19afcf0800717f3b1dd45 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 22 Jun 2026 07:14:03 -0700 Subject: [PATCH] Remove gated Yoga flex-basis behavior Summary: X-link: https://github.com/react/yoga/pull/1980 Remove the runtime-gated Yoga flex-basis fit-content behavior and its app-side overrides now that this behavior is no longer being shipped. This restores the ungated Yoga path and removes the related generated feature-flag surface. Changelog: [Internal] Reviewed By: javache Differential Revision: D108598973 --- .../View-flexBasisFitContent-itest.js | 87 ------------------- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +-- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +-- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../facebook/yoga/YogaExperimentalFeature.kt | 4 +- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +--- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 82 +++++++---------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +-- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../view/YogaLayoutableShadowNode.cpp | 5 -- .../ReactCommon/yoga/yoga/YGEnums.cpp | 2 - .../ReactCommon/yoga/yoga/YGEnums.h | 3 +- .../yoga/yoga/algorithm/CalculateLayout.cpp | 82 +---------------- .../yoga/yoga/enums/ExperimentalFeature.h | 3 +- .../ReactNativeFeatureFlags.config.js | 11 --- .../ShadowNodeRevisionGetter-itest.js | 15 ++-- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 28 files changed, 65 insertions(+), 355 deletions(-) delete mode 100644 packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js deleted file mode 100644 index 1d5b6008a48c..000000000000 --- a/packages/react-native/Libraries/Components/View/__tests__/View-flexBasisFitContent-itest.js +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @fantom_flags fixYogaFlexBasisFitContentInMainAxis:* - * @format - */ - -import '@react-native/fantom/src/setUpDefaultReactNativeEnvironment'; - -import type {HostInstance} from 'react-native'; - -import ensureInstance from '../../../../src/private/__tests__/utilities/ensureInstance'; -import * as Fantom from '@react-native/fantom'; -import * as React from 'react'; -import {createRef} from 'react'; -import {ScrollView, StyleSheet, View} from 'react-native'; -import ReactNativeElement from 'react-native/src/private/webapis/dom/nodes/ReactNativeElement'; - -const VIEWPORT_WIDTH = 402; -const VIEWPORT_HEIGHT = 760; -const FEED_CONTENT_HEIGHT = 1800; - -test('auto-height wrapper around a feed ScrollView stays bounded by the viewport', () => { - const root = Fantom.createRoot({ - viewportWidth: VIEWPORT_WIDTH, - viewportHeight: VIEWPORT_HEIGHT, - }); - - const wrapperRef = createRef(); - const scrollViewRef = createRef(); - const feedContentRef = createRef(); - - Fantom.runTask(() => { - root.render( - - - - - - - , - ); - }); - - const wrapper = ensureInstance(wrapperRef.current, ReactNativeElement); - const scrollView = ensureInstance(scrollViewRef.current, ReactNativeElement); - const feedContent = ensureInstance( - feedContentRef.current, - ReactNativeElement, - ); - - const wrapperRect = wrapper.getBoundingClientRect(); - const scrollViewRect = scrollView.getBoundingClientRect(); - const feedContentRect = feedContent.getBoundingClientRect(); - - expect(wrapperRect.height).toBe(VIEWPORT_HEIGHT); - expect(scrollViewRect.height).toBe(VIEWPORT_HEIGHT); - expect(feedContentRect.height).toBe(FEED_CONTENT_HEIGHT); -}); - -const styles = StyleSheet.create({ - feed: { - width: VIEWPORT_WIDTH, - }, - feedContent: { - height: FEED_CONTENT_HEIGHT, - width: VIEWPORT_WIDTH, - }, - feedWrapper: { - flexGrow: 1, - }, - screen: { - height: VIEWPORT_HEIGHT, - width: VIEWPORT_WIDTH, - }, -}); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index 868600367575..11e4b624a850 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -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<<00bb39539f4fc2dc0ad85a346bdee22b>> + * @generated SignedSource<<6e5d11227a493c56e2e132b4bc5ed4aa>> */ /** @@ -342,12 +342,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = accessor.fixMappingOfEventPrioritiesBetweenFabricAndReact() - /** - * Fix flex basis computation to not apply FitContent constraint in the main axis for non-measure container nodes, preventing unnecessary re-measurement in scroll containers. - */ - @JvmStatic - public fun fixYogaFlexBasisFitContentInMainAxis(): Boolean = accessor.fixYogaFlexBasisFitContentInMainAxis() - /** * Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index a6e2a21f33c6..bdeb1fbd406d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -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<<731e92ecac8dbdf0a4b204b763a2c8c7>> + * @generated SignedSource<<73a3842f757634b1efebd4cc6c868604>> */ /** @@ -72,7 +72,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var fixDifferentiatorParentTagForUnflattenCaseCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null - private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null private var fuseboxEnabledReleaseCache: Boolean? = null private var fuseboxFrameRecordingEnabledCache: Boolean? = null @@ -573,15 +572,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun fixYogaFlexBasisFitContentInMainAxis(): Boolean { - var cached = fixYogaFlexBasisFitContentInMainAxisCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.fixYogaFlexBasisFitContentInMainAxis() - fixYogaFlexBasisFitContentInMainAxisCache = cached - } - return cached - } - override fun fuseboxAssertSingleHostState(): Boolean { var cached = fuseboxAssertSingleHostStateCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 59fa21d68da9..da80b66c2cc3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -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<<4d0952ded695aec4a52b7b581ad19979>> + * @generated SignedSource<> */ /** @@ -132,8 +132,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean - @DoNotStrip @JvmStatic public external fun fixYogaFlexBasisFitContentInMainAxis(): Boolean - @DoNotStrip @JvmStatic public external fun fuseboxAssertSingleHostState(): Boolean @DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 3c3615871526..bff8b7af4d9a 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -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<<4c0b09eb9df8e4580dc4778a91591236>> + * @generated SignedSource<> */ /** @@ -127,8 +127,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false - override fun fixYogaFlexBasisFitContentInMainAxis(): Boolean = false - override fun fuseboxAssertSingleHostState(): Boolean = true override fun fuseboxEnabledRelease(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 114ad7a526ea..6f5331b9dc49 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -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<<156af11c13257170355284118e400435>> + * @generated SignedSource<<5405a946b6292fc00d8408b0bcc1f956>> */ /** @@ -76,7 +76,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null private var fixDifferentiatorParentTagForUnflattenCaseCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null - private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null private var fuseboxAssertSingleHostStateCache: Boolean? = null private var fuseboxEnabledReleaseCache: Boolean? = null private var fuseboxFrameRecordingEnabledCache: Boolean? = null @@ -629,16 +628,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun fixYogaFlexBasisFitContentInMainAxis(): Boolean { - var cached = fixYogaFlexBasisFitContentInMainAxisCache - if (cached == null) { - cached = currentProvider.fixYogaFlexBasisFitContentInMainAxis() - accessedFeatureFlags.add("fixYogaFlexBasisFitContentInMainAxis") - fixYogaFlexBasisFitContentInMainAxisCache = cached - } - return cached - } - override fun fuseboxAssertSingleHostState(): Boolean { var cached = fuseboxAssertSingleHostStateCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 8908aaf3a057..f6e185588a50 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -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<> + * @generated SignedSource<<0f69f2d1b8b7ea6b7b07a57cfd969bdc>> */ /** @@ -127,8 +127,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean - @DoNotStrip public fun fixYogaFlexBasisFitContentInMainAxis(): Boolean - @DoNotStrip public fun fuseboxAssertSingleHostState(): Boolean @DoNotStrip public fun fuseboxEnabledRelease(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt index aec70ac24698..2b1083f944ad 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/yoga/YogaExperimentalFeature.kt @@ -10,8 +10,7 @@ package com.facebook.yoga public enum class YogaExperimentalFeature(public val intValue: Int) { - WEB_FLEX_BASIS(0), - FIX_FLEX_BASIS_FIT_CONTENT(1); + WEB_FLEX_BASIS(0); public fun intValue(): Int = intValue @@ -20,7 +19,6 @@ public enum class YogaExperimentalFeature(public val intValue: Int) { public fun fromInt(value: Int): YogaExperimentalFeature = when (value) { 0 -> WEB_FLEX_BASIS - 1 -> FIX_FLEX_BASIS_FIT_CONTENT else -> throw IllegalArgumentException("Unknown enum value: $value") } } diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index d99ee6ee4f35..fd0361d3cdf4 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -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<<671da9c60f7c7331ece553327ee3ab33>> + * @generated SignedSource<<87799cfdce19b332fd1ef3a9a41e27c4>> */ /** @@ -351,12 +351,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool fixYogaFlexBasisFitContentInMainAxis() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fixYogaFlexBasisFitContentInMainAxis"); - return method(javaProvider_); - } - bool fuseboxAssertSingleHostState() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fuseboxAssertSingleHostState"); @@ -807,11 +801,6 @@ bool JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabri return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); } -bool JReactNativeFeatureFlagsCxxInterop::fixYogaFlexBasisFitContentInMainAxis( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis(); -} - bool JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::fuseboxAssertSingleHostState(); @@ -1154,9 +1143,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "fixMappingOfEventPrioritiesBetweenFabricAndReact", JReactNativeFeatureFlagsCxxInterop::fixMappingOfEventPrioritiesBetweenFabricAndReact), - makeNativeMethod( - "fixYogaFlexBasisFitContentInMainAxis", - JReactNativeFeatureFlagsCxxInterop::fixYogaFlexBasisFitContentInMainAxis), makeNativeMethod( "fuseboxAssertSingleHostState", JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index a6feb96ac72f..56811cd7bd17 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -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<> + * @generated SignedSource<> */ /** @@ -186,9 +186,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool fixMappingOfEventPrioritiesBetweenFabricAndReact( facebook::jni::alias_ref); - static bool fixYogaFlexBasisFitContentInMainAxis( - facebook::jni::alias_ref); - static bool fuseboxAssertSingleHostState( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index afd20ad674bc..8329ad1e67ce 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -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<<57f84b7025cf1fc77f5f99dfc4653fb4>> + * @generated SignedSource<<5fc3cccba8637ad31944c1e5676b39dc>> */ /** @@ -234,10 +234,6 @@ bool ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact() return getAccessor().fixMappingOfEventPrioritiesBetweenFabricAndReact(); } -bool ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis() { - return getAccessor().fixYogaFlexBasisFitContentInMainAxis(); -} - bool ReactNativeFeatureFlags::fuseboxAssertSingleHostState() { return getAccessor().fuseboxAssertSingleHostState(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 8761e43346ba..65d6cfb8a1d0 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -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<> + * @generated SignedSource<> */ /** @@ -299,11 +299,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool fixMappingOfEventPrioritiesBetweenFabricAndReact(); - /** - * Fix flex basis computation to not apply FitContent constraint in the main axis for non-measure container nodes, preventing unnecessary re-measurement in scroll containers. - */ - RN_EXPORT static bool fixYogaFlexBasisFitContentInMainAxis(); - /** * Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index f0c2e39839b4..a74d7e374699 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -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<<3effa01ecbf45e028b9268195920178b>> + * @generated SignedSource<<634f101b3663420c11711c9a7ae1a550>> */ /** @@ -965,24 +965,6 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() { - auto flagValue = fixYogaFlexBasisFitContentInMainAxis_.load(); - - if (!flagValue.has_value()) { - // This block is not exclusive but it is not necessary. - // If multiple threads try to initialize the feature flag, we would only - // be accessing the provider multiple times but the end state of this - // instance and the returned flag value would be the same. - - markFlagAsAccessed(52, "fixYogaFlexBasisFitContentInMainAxis"); - - flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis(); - fixYogaFlexBasisFitContentInMainAxis_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() { auto flagValue = fuseboxAssertSingleHostState_.load(); @@ -992,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(52, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1010,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxEnabledRelease() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fuseboxEnabledRelease"); + markFlagAsAccessed(53, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1028,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fuseboxFrameRecordingEnabled"); + markFlagAsAccessed(54, "fuseboxFrameRecordingEnabled"); flagValue = currentProvider_->fuseboxFrameRecordingEnabled(); fuseboxFrameRecordingEnabled_ = flagValue; @@ -1046,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxNetworkInspectionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(55, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1064,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "fuseboxScreenshotCaptureEnabled"); + markFlagAsAccessed(56, "fuseboxScreenshotCaptureEnabled"); flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled(); fuseboxScreenshotCaptureEnabled_ = flagValue; @@ -1082,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "optimizedAnimatedPropUpdates"); + markFlagAsAccessed(57, "optimizedAnimatedPropUpdates"); flagValue = currentProvider_->optimizedAnimatedPropUpdates(); optimizedAnimatedPropUpdates_ = flagValue; @@ -1100,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::overrideBySynchronousMountPropsAtMountingA // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(58, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1118,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::perfIssuesEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "perfIssuesEnabled"); + markFlagAsAccessed(59, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1136,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::perfMonitorV2Enabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "perfMonitorV2Enabled"); + markFlagAsAccessed(60, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1154,7 +1136,7 @@ double ReactNativeFeatureFlagsAccessor::preparedTextCacheSize() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "preparedTextCacheSize"); + markFlagAsAccessed(61, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1172,7 +1154,7 @@ bool ReactNativeFeatureFlagsAccessor::preventShadowTreeCommitExhaustion() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(63, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(62, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1190,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(64, "redBoxV2Android"); + markFlagAsAccessed(63, "redBoxV2Android"); flagValue = currentProvider_->redBoxV2Android(); redBoxV2Android_ = flagValue; @@ -1208,7 +1190,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(65, "redBoxV2IOS"); + markFlagAsAccessed(64, "redBoxV2IOS"); flagValue = currentProvider_->redBoxV2IOS(); redBoxV2IOS_ = flagValue; @@ -1226,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldPressibilityUseW3CPointerEventsForHo // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(65, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::shouldTriggerResponderTransferOnScrollAndr // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(66, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::skipActivityIdentityAssertionOnHostPause() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(67, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1280,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "syncAndroidClipBoundsWithOverflow"); + markFlagAsAccessed(68, "syncAndroidClipBoundsWithOverflow"); flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow(); syncAndroidClipBoundsWithOverflow_ = flagValue; @@ -1298,7 +1280,7 @@ bool ReactNativeFeatureFlagsAccessor::traceTurboModulePromiseRejectionsOnAndroid // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(70, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(69, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1316,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommit( // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(70, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1334,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::updateRuntimeShadowNodeReferencesOnCommitT // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "updateRuntimeShadowNodeReferencesOnCommitThread"); + markFlagAsAccessed(71, "updateRuntimeShadowNodeReferencesOnCommitThread"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread(); updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue; @@ -1352,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::useAlwaysAvailableJSErrorHandling() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(72, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1370,7 +1352,7 @@ bool ReactNativeFeatureFlagsAccessor::useFabricInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(74, "useFabricInterop"); + markFlagAsAccessed(73, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1388,7 +1370,7 @@ bool ReactNativeFeatureFlagsAccessor::useNativeViewConfigsInBridgelessMode() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(75, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(74, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1406,7 +1388,7 @@ bool ReactNativeFeatureFlagsAccessor::useNestedScrollViewAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(76, "useNestedScrollViewAndroid"); + markFlagAsAccessed(75, "useNestedScrollViewAndroid"); flagValue = currentProvider_->useNestedScrollViewAndroid(); useNestedScrollViewAndroid_ = flagValue; @@ -1424,7 +1406,7 @@ bool ReactNativeFeatureFlagsAccessor::useSharedAnimatedBackend() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(77, "useSharedAnimatedBackend"); + markFlagAsAccessed(76, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1442,7 +1424,7 @@ bool ReactNativeFeatureFlagsAccessor::useTraitHiddenOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(78, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(77, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModuleInterop() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useTurboModuleInterop"); + markFlagAsAccessed(78, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1478,7 +1460,7 @@ double ReactNativeFeatureFlagsAccessor::viewCullingOutsetRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "viewCullingOutsetRatio"); + markFlagAsAccessed(79, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1496,7 +1478,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "viewTransitionEnabled"); + markFlagAsAccessed(80, "viewTransitionEnabled"); flagValue = currentProvider_->viewTransitionEnabled(); viewTransitionEnabled_ = flagValue; @@ -1514,7 +1496,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(82, "viewTransitionUseHardwareBitmapAndroid"); + markFlagAsAccessed(81, "viewTransitionUseHardwareBitmapAndroid"); flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid(); viewTransitionUseHardwareBitmapAndroid_ = flagValue; @@ -1532,7 +1514,7 @@ double ReactNativeFeatureFlagsAccessor::virtualViewPrerenderRatio() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(83, "virtualViewPrerenderRatio"); + markFlagAsAccessed(82, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 485fc0276531..95f0dd2e94ad 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -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<> + * @generated SignedSource<<06242c4c92e398d1120813cea9ed9135>> */ /** @@ -84,7 +84,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableVirtualViewContainerStateExperimental(); bool fixDifferentiatorParentTagForUnflattenCase(); bool fixMappingOfEventPrioritiesBetweenFabricAndReact(); - bool fixYogaFlexBasisFitContentInMainAxis(); bool fuseboxAssertSingleHostState(); bool fuseboxEnabledRelease(); bool fuseboxFrameRecordingEnabled(); @@ -127,7 +126,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 84> accessedFeatureFlags_; + std::array, 83> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -181,7 +180,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableVirtualViewContainerStateExperimental_; std::atomic> fixDifferentiatorParentTagForUnflattenCase_; std::atomic> fixMappingOfEventPrioritiesBetweenFabricAndReact_; - std::atomic> fixYogaFlexBasisFitContentInMainAxis_; std::atomic> fuseboxAssertSingleHostState_; std::atomic> fuseboxEnabledRelease_; std::atomic> fuseboxFrameRecordingEnabled_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index f42230f27078..d6f6035d2313 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -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<<6451b9c50b78b3b00fc74b137f5ca541>> + * @generated SignedSource<> */ /** @@ -235,10 +235,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool fixYogaFlexBasisFitContentInMainAxis() override { - return false; - } - bool fuseboxAssertSingleHostState() override { return true; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index d01628a0839c..54969e414947 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -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<> + * @generated SignedSource<<04d03af8461193da3b43728aac27488f>> */ /** @@ -513,15 +513,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::fixMappingOfEventPrioritiesBetweenFabricAndReact(); } - bool fixYogaFlexBasisFitContentInMainAxis() override { - auto value = values_["fixYogaFlexBasisFitContentInMainAxis"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::fixYogaFlexBasisFitContentInMainAxis(); - } - bool fuseboxAssertSingleHostState() override { auto value = values_["fuseboxAssertSingleHostState"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index b9911886579f..96050016e8b9 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -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<<928b5ecbceacccae311edf4be6685c91>> + * @generated SignedSource<> */ /** @@ -77,7 +77,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableVirtualViewContainerStateExperimental() = 0; virtual bool fixDifferentiatorParentTagForUnflattenCase() = 0; virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0; - virtual bool fixYogaFlexBasisFitContentInMainAxis() = 0; virtual bool fuseboxAssertSingleHostState() = 0; virtual bool fuseboxEnabledRelease() = 0; virtual bool fuseboxFrameRecordingEnabled() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index e566499b25f9..25926bdd8239 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -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<<84ae8c7745f319878c329e07551bcc11>> + * @generated SignedSource<<97f025be7907a0e37e2b828d4306d8bf>> */ /** @@ -304,11 +304,6 @@ bool NativeReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndR return ReactNativeFeatureFlags::fixMappingOfEventPrioritiesBetweenFabricAndReact(); } -bool NativeReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis(); -} - bool NativeReactNativeFeatureFlags::fuseboxAssertSingleHostState( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::fuseboxAssertSingleHostState(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index ff722eb7e57b..d2e0b052805e 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -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<<19abe441594bf45b32c5c9cdcd9ca8d4>> + * @generated SignedSource<<3b5eb29bedcc79b923d33f51a8c7bc8b>> */ /** @@ -140,8 +140,6 @@ class NativeReactNativeFeatureFlags bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime& runtime); - bool fixYogaFlexBasisFitContentInMainAxis(jsi::Runtime& runtime); - bool fuseboxAssertSingleHostState(jsi::Runtime& runtime); bool fuseboxEnabledRelease(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index f7adbe14ef60..a65b462e1358 100644 --- a/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/packages/react-native/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -946,11 +946,6 @@ yoga::Config& YogaLayoutableShadowNode::initializeYogaConfig( YGConfigSetErrata(&config, YGConfigGetErrata(previousConfig)); } - if (ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis()) { - YGConfigSetExperimentalFeatureEnabled( - &config, YGExperimentalFeatureFixFlexBasisFitContent, true); - } - return config; } diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp index 1e823138684a..c98f2729a660 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.cpp @@ -131,8 +131,6 @@ const char* YGExperimentalFeatureToString(const YGExperimentalFeature value) { switch (value) { case YGExperimentalFeatureWebFlexBasis: return "web-flex-basis"; - case YGExperimentalFeatureFixFlexBasisFitContent: - return "fix-flex-basis-fit-content"; } return "unknown"; } diff --git a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h index f96abdf2f58c..d321467b65a6 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h +++ b/packages/react-native/ReactCommon/yoga/yoga/YGEnums.h @@ -74,8 +74,7 @@ YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata) YG_ENUM_DECL( YGExperimentalFeature, - YGExperimentalFeatureWebFlexBasis, - YGExperimentalFeatureFixFlexBasisFitContent) + YGExperimentalFeatureWebFlexBasis) YG_ENUM_DECL( YGFlexDirection, diff --git a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp index 6e7814be2a29..5ec699b8ca6f 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp +++ b/packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp @@ -94,16 +94,8 @@ static void computeFlexBasisForChild( const bool isColumnStyleDimDefined = child->hasDefiniteLength(Dimension::Height, ownerHeight); - const bool fixFlexBasisFitContent = - node->getConfig()->isExperimentalFeatureEnabled( - ExperimentalFeature::FixFlexBasisFitContent); - bool useResolvedFlexBasis = resolvedFlexBasis.isDefined() && yoga::isDefined(mainAxisSize); - if (fixFlexBasisFitContent && resolvedFlexBasis.isDefined() && - resolvedFlexBasis.unwrap() > 0) { - useResolvedFlexBasis = true; - } if (useResolvedFlexBasis) { if (child->getLayout().computedFlexBasis.isUndefined() || @@ -175,35 +167,8 @@ static void computeFlexBasisForChild( } } - // For height in the main axis (column direction): when the - // FixFlexBasisFitContent feature is enabled, skip FitContent for - // non-measure container children inside scroll subtrees. This makes the - // flex basis independent of content-determined heights, preventing - // unnecessary re-measurement cascades when a sibling changes size in a - // ScrollView, while preserving viewport bounds for wrappers outside the - // scroll subtree. - // - // We only optimize the height (column) axis because text wrapping depends - // on width constraints propagating through container nodes. Removing - // FitContent from the width axis would cause text inside nested - // containers to stop wrapping. - bool applyHeightFitContent = - isMainAxisRow || node->style().overflow() != Overflow::Scroll; - if (fixFlexBasisFitContent) { - bool nodeHasScrollAncestor = false; - for (auto owner = node->getOwner(); owner != nullptr; - owner = owner->getOwner()) { - if (owner->style().overflow() == Overflow::Scroll) { - nodeHasScrollAncestor = true; - break; - } - } - applyHeightFitContent = isMainAxisRow || - ((child->hasMeasureFunc() || !nodeHasScrollAncestor) && - node->style().overflow() != Overflow::Scroll); - } - if (applyHeightFitContent && yoga::isUndefined(childHeight) && - yoga::isDefined(height)) { + if ((isMainAxisRow || node->style().overflow() != Overflow::Scroll) && + yoga::isUndefined(childHeight) && yoga::isDefined(height)) { childHeight = height; childHeightSizingMode = SizingMode::FitContent; } @@ -1734,53 +1699,14 @@ static void calculateLayoutImpl( // STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM - // When this node is measured with MaxContent (FixFlexBasisFitContent - // behavior), availableInnerHeight is NaN. - // To preserve percentage resolution for descendants, derive a definite - // owner-size from the parent-provided ownerHeight. - float ownerWidthForChildren = availableInnerWidth; - float ownerHeightForChildren = availableInnerHeight; - - if (node->getConfig()->isExperimentalFeatureEnabled( - ExperimentalFeature::FixFlexBasisFitContent)) { - const auto* owner = node->getOwner(); - const bool isChildOfScrollContainer = - owner != nullptr && owner->style().overflow() == Overflow::Scroll; - - if (!isChildOfScrollContainer) { - if (yoga::isUndefined(ownerWidthForChildren) && - yoga::isDefined(ownerWidth)) { - ownerWidthForChildren = calculateAvailableInnerDimension( - node, - direction, - Dimension::Width, - ownerWidth - marginAxisRow, - paddingAndBorderAxisRow, - ownerWidth, - ownerWidth); - } - if (yoga::isUndefined(ownerHeightForChildren) && - yoga::isDefined(ownerHeight)) { - ownerHeightForChildren = calculateAvailableInnerDimension( - node, - direction, - Dimension::Height, - ownerHeight - marginAxisColumn, - paddingAndBorderAxisColumn, - ownerHeight, - ownerWidth); - } - } - } - // Computed basis + margins + gap float totalMainDim = 0; totalMainDim += computeFlexBasisForChildren( node, availableInnerWidth, availableInnerHeight, - ownerWidthForChildren, - ownerHeightForChildren, + availableInnerWidth, + availableInnerHeight, widthSizingMode, heightSizingMode, direction, diff --git a/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h b/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h index 7e6c5eb8b6c1..bbbf9cda431c 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h +++ b/packages/react-native/ReactCommon/yoga/yoga/enums/ExperimentalFeature.h @@ -17,12 +17,11 @@ namespace facebook::yoga { enum class ExperimentalFeature : uint8_t { WebFlexBasis = YGExperimentalFeatureWebFlexBasis, - FixFlexBasisFitContent = YGExperimentalFeatureFixFlexBasisFitContent, }; template <> constexpr int32_t ordinalCount() { - return 2; + return 1; } constexpr ExperimentalFeature scopedEnum(YGExperimentalFeature unscoped) { diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index a1f4834ec10e..74539ffc617d 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -604,17 +604,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - fixYogaFlexBasisFitContentInMainAxis: { - defaultValue: false, - metadata: { - dateAdded: '2026-03-09', - description: - 'Fix flex basis computation to not apply FitContent constraint in the main axis for non-measure container nodes, preventing unnecessary re-measurement in scroll containers.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, fuseboxAssertSingleHostState: { defaultValue: true, metadata: { diff --git a/packages/react-native/src/private/__tests__/utilities/__tests__/ShadowNodeRevisionGetter-itest.js b/packages/react-native/src/private/__tests__/utilities/__tests__/ShadowNodeRevisionGetter-itest.js index 7d2e6aa2d76a..89008ab51169 100644 --- a/packages/react-native/src/private/__tests__/utilities/__tests__/ShadowNodeRevisionGetter-itest.js +++ b/packages/react-native/src/private/__tests__/utilities/__tests__/ShadowNodeRevisionGetter-itest.js @@ -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. * - * @fantom_flags enableFabricCommitBranching:* fixYogaFlexBasisFitContentInMainAxis:* + * @fantom_flags enableFabricCommitBranching:* * @flow strict-local * @format */ @@ -15,7 +15,6 @@ import {createShadowNodeReferenceGetterRef} from '../ShadowNodeRevisionGetter'; import * as Fantom from '@react-native/fantom'; import * as React from 'react'; import {ScrollView, View} from 'react-native'; -import * as ReactNativeFeatureFlags from 'react-native/src/private/featureflags/ReactNativeFeatureFlags'; test('base case when cloning results in revision +1', () => { const root = Fantom.createRoot(); @@ -35,7 +34,11 @@ test('base case when cloning results in revision +1', () => { expect(getRevision()).toBe(2); }); -test('changing height of sibling in ScrollView does not clone unrelated descendants', () => { +// Optimization opportunity: changing the height of one sibling inside a +// ScrollView currently re-clones unrelated descendants, so the revision goes +// to 2. Ideally Yoga would not re-measure these nodes and the revision would +// stay at 1. +test('changing height of sibling in ScrollView clones unrelated descendants', () => { const root = Fantom.createRoot(); const [getRevision, ref] = createShadowNodeReferenceGetterRef(); @@ -71,9 +74,5 @@ test('changing height of sibling in ScrollView does not clone unrelated descenda ); }); - if (ReactNativeFeatureFlags.fixYogaFlexBasisFitContentInMainAxis()) { - expect(getRevision()).toBe(1); - } else { - expect(getRevision()).toBe(2); - } + expect(getRevision()).toBe(2); }); diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 71e0b730c834..48e8a6905bcc 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -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<<68e9dbd18bfcb5e7d5cad27d8663ce66>> + * @generated SignedSource<<98fcccecb67f4f9e6fa242ebbd6eea95>> * @flow strict * @noformat */ @@ -102,7 +102,6 @@ export type ReactNativeFeatureFlags = Readonly<{ enableVirtualViewContainerStateExperimental: Getter, fixDifferentiatorParentTagForUnflattenCase: Getter, fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter, - fixYogaFlexBasisFitContentInMainAxis: Getter, fuseboxAssertSingleHostState: Getter, fuseboxEnabledRelease: Getter, fuseboxFrameRecordingEnabled: Getter, @@ -423,10 +422,6 @@ export const fixDifferentiatorParentTagForUnflattenCase: Getter = creat * Uses the default event priority instead of the discreet event priority by default when dispatching events from Fabric to React. */ export const fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter = createNativeFlagGetter('fixMappingOfEventPrioritiesBetweenFabricAndReact', false); -/** - * Fix flex basis computation to not apply FitContent constraint in the main axis for non-measure container nodes, preventing unnecessary re-measurement in scroll containers. - */ -export const fixYogaFlexBasisFitContentInMainAxis: Getter = createNativeFlagGetter('fixYogaFlexBasisFitContentInMainAxis', false); /** * Enable system assertion validating that Fusebox is configured with a single host. When set, the CDP backend will dynamically disable features (Perf and Network) in the event that multiple hosts are registered (undefined behaviour), and broadcast this over `ReactNativeApplication.systemStateChanged`. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 1641e8560b8c..368307230f29 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -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<<39fb311e84bbff2ff76c8710d493d9d9>> + * @generated SignedSource<<1e9c650f18b14fa302efdfa5d07e9ab8>> * @flow strict * @noformat */ @@ -77,7 +77,6 @@ export interface Spec extends TurboModule { readonly enableVirtualViewContainerStateExperimental?: () => boolean; readonly fixDifferentiatorParentTagForUnflattenCase?: () => boolean; readonly fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean; - readonly fixYogaFlexBasisFitContentInMainAxis?: () => boolean; readonly fuseboxAssertSingleHostState?: () => boolean; readonly fuseboxEnabledRelease?: () => boolean; readonly fuseboxFrameRecordingEnabled?: () => boolean;