Back out "Add fixYogaFlexBasisFitContentInMainAxis flag to avoid unnecessary re-measurement" (#55989)

Summary:
changelog: [internal]

Pull Request resolved: https://github.com/facebook/react-native/pull/55989

X-link: https://github.com/facebook/yoga/pull/1912

Original commit changeset: 158715167080

Original Phabricator Diff: D94658492

Reviewed By: NickGerleman

Differential Revision: D95669495

fbshipit-source-id: a11d59c14521749986271815da535fab7e4a144b
This commit is contained in:
Samuel Susla authored and meta-codesync[bot] committed 2026-03-07 15:01:46 -08:00
1 parent 75f7e01903
commit c0b10573ee
27 files changed
+68 -286

No files matched your search

@@ -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<<55bcfe664afd673f0a9767468a3ca98f>>
* @generated SignedSource<<e6da91a25406bc0930e6415da9bdcd55>>
*/
/**
@@ -390,12 +390,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = accessor.fixTextClippingAndroid15useBoundsForWidth()
/**
* When enabled, Yoga will not apply a FitContent constraint in the main axis during flex basis computation for non-measure container nodes. This prevents unnecessary re-measurement and cascading clones when a sibling changes size in a ScrollView.
*/
@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`.
*/
@@ -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<<5ec50a8b4d2627a478ec9633e84ab046>>
* @generated SignedSource<<a4c3c9732db567bf8ab9915f731e57ff>>
*/
/**
@@ -80,7 +80,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var fixFindShadowNodeByTagRaceConditionCache: Boolean? = null
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null
private var fuseboxAssertSingleHostStateCache: Boolean? = null
private var fuseboxEnabledReleaseCache: Boolean? = null
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -650,15 +649,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) {
@@ -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<<daf8cd270e8f69e6e0c410b4007ee28e>>
* @generated SignedSource<<ce1f59ca437f7d8e24bdcbd651e44cc2>>
*/
/**
@@ -148,8 +148,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
@DoNotStrip @JvmStatic public external fun fixYogaFlexBasisFitContentInMainAxis(): Boolean
@DoNotStrip @JvmStatic public external fun fuseboxAssertSingleHostState(): Boolean
@DoNotStrip @JvmStatic public external fun fuseboxEnabledRelease(): Boolean
@@ -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<<0e10c51dcebd6077237c0c0aaff251e8>>
* @generated SignedSource<<cd851e80f207b3e141400802917e4981>>
*/
/**
@@ -143,8 +143,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun fixTextClippingAndroid15useBoundsForWidth(): Boolean = false
override fun fixYogaFlexBasisFitContentInMainAxis(): Boolean = false
override fun fuseboxAssertSingleHostState(): Boolean = true
override fun fuseboxEnabledRelease(): Boolean = false
@@ -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<<b1d196c0623e11fbcf59b38143fbe37e>>
* @generated SignedSource<<ff9e56efafa98cf4c466c976739a2957>>
*/
/**
@@ -84,7 +84,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var fixFindShadowNodeByTagRaceConditionCache: Boolean? = null
private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null
private var fixTextClippingAndroid15useBoundsForWidthCache: Boolean? = null
private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null
private var fuseboxAssertSingleHostStateCache: Boolean? = null
private var fuseboxEnabledReleaseCache: Boolean? = null
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
@@ -714,16 +713,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) {
@@ -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<<fd463e05fc06ba5bae4f1e0bb99e72b2>>
* @generated SignedSource<<39585bb818914cc7a02e18399fe49cbe>>
*/
/**
@@ -143,8 +143,6 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun fixTextClippingAndroid15useBoundsForWidth(): Boolean
@DoNotStrip public fun fixYogaFlexBasisFitContentInMainAxis(): Boolean
@DoNotStrip public fun fuseboxAssertSingleHostState(): Boolean
@DoNotStrip public fun fuseboxEnabledRelease(): Boolean
@@ -14,7 +14,6 @@ public enum YogaErrata {
STRETCH_FLEX_BASIS(1),
ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING(2),
ABSOLUTE_PERCENT_AGAINST_INNER_SIZE(4),
FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS(8),
ALL(2147483647),
CLASSIC(2147483646);
@@ -34,7 +33,6 @@ public enum YogaErrata {
case 1: return STRETCH_FLEX_BASIS;
case 2: return ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING;
case 4: return ABSOLUTE_PERCENT_AGAINST_INNER_SIZE;
case 8: return FLEX_BASIS_FIT_CONTENT_IN_MAIN_AXIS;
case 2147483647: return ALL;
case 2147483646: return CLASSIC;
default: throw new IllegalArgumentException("Unknown enum value: " + value);
@@ -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<<e1d6bbba43ad263257ed723f3a6c2600>>
* @generated SignedSource<<0497864a0645d430ac6373047d6d2ea8>>
*/
/**
@@ -399,12 +399,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool fixYogaFlexBasisFitContentInMainAxis() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fixYogaFlexBasisFitContentInMainAxis");
return method(javaProvider_);
}
bool fuseboxAssertSingleHostState() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("fuseboxAssertSingleHostState");
@@ -877,11 +871,6 @@ bool JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWid
return ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth();
}
bool JReactNativeFeatureFlagsCxxInterop::fixYogaFlexBasisFitContentInMainAxis(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis();
}
bool JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::fuseboxAssertSingleHostState();
@@ -1233,9 +1222,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"fixTextClippingAndroid15useBoundsForWidth",
JReactNativeFeatureFlagsCxxInterop::fixTextClippingAndroid15useBoundsForWidth),
makeNativeMethod(
"fixYogaFlexBasisFitContentInMainAxis",
JReactNativeFeatureFlagsCxxInterop::fixYogaFlexBasisFitContentInMainAxis),
makeNativeMethod(
"fuseboxAssertSingleHostState",
JReactNativeFeatureFlagsCxxInterop::fuseboxAssertSingleHostState),
@@ -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<<c3a280ebf9c5b95d484f3b79fb1ac3e5>>
* @generated SignedSource<<9e245713f519765f04c5517c1de47c70>>
*/
/**
@@ -210,9 +210,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool fixTextClippingAndroid15useBoundsForWidth(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool fixYogaFlexBasisFitContentInMainAxis(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool fuseboxAssertSingleHostState(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -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<<6630f6e51cce8abe8457e6ca17b4db05>>
* @generated SignedSource<<10986d98341baa81d1aa3fc90f739367>>
*/
/**
@@ -266,10 +266,6 @@ bool ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth() {
return getAccessor().fixTextClippingAndroid15useBoundsForWidth();
}
bool ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis() {
return getAccessor().fixYogaFlexBasisFitContentInMainAxis();
}
bool ReactNativeFeatureFlags::fuseboxAssertSingleHostState() {
return getAccessor().fuseboxAssertSingleHostState();
}
@@ -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<<988fab572d94253ccb4dc3e598fc154b>>
* @generated SignedSource<<f0f19fee7d5fdd2dbf5eb8460ab95905>>
*/
/**
@@ -339,11 +339,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool fixTextClippingAndroid15useBoundsForWidth();
/**
* When enabled, Yoga will not apply a FitContent constraint in the main axis during flex basis computation for non-measure container nodes. This prevents unnecessary re-measurement and cascading clones when a sibling changes size in a ScrollView.
*/
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`.
*/
@@ -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<<52f88e97535e16551a393e2f6779652b>>
* @generated SignedSource<<2dfea8f52a640e8623f56371eec2ba0f>>
*/
/**
@@ -1109,24 +1109,6 @@ bool ReactNativeFeatureFlagsAccessor::fixTextClippingAndroid15useBoundsForWidth(
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(60, "fixYogaFlexBasisFitContentInMainAxis");
flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis();
fixYogaFlexBasisFitContentInMainAxis_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::fuseboxAssertSingleHostState() {
auto flagValue = fuseboxAssertSingleHostState_.load();
@@ -1136,7 +1118,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(61, "fuseboxAssertSingleHostState");
markFlagAsAccessed(60, "fuseboxAssertSingleHostState");
flagValue = currentProvider_->fuseboxAssertSingleHostState();
fuseboxAssertSingleHostState_ = flagValue;
@@ -1154,7 +1136,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(62, "fuseboxEnabledRelease");
markFlagAsAccessed(61, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -1172,7 +1154,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(63, "fuseboxNetworkInspectionEnabled");
markFlagAsAccessed(62, "fuseboxNetworkInspectionEnabled");
flagValue = currentProvider_->fuseboxNetworkInspectionEnabled();
fuseboxNetworkInspectionEnabled_ = flagValue;
@@ -1190,7 +1172,7 @@ bool ReactNativeFeatureFlagsAccessor::hideOffscreenVirtualViewsOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(64, "hideOffscreenVirtualViewsOnIOS");
markFlagAsAccessed(63, "hideOffscreenVirtualViewsOnIOS");
flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS();
hideOffscreenVirtualViewsOnIOS_ = flagValue;
@@ -1208,7 +1190,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(65, "overrideBySynchronousMountPropsAtMountingAndroid");
markFlagAsAccessed(64, "overrideBySynchronousMountPropsAtMountingAndroid");
flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid();
overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue;
@@ -1226,7 +1208,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(66, "perfIssuesEnabled");
markFlagAsAccessed(65, "perfIssuesEnabled");
flagValue = currentProvider_->perfIssuesEnabled();
perfIssuesEnabled_ = flagValue;
@@ -1244,7 +1226,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(67, "perfMonitorV2Enabled");
markFlagAsAccessed(66, "perfMonitorV2Enabled");
flagValue = currentProvider_->perfMonitorV2Enabled();
perfMonitorV2Enabled_ = flagValue;
@@ -1262,7 +1244,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(68, "preparedTextCacheSize");
markFlagAsAccessed(67, "preparedTextCacheSize");
flagValue = currentProvider_->preparedTextCacheSize();
preparedTextCacheSize_ = flagValue;
@@ -1280,7 +1262,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(69, "preventShadowTreeCommitExhaustion");
markFlagAsAccessed(68, "preventShadowTreeCommitExhaustion");
flagValue = currentProvider_->preventShadowTreeCommitExhaustion();
preventShadowTreeCommitExhaustion_ = flagValue;
@@ -1298,7 +1280,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(70, "shouldPressibilityUseW3CPointerEventsForHover");
markFlagAsAccessed(69, "shouldPressibilityUseW3CPointerEventsForHover");
flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover();
shouldPressibilityUseW3CPointerEventsForHover_ = flagValue;
@@ -1316,7 +1298,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(71, "shouldTriggerResponderTransferOnScrollAndroid");
markFlagAsAccessed(70, "shouldTriggerResponderTransferOnScrollAndroid");
flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid();
shouldTriggerResponderTransferOnScrollAndroid_ = flagValue;
@@ -1334,7 +1316,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(72, "skipActivityIdentityAssertionOnHostPause");
markFlagAsAccessed(71, "skipActivityIdentityAssertionOnHostPause");
flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause();
skipActivityIdentityAssertionOnHostPause_ = flagValue;
@@ -1352,7 +1334,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipToPaddingWithOverflow() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(73, "syncAndroidClipToPaddingWithOverflow");
markFlagAsAccessed(72, "syncAndroidClipToPaddingWithOverflow");
flagValue = currentProvider_->syncAndroidClipToPaddingWithOverflow();
syncAndroidClipToPaddingWithOverflow_ = flagValue;
@@ -1370,7 +1352,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(74, "traceTurboModulePromiseRejectionsOnAndroid");
markFlagAsAccessed(73, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -1388,7 +1370,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(75, "updateRuntimeShadowNodeReferencesOnCommit");
markFlagAsAccessed(74, "updateRuntimeShadowNodeReferencesOnCommit");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit();
updateRuntimeShadowNodeReferencesOnCommit_ = flagValue;
@@ -1406,7 +1388,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(76, "updateRuntimeShadowNodeReferencesOnCommitThread");
markFlagAsAccessed(75, "updateRuntimeShadowNodeReferencesOnCommitThread");
flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread();
updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue;
@@ -1424,7 +1406,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(77, "useAlwaysAvailableJSErrorHandling");
markFlagAsAccessed(76, "useAlwaysAvailableJSErrorHandling");
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -1442,7 +1424,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(78, "useFabricInterop");
markFlagAsAccessed(77, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -1460,7 +1442,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(79, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(78, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -1478,7 +1460,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(80, "useNestedScrollViewAndroid");
markFlagAsAccessed(79, "useNestedScrollViewAndroid");
flagValue = currentProvider_->useNestedScrollViewAndroid();
useNestedScrollViewAndroid_ = flagValue;
@@ -1496,7 +1478,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(81, "useSharedAnimatedBackend");
markFlagAsAccessed(80, "useSharedAnimatedBackend");
flagValue = currentProvider_->useSharedAnimatedBackend();
useSharedAnimatedBackend_ = flagValue;
@@ -1514,7 +1496,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(82, "useTraitHiddenOnAndroid");
markFlagAsAccessed(81, "useTraitHiddenOnAndroid");
flagValue = currentProvider_->useTraitHiddenOnAndroid();
useTraitHiddenOnAndroid_ = flagValue;
@@ -1532,7 +1514,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(83, "useTurboModuleInterop");
markFlagAsAccessed(82, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
@@ -1550,7 +1532,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(84, "useTurboModules");
markFlagAsAccessed(83, "useTurboModules");
flagValue = currentProvider_->useTurboModules();
useTurboModules_ = flagValue;
@@ -1568,7 +1550,7 @@ bool ReactNativeFeatureFlagsAccessor::useUnorderedMapInDifferentiator() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(85, "useUnorderedMapInDifferentiator");
markFlagAsAccessed(84, "useUnorderedMapInDifferentiator");
flagValue = currentProvider_->useUnorderedMapInDifferentiator();
useUnorderedMapInDifferentiator_ = flagValue;
@@ -1586,7 +1568,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(86, "viewCullingOutsetRatio");
markFlagAsAccessed(85, "viewCullingOutsetRatio");
flagValue = currentProvider_->viewCullingOutsetRatio();
viewCullingOutsetRatio_ = flagValue;
@@ -1604,7 +1586,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(87, "viewTransitionEnabled");
markFlagAsAccessed(86, "viewTransitionEnabled");
flagValue = currentProvider_->viewTransitionEnabled();
viewTransitionEnabled_ = flagValue;
@@ -1622,7 +1604,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(88, "virtualViewPrerenderRatio");
markFlagAsAccessed(87, "virtualViewPrerenderRatio");
flagValue = currentProvider_->virtualViewPrerenderRatio();
virtualViewPrerenderRatio_ = flagValue;
@@ -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<<dc346a5844161a603beb120783f6751a>>
* @generated SignedSource<<a9b1e5f247dd97781e895938674e6f9d>>
*/
/**
@@ -92,7 +92,6 @@ class ReactNativeFeatureFlagsAccessor {
bool fixFindShadowNodeByTagRaceCondition();
bool fixMappingOfEventPrioritiesBetweenFabricAndReact();
bool fixTextClippingAndroid15useBoundsForWidth();
bool fixYogaFlexBasisFitContentInMainAxis();
bool fuseboxAssertSingleHostState();
bool fuseboxEnabledRelease();
bool fuseboxNetworkInspectionEnabled();
@@ -132,7 +131,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 89> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 88> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> cdpInteractionMetricsEnabled_;
@@ -194,7 +193,6 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> fixFindShadowNodeByTagRaceCondition_;
std::atomic<std::optional<bool>> fixMappingOfEventPrioritiesBetweenFabricAndReact_;
std::atomic<std::optional<bool>> fixTextClippingAndroid15useBoundsForWidth_;
std::atomic<std::optional<bool>> fixYogaFlexBasisFitContentInMainAxis_;
std::atomic<std::optional<bool>> fuseboxAssertSingleHostState_;
std::atomic<std::optional<bool>> fuseboxEnabledRelease_;
std::atomic<std::optional<bool>> fuseboxNetworkInspectionEnabled_;
@@ -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<<b0a1604371a16a1cd6aa650aaa30353a>>
* @generated SignedSource<<f00cb61af4413b63f1556ebda3daf980>>
*/
/**
@@ -267,10 +267,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool fixYogaFlexBasisFitContentInMainAxis() override {
return false;
}
bool fuseboxAssertSingleHostState() override {
return true;
}
@@ -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<<5b75038b551675ce0272327b3d3a8040>>
* @generated SignedSource<<b7c23c68dd0a98e0fac632a0a49d2107>>
*/
/**
@@ -585,15 +585,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::fixTextClippingAndroid15useBoundsForWidth();
}
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()) {
@@ -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<<b15969577fa92d3693370fae09b5cc80>>
* @generated SignedSource<<4fe7e087f4f531772fe08943888c24d8>>
*/
/**
@@ -85,7 +85,6 @@ class ReactNativeFeatureFlagsProvider {
virtual bool fixFindShadowNodeByTagRaceCondition() = 0;
virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0;
virtual bool fixTextClippingAndroid15useBoundsForWidth() = 0;
virtual bool fixYogaFlexBasisFitContentInMainAxis() = 0;
virtual bool fuseboxAssertSingleHostState() = 0;
virtual bool fuseboxEnabledRelease() = 0;
virtual bool fuseboxNetworkInspectionEnabled() = 0;
@@ -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<<600173d3cb27205c13d0ab7fe7ab8edb>>
* @generated SignedSource<<f2d9f3c9c479bbdadd033baaf619c3d3>>
*/
/**
@@ -344,11 +344,6 @@ bool NativeReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth(
return ReactNativeFeatureFlags::fixTextClippingAndroid15useBoundsForWidth();
}
bool NativeReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis();
}
bool NativeReactNativeFeatureFlags::fuseboxAssertSingleHostState(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::fuseboxAssertSingleHostState();
@@ -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<<d9fe281f126578b8de779b11ea9ef863>>
* @generated SignedSource<<4a51c6eacd3990f204dc88a9e0cac764>>
*/
/**
@@ -156,8 +156,6 @@ class NativeReactNativeFeatureFlags
bool fixTextClippingAndroid15useBoundsForWidth(jsi::Runtime& runtime);
bool fixYogaFlexBasisFitContentInMainAxis(jsi::Runtime& runtime);
bool fuseboxAssertSingleHostState(jsi::Runtime& runtime);
bool fuseboxEnabledRelease(jsi::Runtime& runtime);
@@ -599,13 +599,10 @@ void YogaLayoutableShadowNode::layoutTree(
{
TraceSection s2("YogaLayoutableShadowNode::configureYogaTree");
YGErrata defaultErrata = YGErrataAll;
if (ReactNativeFeatureFlags::fixYogaFlexBasisFitContentInMainAxis()) {
defaultErrata = static_cast<YGErrata>(
defaultErrata & ~YGErrataFlexBasisFitContentInMainAxis);
}
configureYogaTree(
layoutContext.pointScaleFactor, defaultErrata, swapLeftAndRight);
layoutContext.pointScaleFactor,
YGErrataAll /*defaultErrata*/,
swapLeftAndRight);
}
auto minimumSize = layoutConstraints.minimumSize;
@@ -117,8 +117,6 @@ const char* YGErrataToString(const YGErrata value) {
return "absolute-position-without-insets-excludes-padding";
case YGErrataAbsolutePercentAgainstInnerSize:
return "absolute-percent-against-inner-size";
case YGErrataFlexBasisFitContentInMainAxis:
return "flex-basis-fit-content-in-main-axis";
case YGErrataAll:
return "all";
case YGErrataClassic:
@@ -67,7 +67,6 @@ YG_ENUM_DECL(
YGErrataStretchFlexBasis = 1,
YGErrataAbsolutePositionWithoutInsetsExcludesPadding = 2,
YGErrataAbsolutePercentAgainstInnerSize = 4,
YGErrataFlexBasisFitContentInMainAxis = 8,
YGErrataAll = 2147483647,
YGErrataClassic = 2147483646)
YG_DEFINE_ENUM_FLAG_OPERATORS(YGErrata)
@@ -94,10 +94,7 @@ static void computeFlexBasisForChild(
const bool isColumnStyleDimDefined =
child->hasDefiniteLength(Dimension::Height, ownerHeight);
if (resolvedFlexBasis.isDefined() &&
(yoga::isDefined(mainAxisSize) ||
(!node->hasErrata(Errata::FlexBasisFitContentInMainAxis) &&
resolvedFlexBasis.unwrap() > 0))) {
if (resolvedFlexBasis.isDefined() && yoga::isDefined(mainAxisSize)) {
if (child->getLayout().computedFlexBasis.isUndefined() ||
(child->getConfig()->isExperimentalFeatureEnabled(
ExperimentalFeature::WebFlexBasis) &&
@@ -159,57 +156,19 @@ static void computeFlexBasisForChild(
// The W3C spec doesn't say anything about the 'overflow' property, but all
// major browsers appear to implement the following logic.
//
// In the cross axis, children should always be bounded by the parent's
// available space (FitContent). In the main axis, the flex basis should
// be the child's intrinsic size under max-content constraint.
//
// The legacy behavior (FlexBasisFitContentInMainAxis errata) applies a
// FitContent constraint in the main axis for non-scroll containers, which
// causes unnecessary re-measurement and cascading clones when the parent's
// content-determined size changes (e.g. when a sibling's height changes
// in a ScrollView).
//
// The corrected behavior leaves the main axis unconstrained for container
// children (no measure function), and preserves the FitContent constraint
// for measure function nodes (e.g. text) to support text wrapping.
if (node->hasErrata(Errata::FlexBasisFitContentInMainAxis)) {
// Legacy behavior: apply FitContent in both axes (except main axis for
// scroll containers).
if ((!isMainAxisRow && node->style().overflow() == Overflow::Scroll) ||
node->style().overflow() != Overflow::Scroll) {
if (yoga::isUndefined(childWidth) && yoga::isDefined(width)) {
childWidth = width;
childWidthSizingMode = SizingMode::FitContent;
}
if ((!isMainAxisRow && node->style().overflow() == Overflow::Scroll) ||
node->style().overflow() != Overflow::Scroll) {
if (yoga::isUndefined(childWidth) && yoga::isDefined(width)) {
childWidth = width;
childWidthSizingMode = SizingMode::FitContent;
}
}
if ((isMainAxisRow && node->style().overflow() == Overflow::Scroll) ||
node->style().overflow() != Overflow::Scroll) {
if (yoga::isUndefined(childHeight) && yoga::isDefined(height)) {
childHeight = height;
childHeightSizingMode = SizingMode::FitContent;
}
}
} else {
// Corrected behavior: only apply FitContent in the cross axis, or in
// the main axis for measure function nodes in non-scroll containers.
if (!isMainAxisRow ||
(child->hasMeasureFunc() &&
node->style().overflow() != Overflow::Scroll)) {
if (yoga::isUndefined(childWidth) && yoga::isDefined(width)) {
childWidth = width;
childWidthSizingMode = SizingMode::FitContent;
}
}
if (isMainAxisRow ||
(child->hasMeasureFunc() &&
node->style().overflow() != Overflow::Scroll)) {
if (yoga::isUndefined(childHeight) && yoga::isDefined(height)) {
childHeight = height;
childHeightSizingMode = SizingMode::FitContent;
}
if ((isMainAxisRow && node->style().overflow() == Overflow::Scroll) ||
node->style().overflow() != Overflow::Scroll) {
if (yoga::isUndefined(childHeight) && yoga::isDefined(height)) {
childHeight = height;
childHeightSizingMode = SizingMode::FitContent;
}
}
@@ -578,8 +537,6 @@ static float computeFlexBasisForChildren(
yoga::Node* const node,
const float availableInnerWidth,
const float availableInnerHeight,
const float ownerWidth,
const float ownerHeight,
SizingMode widthSizingMode,
SizingMode heightSizingMode,
Direction direction,
@@ -641,8 +598,8 @@ static float computeFlexBasisForChildren(
availableInnerWidth,
widthSizingMode,
availableInnerHeight,
ownerWidth,
ownerHeight,
availableInnerWidth,
availableInnerHeight,
heightSizingMode,
direction,
layoutMarkerData,
@@ -1472,56 +1429,12 @@ static void calculateLayoutImpl(
// STEP 3: DETERMINE FLEX BASIS FOR EACH ITEM
// When this node is measured with MaxContent (corrected
// FlexBasisFitContentInMainAxis behavior), availableInnerHeight/Width is NaN.
// To preserve percentage resolution for descendants, derive a definite
// owner-size from the parent-provided ownerHeight/ownerWidth.
float ownerWidthForChildren = availableInnerWidth;
float ownerHeightForChildren = availableInnerHeight;
if (!node->hasErrata(Errata::FlexBasisFitContentInMainAxis)) {
// Do not propagate the fallback when this node is a direct child of a
// scroll container. In scroll contexts, the scroll axis is intentionally
// indefinite and percentage-based children should not resolve against the
// viewport size.
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,
widthSizingMode,
heightSizingMode,
direction,
@@ -20,7 +20,6 @@ enum class Errata : uint32_t {
StretchFlexBasis = YGErrataStretchFlexBasis,
AbsolutePositionWithoutInsetsExcludesPadding = YGErrataAbsolutePositionWithoutInsetsExcludesPadding,
AbsolutePercentAgainstInnerSize = YGErrataAbsolutePercentAgainstInnerSize,
FlexBasisFitContentInMainAxis = YGErrataFlexBasisFitContentInMainAxis,
All = YGErrataAll,
Classic = YGErrataClassic,
};
@@ -689,17 +689,6 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'experimental',
},
fixYogaFlexBasisFitContentInMainAxis: {
defaultValue: false,
metadata: {
dateAdded: '2026-02-26',
description:
'When enabled, Yoga will not apply a FitContent constraint in the main axis during flex basis computation for non-measure container nodes. This prevents unnecessary re-measurement and cascading clones when a sibling changes size in a ScrollView.',
expectedReleaseValue: true,
purpose: 'experimentation',
},
ossReleaseStage: 'none',
},
fuseboxAssertSingleHostState: {
defaultValue: true,
metadata: {
@@ -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 {fixYogaFlexBasisFitContentInMainAxis} from 'react-native/src/private/featureflags/ReactNativeFeatureFlags';
test('base case when cloning results in revision +1', () => {
const root = Fantom.createRoot();
@@ -71,10 +70,6 @@ test('changing height of the top item in ScrollView results in excessive cloning
);
});
if (fixYogaFlexBasisFitContentInMainAxis()) {
expect(getRevision()).toBe(1);
} else {
// TODO(T225268793): the below assertion should be: `expect(getRevision()).toBe(1);`
expect(getRevision()).toBe(2);
}
// TODO(T225268793): the below assertion should be: `expect(getRevision()).toBe(1);`
expect(getRevision()).toBe(2);
});
@@ -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<<75d6c8b2ed8a5cf5f3de44d1d6392c58>>
* @generated SignedSource<<faefb8736898315190c95d866c4c4ce9>>
* @flow strict
* @noformat
*/
@@ -108,7 +108,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
fixFindShadowNodeByTagRaceCondition: Getter<boolean>,
fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean>,
fixTextClippingAndroid15useBoundsForWidth: Getter<boolean>,
fixYogaFlexBasisFitContentInMainAxis: Getter<boolean>,
fuseboxAssertSingleHostState: Getter<boolean>,
fuseboxEnabledRelease: Getter<boolean>,
fuseboxNetworkInspectionEnabled: Getter<boolean>,
@@ -448,10 +447,6 @@ export const fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter<boolean> =
* Fix text clipping starting in Android 15 due to usage of useBoundsForWidth
*/
export const fixTextClippingAndroid15useBoundsForWidth: Getter<boolean> = createNativeFlagGetter('fixTextClippingAndroid15useBoundsForWidth', false);
/**
* When enabled, Yoga will not apply a FitContent constraint in the main axis during flex basis computation for non-measure container nodes. This prevents unnecessary re-measurement and cascading clones when a sibling changes size in a ScrollView.
*/
export const fixYogaFlexBasisFitContentInMainAxis: Getter<boolean> = 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`.
*/
@@ -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<<4cc26e6b776088c9e80b5857e82cd9df>>
* @generated SignedSource<<174d4b001feed817ad74b441b6dae50d>>
* @flow strict
* @noformat
*/
@@ -85,7 +85,6 @@ export interface Spec extends TurboModule {
+fixFindShadowNodeByTagRaceCondition?: () => boolean;
+fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean;
+fixTextClippingAndroid15useBoundsForWidth?: () => boolean;
+fixYogaFlexBasisFitContentInMainAxis?: () => boolean;
+fuseboxAssertSingleHostState?: () => boolean;
+fuseboxEnabledRelease?: () => boolean;
+fuseboxNetworkInspectionEnabled?: () => boolean;