Add feature flag enableFontScaleChangesUpdatingLayout (#50515)

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

Changelog: [Internal]

Adds `enableFontScaleChangesUpdatingLayout` feature flag

Reviewed By: NickGerleman

Differential Revision: D72558888

fbshipit-source-id: a55b3f99f39cf5626ef3d9d49475a32f6c9fa7fa
This commit is contained in:
Jakub Piasecki
2025-04-08 07:58:20 -07:00
committed by Facebook GitHub Bot
parent 25b1883164
commit c2fbf040f8
20 changed files with 166 additions and 49 deletions
@@ -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<<28e3a307300f53f69b5585cc639f0097>>
* @generated SignedSource<<383b618f8b93333992d1ce4d61932dc2>>
*/
/**
@@ -102,6 +102,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableFabricRenderer(): Boolean = accessor.enableFabricRenderer()
/**
* Enables font scale changes updating layout for measurable nodes.
*/
@JvmStatic
public fun enableFontScaleChangesUpdatingLayout(): Boolean = accessor.enableFontScaleChangesUpdatingLayout()
/**
* iOS Views will clip to their padding box vs border box
*/
@@ -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<<fedd5579e4fb417bd1ddf9081985f427>>
* @generated SignedSource<<4eaac16d5869aa4d4d6552e052f1fbe7>>
*/
/**
@@ -32,6 +32,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
private var enableJSRuntimeGCOnMemoryPressureOnIOSCache: Boolean? = null
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
@@ -170,6 +171,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableFontScaleChangesUpdatingLayout()
enableFontScaleChangesUpdatingLayoutCache = cached
}
return cached
}
override fun enableIOSViewClipToPaddingBox(): Boolean {
var cached = enableIOSViewClipToPaddingBoxCache
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<<77db50aabc075e6ef133158a9828f52b>>
* @generated SignedSource<<6eb22dfcbf6bd76b830cf9d9471cfab6>>
*/
/**
@@ -52,6 +52,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableFabricRenderer(): Boolean
@DoNotStrip @JvmStatic public external fun enableFontScaleChangesUpdatingLayout(): Boolean
@DoNotStrip @JvmStatic public external fun enableIOSViewClipToPaddingBox(): Boolean
@DoNotStrip @JvmStatic public external fun enableJSRuntimeGCOnMemoryPressureOnIOS(): 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<<95e258c60535844bc096e6d291785c71>>
* @generated SignedSource<<bb1a4742390d9b3657b244c5f2130de0>>
*/
/**
@@ -47,6 +47,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableFabricRenderer(): Boolean = false
override fun enableFontScaleChangesUpdatingLayout(): Boolean = false
override fun enableIOSViewClipToPaddingBox(): Boolean = false
override fun enableJSRuntimeGCOnMemoryPressureOnIOS(): 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<<c8a43244cf7e009b66d8351d1c0afdb7>>
* @generated SignedSource<<f2eae58b3b36c77f266c629ebb39d64a>>
*/
/**
@@ -36,6 +36,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
private var enableFontScaleChangesUpdatingLayoutCache: Boolean? = null
private var enableIOSViewClipToPaddingBoxCache: Boolean? = null
private var enableJSRuntimeGCOnMemoryPressureOnIOSCache: Boolean? = null
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
@@ -186,6 +187,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun enableFontScaleChangesUpdatingLayout(): Boolean {
var cached = enableFontScaleChangesUpdatingLayoutCache
if (cached == null) {
cached = currentProvider.enableFontScaleChangesUpdatingLayout()
accessedFeatureFlags.add("enableFontScaleChangesUpdatingLayout")
enableFontScaleChangesUpdatingLayoutCache = cached
}
return cached
}
override fun enableIOSViewClipToPaddingBox(): Boolean {
var cached = enableIOSViewClipToPaddingBoxCache
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<<659516c334fc1c1a22fc0017ec4b634a>>
* @generated SignedSource<<1106df21502f3e508909ab0f719ed890>>
*/
/**
@@ -47,6 +47,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableFabricRenderer(): Boolean
@DoNotStrip public fun enableFontScaleChangesUpdatingLayout(): Boolean
@DoNotStrip public fun enableIOSViewClipToPaddingBox(): Boolean
@DoNotStrip public fun enableJSRuntimeGCOnMemoryPressureOnIOS(): 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<<c841e4d2f91254ead7f4796471ffb7df>>
* @generated SignedSource<<46e6dbfe09cb92e1810798e77f2cc7cf>>
*/
/**
@@ -111,6 +111,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool enableFontScaleChangesUpdatingLayout() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableFontScaleChangesUpdatingLayout");
return method(javaProvider_);
}
bool enableIOSViewClipToPaddingBox() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableIOSViewClipToPaddingBox");
@@ -349,6 +355,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableFabricRenderer(
return ReactNativeFeatureFlags::enableFabricRenderer();
}
bool JReactNativeFeatureFlagsCxxInterop::enableFontScaleChangesUpdatingLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout();
}
bool JReactNativeFeatureFlagsCxxInterop::enableIOSViewClipToPaddingBox(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
@@ -561,6 +572,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableFabricRenderer",
JReactNativeFeatureFlagsCxxInterop::enableFabricRenderer),
makeNativeMethod(
"enableFontScaleChangesUpdatingLayout",
JReactNativeFeatureFlagsCxxInterop::enableFontScaleChangesUpdatingLayout),
makeNativeMethod(
"enableIOSViewClipToPaddingBox",
JReactNativeFeatureFlagsCxxInterop::enableIOSViewClipToPaddingBox),
@@ -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<<5cba40510e76026bab8aac851946c6a2>>
* @generated SignedSource<<c22ae7df2b0b477f8e64699efe2e0d03>>
*/
/**
@@ -66,6 +66,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableFabricRenderer(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableFontScaleChangesUpdatingLayout(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableIOSViewClipToPaddingBox(
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<<c20566ca0fb97ba9f50cf18f687f2723>>
* @generated SignedSource<<427718c81c99f041fb69b1275d8b486b>>
*/
/**
@@ -74,6 +74,10 @@ bool ReactNativeFeatureFlags::enableFabricRenderer() {
return getAccessor().enableFabricRenderer();
}
bool ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout() {
return getAccessor().enableFontScaleChangesUpdatingLayout();
}
bool ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox() {
return getAccessor().enableIOSViewClipToPaddingBox();
}
@@ -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<<e9a8af0faacb2bd1ee4a922851ba0f17>>
* @generated SignedSource<<c998de5cb17443f38645ce34f620702c>>
*/
/**
@@ -99,6 +99,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableFabricRenderer();
/**
* Enables font scale changes updating layout for measurable nodes.
*/
RN_EXPORT static bool enableFontScaleChangesUpdatingLayout();
/**
* iOS Views will clip to their padding box vs border box
*/
@@ -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<<1242b2a758a66dd37b619750d9d22cc0>>
* @generated SignedSource<<f1b96624df1a0fa38553b376887f7938>>
*/
/**
@@ -245,6 +245,24 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRenderer() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableFontScaleChangesUpdatingLayout() {
auto flagValue = enableFontScaleChangesUpdatingLayout_.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(12, "enableFontScaleChangesUpdatingLayout");
flagValue = currentProvider_->enableFontScaleChangesUpdatingLayout();
enableFontScaleChangesUpdatingLayout_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableIOSViewClipToPaddingBox() {
auto flagValue = enableIOSViewClipToPaddingBox_.load();
@@ -254,7 +272,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSViewClipToPaddingBox() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(12, "enableIOSViewClipToPaddingBox");
markFlagAsAccessed(13, "enableIOSViewClipToPaddingBox");
flagValue = currentProvider_->enableIOSViewClipToPaddingBox();
enableIOSViewClipToPaddingBox_ = flagValue;
@@ -272,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::enableJSRuntimeGCOnMemoryPressureOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(13, "enableJSRuntimeGCOnMemoryPressureOnIOS");
markFlagAsAccessed(14, "enableJSRuntimeGCOnMemoryPressureOnIOS");
flagValue = currentProvider_->enableJSRuntimeGCOnMemoryPressureOnIOS();
enableJSRuntimeGCOnMemoryPressureOnIOS_ = flagValue;
@@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(14, "enableLayoutAnimationsOnAndroid");
markFlagAsAccessed(15, "enableLayoutAnimationsOnAndroid");
flagValue = currentProvider_->enableLayoutAnimationsOnAndroid();
enableLayoutAnimationsOnAndroid_ = flagValue;
@@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(15, "enableLayoutAnimationsOnIOS");
markFlagAsAccessed(16, "enableLayoutAnimationsOnIOS");
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
enableLayoutAnimationsOnIOS_ = flagValue;
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableLongTaskAPI() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(16, "enableLongTaskAPI");
markFlagAsAccessed(17, "enableLongTaskAPI");
flagValue = currentProvider_->enableLongTaskAPI();
enableLongTaskAPI_ = flagValue;
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMainQueueModulesOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(17, "enableMainQueueModulesOnIOS");
markFlagAsAccessed(18, "enableMainQueueModulesOnIOS");
flagValue = currentProvider_->enableMainQueueModulesOnIOS();
enableMainQueueModulesOnIOS_ = flagValue;
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNativeCSSParsing() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(18, "enableNativeCSSParsing");
markFlagAsAccessed(19, "enableNativeCSSParsing");
flagValue = currentProvider_->enableNativeCSSParsing();
enableNativeCSSParsing_ = flagValue;
@@ -380,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNewBackgroundAndBorderDrawables() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(19, "enableNewBackgroundAndBorderDrawables");
markFlagAsAccessed(20, "enableNewBackgroundAndBorderDrawables");
flagValue = currentProvider_->enableNewBackgroundAndBorderDrawables();
enableNewBackgroundAndBorderDrawables_ = flagValue;
@@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePropsUpdateReconciliationAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(20, "enablePropsUpdateReconciliationAndroid");
markFlagAsAccessed(21, "enablePropsUpdateReconciliationAndroid");
flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid();
enablePropsUpdateReconciliationAndroid_ = flagValue;
@@ -416,7 +434,7 @@ bool ReactNativeFeatureFlagsAccessor::enableReportEventPaintTime() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(21, "enableReportEventPaintTime");
markFlagAsAccessed(22, "enableReportEventPaintTime");
flagValue = currentProvider_->enableReportEventPaintTime();
enableReportEventPaintTime_ = flagValue;
@@ -434,7 +452,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(22, "enableSynchronousStateUpdates");
markFlagAsAccessed(23, "enableSynchronousStateUpdates");
flagValue = currentProvider_->enableSynchronousStateUpdates();
enableSynchronousStateUpdates_ = flagValue;
@@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewCulling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(23, "enableViewCulling");
markFlagAsAccessed(24, "enableViewCulling");
flagValue = currentProvider_->enableViewCulling();
enableViewCulling_ = flagValue;
@@ -470,7 +488,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecycling() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(24, "enableViewRecycling");
markFlagAsAccessed(25, "enableViewRecycling");
flagValue = currentProvider_->enableViewRecycling();
enableViewRecycling_ = flagValue;
@@ -488,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForText() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(25, "enableViewRecyclingForText");
markFlagAsAccessed(26, "enableViewRecyclingForText");
flagValue = currentProvider_->enableViewRecyclingForText();
enableViewRecyclingForText_ = flagValue;
@@ -506,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForView() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(26, "enableViewRecyclingForView");
markFlagAsAccessed(27, "enableViewRecyclingForView");
flagValue = currentProvider_->enableViewRecyclingForView();
enableViewRecyclingForView_ = flagValue;
@@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMappingOfEventPrioritiesBetweenFabricAn
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(27, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
markFlagAsAccessed(28, "fixMappingOfEventPrioritiesBetweenFabricAndReact");
flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact();
fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue;
@@ -542,7 +560,7 @@ bool ReactNativeFeatureFlagsAccessor::fixMountingCoordinatorReportedPendingTrans
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(28, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
markFlagAsAccessed(29, "fixMountingCoordinatorReportedPendingTransactionsOnAndroid");
flagValue = currentProvider_->fixMountingCoordinatorReportedPendingTransactionsOnAndroid();
fixMountingCoordinatorReportedPendingTransactionsOnAndroid_ = flagValue;
@@ -560,7 +578,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(29, "fuseboxEnabledRelease");
markFlagAsAccessed(30, "fuseboxEnabledRelease");
flagValue = currentProvider_->fuseboxEnabledRelease();
fuseboxEnabledRelease_ = flagValue;
@@ -578,7 +596,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(30, "fuseboxNetworkInspectionEnabled");
markFlagAsAccessed(31, "fuseboxNetworkInspectionEnabled");
flagValue = currentProvider_->fuseboxNetworkInspectionEnabled();
fuseboxNetworkInspectionEnabled_ = flagValue;
@@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::removeTurboModuleManagerDelegateMutex() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(31, "removeTurboModuleManagerDelegateMutex");
markFlagAsAccessed(32, "removeTurboModuleManagerDelegateMutex");
flagValue = currentProvider_->removeTurboModuleManagerDelegateMutex();
removeTurboModuleManagerDelegateMutex_ = flagValue;
@@ -614,7 +632,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(32, "traceTurboModulePromiseRejectionsOnAndroid");
markFlagAsAccessed(33, "traceTurboModulePromiseRejectionsOnAndroid");
flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid();
traceTurboModulePromiseRejectionsOnAndroid_ = flagValue;
@@ -632,7 +650,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(33, "useAlwaysAvailableJSErrorHandling");
markFlagAsAccessed(34, "useAlwaysAvailableJSErrorHandling");
flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling();
useAlwaysAvailableJSErrorHandling_ = flagValue;
@@ -650,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::useEditTextStockAndroidFocusBehavior() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(34, "useEditTextStockAndroidFocusBehavior");
markFlagAsAccessed(35, "useEditTextStockAndroidFocusBehavior");
flagValue = currentProvider_->useEditTextStockAndroidFocusBehavior();
useEditTextStockAndroidFocusBehavior_ = flagValue;
@@ -668,7 +686,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(35, "useFabricInterop");
markFlagAsAccessed(36, "useFabricInterop");
flagValue = currentProvider_->useFabricInterop();
useFabricInterop_ = flagValue;
@@ -686,7 +704,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(36, "useNativeViewConfigsInBridgelessMode");
markFlagAsAccessed(37, "useNativeViewConfigsInBridgelessMode");
flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode();
useNativeViewConfigsInBridgelessMode_ = flagValue;
@@ -704,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(37, "useOptimizedEventBatchingOnAndroid");
markFlagAsAccessed(38, "useOptimizedEventBatchingOnAndroid");
flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid();
useOptimizedEventBatchingOnAndroid_ = flagValue;
@@ -722,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(38, "useRawPropsJsiValue");
markFlagAsAccessed(39, "useRawPropsJsiValue");
flagValue = currentProvider_->useRawPropsJsiValue();
useRawPropsJsiValue_ = flagValue;
@@ -740,7 +758,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(39, "useTurboModuleInterop");
markFlagAsAccessed(40, "useTurboModuleInterop");
flagValue = currentProvider_->useTurboModuleInterop();
useTurboModuleInterop_ = flagValue;
@@ -758,7 +776,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(40, "useTurboModules");
markFlagAsAccessed(41, "useTurboModules");
flagValue = currentProvider_->useTurboModules();
useTurboModules_ = 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<<1250be4d57759bde60ba93d50e53c129>>
* @generated SignedSource<<449755d456982dae612173b40e83d619>>
*/
/**
@@ -44,6 +44,7 @@ class ReactNativeFeatureFlagsAccessor {
bool enableEagerRootViewAttachment();
bool enableFabricLogs();
bool enableFabricRenderer();
bool enableFontScaleChangesUpdatingLayout();
bool enableIOSViewClipToPaddingBox();
bool enableJSRuntimeGCOnMemoryPressureOnIOS();
bool enableLayoutAnimationsOnAndroid();
@@ -84,7 +85,7 @@ class ReactNativeFeatureFlagsAccessor {
std::unique_ptr<ReactNativeFeatureFlagsProvider> currentProvider_;
bool wasOverridden_;
std::array<std::atomic<const char*>, 41> accessedFeatureFlags_;
std::array<std::atomic<const char*>, 42> accessedFeatureFlags_;
std::atomic<std::optional<bool>> commonTestFlag_;
std::atomic<std::optional<bool>> animatedShouldSignalBatch_;
@@ -98,6 +99,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableEagerRootViewAttachment_;
std::atomic<std::optional<bool>> enableFabricLogs_;
std::atomic<std::optional<bool>> enableFabricRenderer_;
std::atomic<std::optional<bool>> enableFontScaleChangesUpdatingLayout_;
std::atomic<std::optional<bool>> enableIOSViewClipToPaddingBox_;
std::atomic<std::optional<bool>> enableJSRuntimeGCOnMemoryPressureOnIOS_;
std::atomic<std::optional<bool>> enableLayoutAnimationsOnAndroid_;
@@ -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<<50fd901c1ebdda0bfc77f9cf6753c2d8>>
* @generated SignedSource<<66b582a0da650a0beaa58d39e3b1f52b>>
*/
/**
@@ -75,6 +75,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableFontScaleChangesUpdatingLayout() override {
return false;
}
bool enableIOSViewClipToPaddingBox() override {
return 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<<742efcccd970523280eedad424dfece5>>
* @generated SignedSource<<b7e9e7411697d818c36985e18d219904>>
*/
/**
@@ -153,6 +153,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::enableFabricRenderer();
}
bool enableFontScaleChangesUpdatingLayout() override {
auto value = values_["enableFontScaleChangesUpdatingLayout"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::enableFontScaleChangesUpdatingLayout();
}
bool enableIOSViewClipToPaddingBox() override {
auto value = values_["enableIOSViewClipToPaddingBox"];
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<<48fbc6eaa7304a3973c95c9e4e88a7c4>>
* @generated SignedSource<<01a4fea189284593948bb09b03fad448>>
*/
/**
@@ -37,6 +37,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableEagerRootViewAttachment() = 0;
virtual bool enableFabricLogs() = 0;
virtual bool enableFabricRenderer() = 0;
virtual bool enableFontScaleChangesUpdatingLayout() = 0;
virtual bool enableIOSViewClipToPaddingBox() = 0;
virtual bool enableJSRuntimeGCOnMemoryPressureOnIOS() = 0;
virtual bool enableLayoutAnimationsOnAndroid() = 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<<d8f5cc9ed8e642b143777c4711c66938>>
* @generated SignedSource<<d34466f97ed6a7e40839503c907fed96>>
*/
/**
@@ -104,6 +104,11 @@ bool NativeReactNativeFeatureFlags::enableFabricRenderer(
return ReactNativeFeatureFlags::enableFabricRenderer();
}
bool NativeReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableFontScaleChangesUpdatingLayout();
}
bool NativeReactNativeFeatureFlags::enableIOSViewClipToPaddingBox(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableIOSViewClipToPaddingBox();
@@ -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<<4eb990a0eb33d51b99016529b3a5ffd6>>
* @generated SignedSource<<96a3d0ae120f2b74c92083d694f4b2bb>>
*/
/**
@@ -61,6 +61,8 @@ class NativeReactNativeFeatureFlags
bool enableFabricRenderer(jsi::Runtime& runtime);
bool enableFontScaleChangesUpdatingLayout(jsi::Runtime& runtime);
bool enableIOSViewClipToPaddingBox(jsi::Runtime& runtime);
bool enableJSRuntimeGCOnMemoryPressureOnIOS(jsi::Runtime& runtime);
@@ -174,6 +174,17 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'canary',
},
enableFontScaleChangesUpdatingLayout: {
defaultValue: false,
metadata: {
dateAdded: '2025-04-07',
description:
'Enables font scale changes updating layout for measurable nodes.',
expectedReleaseValue: true,
purpose: 'experimentation',
},
ossReleaseStage: 'none',
},
enableIOSViewClipToPaddingBox: {
defaultValue: false,
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.
*
* @generated SignedSource<<45566b4c0ac8ebf08c1c82eb774b0683>>
* @generated SignedSource<<69e14712997691caf280ee73d58a378a>>
* @flow strict
*/
@@ -59,6 +59,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
enableEagerRootViewAttachment: Getter<boolean>,
enableFabricLogs: Getter<boolean>,
enableFabricRenderer: Getter<boolean>,
enableFontScaleChangesUpdatingLayout: Getter<boolean>,
enableIOSViewClipToPaddingBox: Getter<boolean>,
enableJSRuntimeGCOnMemoryPressureOnIOS: Getter<boolean>,
enableLayoutAnimationsOnAndroid: Getter<boolean>,
@@ -207,6 +208,10 @@ export const enableFabricLogs: Getter<boolean> = createNativeFlagGetter('enableF
* Enables the use of the Fabric renderer in the whole app.
*/
export const enableFabricRenderer: Getter<boolean> = createNativeFlagGetter('enableFabricRenderer', false);
/**
* Enables font scale changes updating layout for measurable nodes.
*/
export const enableFontScaleChangesUpdatingLayout: Getter<boolean> = createNativeFlagGetter('enableFontScaleChangesUpdatingLayout', false);
/**
* iOS Views will clip to their padding box vs border box
*/
@@ -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<<36c32298fec484c6053cb78bf8a08051>>
* @generated SignedSource<<90403d3dc3269914026f808dcb2323b3>>
* @flow strict
*/
@@ -36,6 +36,7 @@ export interface Spec extends TurboModule {
+enableEagerRootViewAttachment?: () => boolean;
+enableFabricLogs?: () => boolean;
+enableFabricRenderer?: () => boolean;
+enableFontScaleChangesUpdatingLayout?: () => boolean;
+enableIOSViewClipToPaddingBox?: () => boolean;
+enableJSRuntimeGCOnMemoryPressureOnIOS?: () => boolean;
+enableLayoutAnimationsOnAndroid?: () => boolean;