feature-flags: Prefix "eager" to "main queue modules" flag (#52543)

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

Prefixing "eager" to the name makes it less confusing.  React native already has main queue modules: they're just lazy.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D78109287

fbshipit-source-id: 5fa6095d2dd8fcf74fdda64e05483eb487bc8f56
This commit is contained in:
Ramanpreet Nara
2025-07-11 22:47:07 -07:00
committed by Facebook GitHub Bot
parent 24777bba07
commit 42ea4bc594
22 changed files with 149 additions and 149 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<<cffd8443f695ab22f1472bc9f8218759>>
* @generated SignedSource<<f45b66a7bbafef525b79c657522d062e>>
*/
/**
@@ -108,6 +108,12 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableDoubleMeasurementFixAndroid(): Boolean = accessor.enableDoubleMeasurementFixAndroid()
/**
* This infra allows native modules to initialize on the main thread, during React Native init.
*/
@JvmStatic
public fun enableEagerMainQueueModulesOnIOS(): Boolean = accessor.enableEagerMainQueueModulesOnIOS()
/**
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
*/
@@ -174,12 +180,6 @@ public object ReactNativeFeatureFlags {
@JvmStatic
public fun enableMainQueueCoordinatorOnIOS(): Boolean = accessor.enableMainQueueCoordinatorOnIOS()
/**
* Makes modules requiring main queue setup initialize on the main thread, during React Native init.
*/
@JvmStatic
public fun enableMainQueueModulesOnIOS(): Boolean = accessor.enableMainQueueModulesOnIOS()
/**
* Enable NSNull conversion when handling module arguments on iOS
*/
@@ -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<<e819ecd61f64324836d386e154844774>>
* @generated SignedSource<<455793458c7d1f7c3efb33a3ae2c017c>>
*/
/**
@@ -33,6 +33,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
@@ -44,7 +45,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null
private var enableMainQueueModulesOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
@@ -194,6 +194,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
var cached = enableEagerMainQueueModulesOnIOSCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableEagerMainQueueModulesOnIOS()
enableEagerMainQueueModulesOnIOSCache = cached
}
return cached
}
override fun enableEagerRootViewAttachment(): Boolean {
var cached = enableEagerRootViewAttachmentCache
if (cached == null) {
@@ -293,15 +302,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
return cached
}
override fun enableMainQueueModulesOnIOS(): Boolean {
var cached = enableMainQueueModulesOnIOSCache
if (cached == null) {
cached = ReactNativeFeatureFlagsCxxInterop.enableMainQueueModulesOnIOS()
enableMainQueueModulesOnIOSCache = cached
}
return cached
}
override fun enableModuleArgumentNSNullConversionIOS(): Boolean {
var cached = enableModuleArgumentNSNullConversionIOSCache
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<<bfa5d2ae272c5645cee6aec1328aba77>>
* @generated SignedSource<<9588b972841baa23bd3bb3b7326b4710>>
*/
/**
@@ -54,6 +54,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableDoubleMeasurementFixAndroid(): Boolean
@DoNotStrip @JvmStatic public external fun enableEagerMainQueueModulesOnIOS(): Boolean
@DoNotStrip @JvmStatic public external fun enableEagerRootViewAttachment(): Boolean
@DoNotStrip @JvmStatic public external fun enableFabricLogs(): Boolean
@@ -76,8 +78,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
@DoNotStrip @JvmStatic public external fun enableMainQueueCoordinatorOnIOS(): Boolean
@DoNotStrip @JvmStatic public external fun enableMainQueueModulesOnIOS(): Boolean
@DoNotStrip @JvmStatic public external fun enableModuleArgumentNSNullConversionIOS(): Boolean
@DoNotStrip @JvmStatic public external fun enableNativeCSSParsing(): 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<<50fc180b1ab286ab9c03ea171b6fad06>>
* @generated SignedSource<<7b6a844d99839c72647d6685d72f6896>>
*/
/**
@@ -49,6 +49,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableDoubleMeasurementFixAndroid(): Boolean = false
override fun enableEagerMainQueueModulesOnIOS(): Boolean = false
override fun enableEagerRootViewAttachment(): Boolean = false
override fun enableFabricLogs(): Boolean = false
@@ -71,8 +73,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
override fun enableMainQueueCoordinatorOnIOS(): Boolean = false
override fun enableMainQueueModulesOnIOS(): Boolean = false
override fun enableModuleArgumentNSNullConversionIOS(): Boolean = false
override fun enableNativeCSSParsing(): 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<<7eba68c1825ec1f35955a11c0fd5f982>>
* @generated SignedSource<<d6024891cd1852741976e94cd6d637c6>>
*/
/**
@@ -37,6 +37,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableCustomFocusSearchOnClippedElementsAndroidCache: Boolean? = null
private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null
private var enableDoubleMeasurementFixAndroidCache: Boolean? = null
private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null
private var enableEagerRootViewAttachmentCache: Boolean? = null
private var enableFabricLogsCache: Boolean? = null
private var enableFabricRendererCache: Boolean? = null
@@ -48,7 +49,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
private var enableLayoutAnimationsOnAndroidCache: Boolean? = null
private var enableLayoutAnimationsOnIOSCache: Boolean? = null
private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null
private var enableMainQueueModulesOnIOSCache: Boolean? = null
private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null
private var enableNativeCSSParsingCache: Boolean? = null
private var enableNetworkEventReportingCache: Boolean? = null
@@ -211,6 +211,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun enableEagerMainQueueModulesOnIOS(): Boolean {
var cached = enableEagerMainQueueModulesOnIOSCache
if (cached == null) {
cached = currentProvider.enableEagerMainQueueModulesOnIOS()
accessedFeatureFlags.add("enableEagerMainQueueModulesOnIOS")
enableEagerMainQueueModulesOnIOSCache = cached
}
return cached
}
override fun enableEagerRootViewAttachment(): Boolean {
var cached = enableEagerRootViewAttachmentCache
if (cached == null) {
@@ -321,16 +331,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
return cached
}
override fun enableMainQueueModulesOnIOS(): Boolean {
var cached = enableMainQueueModulesOnIOSCache
if (cached == null) {
cached = currentProvider.enableMainQueueModulesOnIOS()
accessedFeatureFlags.add("enableMainQueueModulesOnIOS")
enableMainQueueModulesOnIOSCache = cached
}
return cached
}
override fun enableModuleArgumentNSNullConversionIOS(): Boolean {
var cached = enableModuleArgumentNSNullConversionIOSCache
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<<ddee738589d3b0d95ff9d1f7ff18ed12>>
* @generated SignedSource<<391d35ccb9b7004fd8d9643df9a08ab5>>
*/
/**
@@ -49,6 +49,8 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableDoubleMeasurementFixAndroid(): Boolean
@DoNotStrip public fun enableEagerMainQueueModulesOnIOS(): Boolean
@DoNotStrip public fun enableEagerRootViewAttachment(): Boolean
@DoNotStrip public fun enableFabricLogs(): Boolean
@@ -71,8 +73,6 @@ public interface ReactNativeFeatureFlagsProvider {
@DoNotStrip public fun enableMainQueueCoordinatorOnIOS(): Boolean
@DoNotStrip public fun enableMainQueueModulesOnIOS(): Boolean
@DoNotStrip public fun enableModuleArgumentNSNullConversionIOS(): Boolean
@DoNotStrip public fun enableNativeCSSParsing(): 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<<08a4e8f9c543a25fc3665753cf7055ef>>
* @generated SignedSource<<62ecfcd8d00ce03d659715bbb3f4a235>>
*/
/**
@@ -117,6 +117,12 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool enableEagerMainQueueModulesOnIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEagerMainQueueModulesOnIOS");
return method(javaProvider_);
}
bool enableEagerRootViewAttachment() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableEagerRootViewAttachment");
@@ -183,12 +189,6 @@ class ReactNativeFeatureFlagsJavaProvider
return method(javaProvider_);
}
bool enableMainQueueModulesOnIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableMainQueueModulesOnIOS");
return method(javaProvider_);
}
bool enableModuleArgumentNSNullConversionIOS() override {
static const auto method =
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("enableModuleArgumentNSNullConversionIOS");
@@ -444,6 +444,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid(
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
}
bool JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS();
}
bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
@@ -499,11 +504,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS(
return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS();
}
bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableMainQueueModulesOnIOS();
}
bool JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
@@ -729,6 +729,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableDoubleMeasurementFixAndroid",
JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid),
makeNativeMethod(
"enableEagerMainQueueModulesOnIOS",
JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS),
makeNativeMethod(
"enableEagerRootViewAttachment",
JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment),
@@ -762,9 +765,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
makeNativeMethod(
"enableMainQueueCoordinatorOnIOS",
JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS),
makeNativeMethod(
"enableMainQueueModulesOnIOS",
JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS),
makeNativeMethod(
"enableModuleArgumentNSNullConversionIOS",
JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS),
@@ -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<<fbf3153227b6420c791f991473c8309d>>
* @generated SignedSource<<ec300827bf856bec4f381351be4fae21>>
*/
/**
@@ -69,6 +69,9 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableDoubleMeasurementFixAndroid(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableEagerMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableEagerRootViewAttachment(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -102,9 +105,6 @@ class JReactNativeFeatureFlagsCxxInterop
static bool enableMainQueueCoordinatorOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableModuleArgumentNSNullConversionIOS(
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<<5a411f2cf98c860afac513e9545ade29>>
* @generated SignedSource<<03e0a51aa0f46ee7ad956b2a02192c2e>>
*/
/**
@@ -78,6 +78,10 @@ bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() {
return getAccessor().enableDoubleMeasurementFixAndroid();
}
bool ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS() {
return getAccessor().enableEagerMainQueueModulesOnIOS();
}
bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() {
return getAccessor().enableEagerRootViewAttachment();
}
@@ -122,10 +126,6 @@ bool ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS() {
return getAccessor().enableMainQueueCoordinatorOnIOS();
}
bool ReactNativeFeatureFlags::enableMainQueueModulesOnIOS() {
return getAccessor().enableMainQueueModulesOnIOS();
}
bool ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS() {
return getAccessor().enableModuleArgumentNSNullConversionIOS();
}
@@ -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<<7f9a1e13365f6b035465869e1adcaaaf>>
* @generated SignedSource<<e6c1138d3b50c0a8db0194828b448741>>
*/
/**
@@ -104,6 +104,11 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableDoubleMeasurementFixAndroid();
/**
* This infra allows native modules to initialize on the main thread, during React Native init.
*/
RN_EXPORT static bool enableEagerMainQueueModulesOnIOS();
/**
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
*/
@@ -159,11 +164,6 @@ class ReactNativeFeatureFlags {
*/
RN_EXPORT static bool enableMainQueueCoordinatorOnIOS();
/**
* Makes modules requiring main queue setup initialize on the main thread, during React Native init.
*/
RN_EXPORT static bool enableMainQueueModulesOnIOS();
/**
* Enable NSNull conversion when handling module arguments on iOS
*/
@@ -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<<f885e902edaa3bf22fbb20378cd79c6b>>
* @generated SignedSource<<8dc8477fa5453260c803e37fb8c7f47c>>
*/
/**
@@ -263,6 +263,24 @@ bool ReactNativeFeatureFlagsAccessor::enableDoubleMeasurementFixAndroid() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableEagerMainQueueModulesOnIOS() {
auto flagValue = enableEagerMainQueueModulesOnIOS_.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(13, "enableEagerMainQueueModulesOnIOS");
flagValue = currentProvider_->enableEagerMainQueueModulesOnIOS();
enableEagerMainQueueModulesOnIOS_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
auto flagValue = enableEagerRootViewAttachment_.load();
@@ -272,7 +290,7 @@ bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(13, "enableEagerRootViewAttachment");
markFlagAsAccessed(14, "enableEagerRootViewAttachment");
flagValue = currentProvider_->enableEagerRootViewAttachment();
enableEagerRootViewAttachment_ = flagValue;
@@ -290,7 +308,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricLogs() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(14, "enableFabricLogs");
markFlagAsAccessed(15, "enableFabricLogs");
flagValue = currentProvider_->enableFabricLogs();
enableFabricLogs_ = flagValue;
@@ -308,7 +326,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricRenderer() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(15, "enableFabricRenderer");
markFlagAsAccessed(16, "enableFabricRenderer");
flagValue = currentProvider_->enableFabricRenderer();
enableFabricRenderer_ = flagValue;
@@ -326,7 +344,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFixForParentTagDuringReparenting() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(16, "enableFixForParentTagDuringReparenting");
markFlagAsAccessed(17, "enableFixForParentTagDuringReparenting");
flagValue = currentProvider_->enableFixForParentTagDuringReparenting();
enableFixForParentTagDuringReparenting_ = flagValue;
@@ -344,7 +362,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFontScaleChangesUpdatingLayout() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(17, "enableFontScaleChangesUpdatingLayout");
markFlagAsAccessed(18, "enableFontScaleChangesUpdatingLayout");
flagValue = currentProvider_->enableFontScaleChangesUpdatingLayout();
enableFontScaleChangesUpdatingLayout_ = flagValue;
@@ -362,7 +380,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIOSTextBaselineOffsetPerLine() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(18, "enableIOSTextBaselineOffsetPerLine");
markFlagAsAccessed(19, "enableIOSTextBaselineOffsetPerLine");
flagValue = currentProvider_->enableIOSTextBaselineOffsetPerLine();
enableIOSTextBaselineOffsetPerLine_ = flagValue;
@@ -380,7 +398,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(19, "enableIOSViewClipToPaddingBox");
markFlagAsAccessed(20, "enableIOSViewClipToPaddingBox");
flagValue = currentProvider_->enableIOSViewClipToPaddingBox();
enableIOSViewClipToPaddingBox_ = flagValue;
@@ -398,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enableInteropViewManagerClassLookUpOptimiz
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(20, "enableInteropViewManagerClassLookUpOptimizationIOS");
markFlagAsAccessed(21, "enableInteropViewManagerClassLookUpOptimizationIOS");
flagValue = currentProvider_->enableInteropViewManagerClassLookUpOptimizationIOS();
enableInteropViewManagerClassLookUpOptimizationIOS_ = flagValue;
@@ -416,7 +434,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(21, "enableLayoutAnimationsOnAndroid");
markFlagAsAccessed(22, "enableLayoutAnimationsOnAndroid");
flagValue = currentProvider_->enableLayoutAnimationsOnAndroid();
enableLayoutAnimationsOnAndroid_ = flagValue;
@@ -434,7 +452,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(22, "enableLayoutAnimationsOnIOS");
markFlagAsAccessed(23, "enableLayoutAnimationsOnIOS");
flagValue = currentProvider_->enableLayoutAnimationsOnIOS();
enableLayoutAnimationsOnIOS_ = flagValue;
@@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMainQueueCoordinatorOnIOS() {
// be accessing the provider multiple times but the end state of this
// instance and the returned flag value would be the same.
markFlagAsAccessed(23, "enableMainQueueCoordinatorOnIOS");
markFlagAsAccessed(24, "enableMainQueueCoordinatorOnIOS");
flagValue = currentProvider_->enableMainQueueCoordinatorOnIOS();
enableMainQueueCoordinatorOnIOS_ = flagValue;
@@ -461,24 +479,6 @@ bool ReactNativeFeatureFlagsAccessor::enableMainQueueCoordinatorOnIOS() {
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableMainQueueModulesOnIOS() {
auto flagValue = enableMainQueueModulesOnIOS_.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(24, "enableMainQueueModulesOnIOS");
flagValue = currentProvider_->enableMainQueueModulesOnIOS();
enableMainQueueModulesOnIOS_ = flagValue;
}
return flagValue.value();
}
bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS() {
auto flagValue = enableModuleArgumentNSNullConversionIOS_.load();
@@ -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<<1c29a131d097a9cdb433b8e88b341f00>>
* @generated SignedSource<<4e06f35e1af18fbf5219f7fd2f79767d>>
*/
/**
@@ -45,6 +45,7 @@ class ReactNativeFeatureFlagsAccessor {
bool enableCustomFocusSearchOnClippedElementsAndroid();
bool enableDestroyShadowTreeRevisionAsync();
bool enableDoubleMeasurementFixAndroid();
bool enableEagerMainQueueModulesOnIOS();
bool enableEagerRootViewAttachment();
bool enableFabricLogs();
bool enableFabricRenderer();
@@ -56,7 +57,6 @@ class ReactNativeFeatureFlagsAccessor {
bool enableLayoutAnimationsOnAndroid();
bool enableLayoutAnimationsOnIOS();
bool enableMainQueueCoordinatorOnIOS();
bool enableMainQueueModulesOnIOS();
bool enableModuleArgumentNSNullConversionIOS();
bool enableNativeCSSParsing();
bool enableNetworkEventReporting();
@@ -114,6 +114,7 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableCustomFocusSearchOnClippedElementsAndroid_;
std::atomic<std::optional<bool>> enableDestroyShadowTreeRevisionAsync_;
std::atomic<std::optional<bool>> enableDoubleMeasurementFixAndroid_;
std::atomic<std::optional<bool>> enableEagerMainQueueModulesOnIOS_;
std::atomic<std::optional<bool>> enableEagerRootViewAttachment_;
std::atomic<std::optional<bool>> enableFabricLogs_;
std::atomic<std::optional<bool>> enableFabricRenderer_;
@@ -125,7 +126,6 @@ class ReactNativeFeatureFlagsAccessor {
std::atomic<std::optional<bool>> enableLayoutAnimationsOnAndroid_;
std::atomic<std::optional<bool>> enableLayoutAnimationsOnIOS_;
std::atomic<std::optional<bool>> enableMainQueueCoordinatorOnIOS_;
std::atomic<std::optional<bool>> enableMainQueueModulesOnIOS_;
std::atomic<std::optional<bool>> enableModuleArgumentNSNullConversionIOS_;
std::atomic<std::optional<bool>> enableNativeCSSParsing_;
std::atomic<std::optional<bool>> enableNetworkEventReporting_;
@@ -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<<e47ca0b05d17a175c2fc522bc6088300>>
* @generated SignedSource<<a16b227254e43d57c46479d87bc45bf2>>
*/
/**
@@ -79,6 +79,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableEagerMainQueueModulesOnIOS() override {
return false;
}
bool enableEagerRootViewAttachment() override {
return false;
}
@@ -123,10 +127,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider {
return false;
}
bool enableMainQueueModulesOnIOS() override {
return false;
}
bool enableModuleArgumentNSNullConversionIOS() 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<<cac15150a01cd911e14f47a4979531b9>>
* @generated SignedSource<<015e26c40f3a6bef540d8c4ca43b8502>>
*/
/**
@@ -162,6 +162,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::enableDoubleMeasurementFixAndroid();
}
bool enableEagerMainQueueModulesOnIOS() override {
auto value = values_["enableEagerMainQueueModulesOnIOS"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::enableEagerMainQueueModulesOnIOS();
}
bool enableEagerRootViewAttachment() override {
auto value = values_["enableEagerRootViewAttachment"];
if (!value.isNull()) {
@@ -261,15 +270,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef
return ReactNativeFeatureFlagsDefaults::enableMainQueueCoordinatorOnIOS();
}
bool enableMainQueueModulesOnIOS() override {
auto value = values_["enableMainQueueModulesOnIOS"];
if (!value.isNull()) {
return value.getBool();
}
return ReactNativeFeatureFlagsDefaults::enableMainQueueModulesOnIOS();
}
bool enableModuleArgumentNSNullConversionIOS() override {
auto value = values_["enableModuleArgumentNSNullConversionIOS"];
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<<037acd19008660ca0740c9f256d45942>>
* @generated SignedSource<<f3e838bc19232c5b2bb539133c825a71>>
*/
/**
@@ -38,6 +38,7 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableCustomFocusSearchOnClippedElementsAndroid() = 0;
virtual bool enableDestroyShadowTreeRevisionAsync() = 0;
virtual bool enableDoubleMeasurementFixAndroid() = 0;
virtual bool enableEagerMainQueueModulesOnIOS() = 0;
virtual bool enableEagerRootViewAttachment() = 0;
virtual bool enableFabricLogs() = 0;
virtual bool enableFabricRenderer() = 0;
@@ -49,7 +50,6 @@ class ReactNativeFeatureFlagsProvider {
virtual bool enableLayoutAnimationsOnAndroid() = 0;
virtual bool enableLayoutAnimationsOnIOS() = 0;
virtual bool enableMainQueueCoordinatorOnIOS() = 0;
virtual bool enableMainQueueModulesOnIOS() = 0;
virtual bool enableModuleArgumentNSNullConversionIOS() = 0;
virtual bool enableNativeCSSParsing() = 0;
virtual bool enableNetworkEventReporting() = 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<<1248a1cd10f3cd2758d4ad59d0370d72>>
* @generated SignedSource<<09ffa5d69974c01761505c26a61ce865>>
*/
/**
@@ -109,6 +109,11 @@ bool NativeReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid(
return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid();
}
bool NativeReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS();
}
bool NativeReactNativeFeatureFlags::enableEagerRootViewAttachment(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableEagerRootViewAttachment();
@@ -164,11 +169,6 @@ bool NativeReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS(
return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS();
}
bool NativeReactNativeFeatureFlags::enableMainQueueModulesOnIOS(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableMainQueueModulesOnIOS();
}
bool NativeReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS(
jsi::Runtime& /*runtime*/) {
return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS();
@@ -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<<eb35a50010ea6ec498effca40fafc991>>
* @generated SignedSource<<736f6e9a9941d0a9a6fbde5c038f1622>>
*/
/**
@@ -62,6 +62,8 @@ class NativeReactNativeFeatureFlags
bool enableDoubleMeasurementFixAndroid(jsi::Runtime& runtime);
bool enableEagerMainQueueModulesOnIOS(jsi::Runtime& runtime);
bool enableEagerRootViewAttachment(jsi::Runtime& runtime);
bool enableFabricLogs(jsi::Runtime& runtime);
@@ -84,8 +86,6 @@ class NativeReactNativeFeatureFlags
bool enableMainQueueCoordinatorOnIOS(jsi::Runtime& runtime);
bool enableMainQueueModulesOnIOS(jsi::Runtime& runtime);
bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime& runtime);
bool enableNativeCSSParsing(jsi::Runtime& runtime);
@@ -341,7 +341,7 @@ void RCTInstanceSetRuntimeDiagnosticFlags(NSString *flags)
// Initialize RCTModuleRegistry so that TurboModules can require other TurboModules.
[_bridgeModuleDecorator.moduleRegistry setTurboModuleRegistry:_turboModuleManager];
if (ReactNativeFeatureFlags::enableMainQueueModulesOnIOS()) {
if (ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS()) {
/**
* Some native modules need to capture uikit objects on the main thread.
* Start initializing those modules on the main queue here. The JavaScript thread
@@ -188,6 +188,16 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'none',
},
enableEagerMainQueueModulesOnIOS: {
defaultValue: false,
metadata: {
description:
'This infra allows native modules to initialize on the main thread, during React Native init.',
expectedReleaseValue: true,
purpose: 'release',
},
ossReleaseStage: 'none',
},
enableEagerRootViewAttachment: {
defaultValue: false,
metadata: {
@@ -302,16 +312,6 @@ const definitions: FeatureFlagDefinitions = {
},
ossReleaseStage: 'none',
},
enableMainQueueModulesOnIOS: {
defaultValue: false,
metadata: {
description:
'Makes modules requiring main queue setup initialize on the main thread, during React Native init.',
expectedReleaseValue: true,
purpose: 'release',
},
ossReleaseStage: 'none',
},
enableModuleArgumentNSNullConversionIOS: {
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<<a5ebc619798b4421e67c76eb4c9edbae>>
* @generated SignedSource<<b680260e184df469f918d2bf4a3a4e65>>
* @flow strict
* @noformat
*/
@@ -64,6 +64,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
enableCustomFocusSearchOnClippedElementsAndroid: Getter<boolean>,
enableDestroyShadowTreeRevisionAsync: Getter<boolean>,
enableDoubleMeasurementFixAndroid: Getter<boolean>,
enableEagerMainQueueModulesOnIOS: Getter<boolean>,
enableEagerRootViewAttachment: Getter<boolean>,
enableFabricLogs: Getter<boolean>,
enableFabricRenderer: Getter<boolean>,
@@ -75,7 +76,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{
enableLayoutAnimationsOnAndroid: Getter<boolean>,
enableLayoutAnimationsOnIOS: Getter<boolean>,
enableMainQueueCoordinatorOnIOS: Getter<boolean>,
enableMainQueueModulesOnIOS: Getter<boolean>,
enableModuleArgumentNSNullConversionIOS: Getter<boolean>,
enableNativeCSSParsing: Getter<boolean>,
enableNetworkEventReporting: Getter<boolean>,
@@ -245,6 +245,10 @@ export const enableDestroyShadowTreeRevisionAsync: Getter<boolean> = createNativ
* When enabled a subset of components will avoid double measurement on Android.
*/
export const enableDoubleMeasurementFixAndroid: Getter<boolean> = createNativeFlagGetter('enableDoubleMeasurementFixAndroid', false);
/**
* This infra allows native modules to initialize on the main thread, during React Native init.
*/
export const enableEagerMainQueueModulesOnIOS: Getter<boolean> = createNativeFlagGetter('enableEagerMainQueueModulesOnIOS', false);
/**
* Feature flag to configure eager attachment of the root view/initialisation of the JS code.
*/
@@ -289,10 +293,6 @@ export const enableLayoutAnimationsOnIOS: Getter<boolean> = createNativeFlagGett
* Make RCTUnsafeExecuteOnMainQueueSync less likely to deadlock, when used in conjuction with sync rendering/events.
*/
export const enableMainQueueCoordinatorOnIOS: Getter<boolean> = createNativeFlagGetter('enableMainQueueCoordinatorOnIOS', false);
/**
* Makes modules requiring main queue setup initialize on the main thread, during React Native init.
*/
export const enableMainQueueModulesOnIOS: Getter<boolean> = createNativeFlagGetter('enableMainQueueModulesOnIOS', false);
/**
* Enable NSNull conversion when handling module arguments on iOS
*/
@@ -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<<6e983c236968a0b11c278dadf2205b5f>>
* @generated SignedSource<<a0c97a9338cbe91cc3de4db2fa5f27d2>>
* @flow strict
* @noformat
*/
@@ -38,6 +38,7 @@ export interface Spec extends TurboModule {
+enableCustomFocusSearchOnClippedElementsAndroid?: () => boolean;
+enableDestroyShadowTreeRevisionAsync?: () => boolean;
+enableDoubleMeasurementFixAndroid?: () => boolean;
+enableEagerMainQueueModulesOnIOS?: () => boolean;
+enableEagerRootViewAttachment?: () => boolean;
+enableFabricLogs?: () => boolean;
+enableFabricRenderer?: () => boolean;
@@ -49,7 +50,6 @@ export interface Spec extends TurboModule {
+enableLayoutAnimationsOnAndroid?: () => boolean;
+enableLayoutAnimationsOnIOS?: () => boolean;
+enableMainQueueCoordinatorOnIOS?: () => boolean;
+enableMainQueueModulesOnIOS?: () => boolean;
+enableModuleArgumentNSNullConversionIOS?: () => boolean;
+enableNativeCSSParsing?: () => boolean;
+enableNetworkEventReporting?: () => boolean;
+2 -2
View File
@@ -6675,7 +6675,7 @@ class JReactNativeFeatureFlagsCxxInterop
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableMainQueueCoordinatorOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableMainQueueModulesOnIOS(
static bool enableEagerMainQueueModulesOnIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
static bool enableModuleArgumentNSNullConversionIOS(
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
@@ -16872,7 +16872,7 @@ class NativeReactNativeFeatureFlags
bool enableLayoutAnimationsOnAndroid(jsi::Runtime& runtime);
bool enableLayoutAnimationsOnIOS(jsi::Runtime& runtime);
bool enableMainQueueCoordinatorOnIOS(jsi::Runtime& runtime);
bool enableMainQueueModulesOnIOS(jsi::Runtime& runtime);
bool enableEagerMainQueueModulesOnIOS(jsi::Runtime& runtime);
bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime& runtime);
bool enableNativeCSSParsing(jsi::Runtime& runtime);
bool enableNetworkEventReporting(jsi::Runtime& runtime);