From 521d1ba66fa9a80dc98fcab41349f6b6e356fe9e Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 22 May 2026 02:55:12 -0700 Subject: [PATCH 1/5] Use dispatch_semaphore for eager-main-queue module setup gate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Replace the `std::mutex` + `std::condition_variable` + `std::shared_ptr` trio that gates the JS thread on main-queue module construction with a single `dispatch_semaphore_t`. The wait block is invoked exactly once (from `_loadScriptFromSource:`'s `beforeLoad` lambda), so single-shot semaphore semantics fit the contract directly — no condition predicate, no shared state captured by three independent `shared_ptr`s. Net: 12 lines deleted, 1 captured object instead of 3, no behavior change. Changelog: [Internal] Differential Revision: D105953979 --- .../runtime/platform/ios/ReactCommon/RCTInstance.mm | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index d065b1b7943d..0cdbb3183f5b 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -379,13 +379,10 @@ - (void)_start */ NSArray *modulesRequiringMainQueueSetup = [_delegate unstableModulesRequiringMainQueueSetup]; - std::shared_ptr mutex = std::make_shared(); - std::shared_ptr cv = std::make_shared(); - std::shared_ptr isReady = std::make_shared(false); + dispatch_semaphore_t moduleSetupComplete = dispatch_semaphore_create(0); _waitUntilModuleSetupComplete = ^{ - std::unique_lock lock(*mutex); - cv->wait(lock, [isReady] { return *isReady; }); + dispatch_semaphore_wait(moduleSetupComplete, DISPATCH_TIME_FOREVER); }; // TODO(T218039767): Integrate perf logging into main queue module init @@ -398,9 +395,7 @@ - (void)_start RCTScreenScale(); RCTSwitchSize(); - std::lock_guard lock(*mutex); - *isReady = true; - cv->notify_all(); + dispatch_semaphore_signal(moduleSetupComplete); }); } From 53fa4299ca9b50811acdf9b15feedd77216cabc2 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 22 May 2026 02:56:52 -0700 Subject: [PATCH 2/5] Remove enableEagerMainQueueModulesOnIOS, make eager main-queue setup always-on Summary: The `enableEagerMainQueueModulesOnIOS` runtime gate has finished rollout and is no longer needed. Drop the flag from the feature-flag config, regenerate the per-language accessors, and inline the previously-gated body in `RCTInstance._start` so the eager main-queue module setup always runs. Also drops the now-dead override and trims the test that exercised the flag-off branch. After this change, when `RCTInstance` starts up, it always consults `RCTInstanceDelegate.unstableModulesRequiringMainQueueSetup`, initializes the returned modules on the main queue, and blocks the JS thread on that completion before evaluating the bundle. Changelog: [iOS][Changed] - Native modules listed in `unstableModulesRequiringMainQueueSetup` are now always initialized eagerly on the main queue during React Native init; the previous `enableEagerMainQueueModulesOnIOS` opt-in flag has been removed. Differential Revision: D105954235 --- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 160 ++++++++---------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../runtime/iostests/RCTInstanceTests.mm | 38 +---- .../platform/ios/ReactCommon/RCTInstance.mm | 42 +++-- .../ReactNativeFeatureFlags.config.js | 10 -- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 22 files changed, 113 insertions(+), 263 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index cbac4cab1576..c3d46811f0c4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<8b35aa70eea734a8bfcbb7bd651ba8e2>> + * @generated SignedSource<<23b48657a64e620a108351385cac9f79>> */ /** @@ -144,12 +144,6 @@ 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. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index d8c9e5e2c8d3..01f674c94c90 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<494ed85c58f80b4feb6fb9b83fe7a27e>> + * @generated SignedSource<> */ /** @@ -39,7 +39,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null private var enableDoubleMeasurementFixAndroidCache: Boolean? = null - private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null private var enableEagerRootViewAttachmentCache: Boolean? = null private var enableExclusivePropsUpdateAndroidCache: Boolean? = null private var enableFabricCommitBranchingCache: Boolean? = null @@ -282,15 +281,6 @@ 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) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 56cefe7e962c..6654acebb845 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<16ca9a4b47da90ea71300eb37287e28b>> + * @generated SignedSource<<32026408e198a903deb51eeb6157d3c5>> */ /** @@ -66,8 +66,6 @@ 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 enableExclusivePropsUpdateAndroid(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index b8eaefddb441..b5b673bea6f2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<10e6516b3c9cf53ae2e48c8b8cd51033>> + * @generated SignedSource<> */ /** @@ -61,8 +61,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableDoubleMeasurementFixAndroid(): Boolean = false - override fun enableEagerMainQueueModulesOnIOS(): Boolean = false - override fun enableEagerRootViewAttachment(): Boolean = false override fun enableExclusivePropsUpdateAndroid(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index add1468147a9..40e674b77032 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<441fe8be28d4521e1fe9fe7b87b74cf2>> + * @generated SignedSource<> */ /** @@ -43,7 +43,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableDestroyShadowTreeRevisionAsyncCache: Boolean? = null private var enableDifferentiatorMutationVectorPreallocationCache: Boolean? = null private var enableDoubleMeasurementFixAndroidCache: Boolean? = null - private var enableEagerMainQueueModulesOnIOSCache: Boolean? = null private var enableEagerRootViewAttachmentCache: Boolean? = null private var enableExclusivePropsUpdateAndroidCache: Boolean? = null private var enableFabricCommitBranchingCache: Boolean? = null @@ -305,16 +304,6 @@ 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) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 622433ab7be3..3c7244334819 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<972dbaef144818484bafff334cf97ef2>> + * @generated SignedSource<> */ /** @@ -61,8 +61,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableDoubleMeasurementFixAndroid(): Boolean - @DoNotStrip public fun enableEagerMainQueueModulesOnIOS(): Boolean - @DoNotStrip public fun enableEagerRootViewAttachment(): Boolean @DoNotStrip public fun enableExclusivePropsUpdateAndroid(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 39af8adebf72..500eeddc8697 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<37167dea60330101b87d35ee9cbd8531>> */ /** @@ -153,12 +153,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableEagerMainQueueModulesOnIOS() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableEagerMainQueueModulesOnIOS"); - return method(javaProvider_); - } - bool enableEagerRootViewAttachment() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableEagerRootViewAttachment"); @@ -678,11 +672,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid( return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid(); } -bool JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS(); -} - bool JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::enableEagerRootViewAttachment(); @@ -1121,9 +1110,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableDoubleMeasurementFixAndroid", JReactNativeFeatureFlagsCxxInterop::enableDoubleMeasurementFixAndroid), - makeNativeMethod( - "enableEagerMainQueueModulesOnIOS", - JReactNativeFeatureFlagsCxxInterop::enableEagerMainQueueModulesOnIOS), makeNativeMethod( "enableEagerRootViewAttachment", JReactNativeFeatureFlagsCxxInterop::enableEagerRootViewAttachment), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index a2549866de41..862bf17ee364 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3007628255a078dafc01eb16b3d55fbe>> + * @generated SignedSource<> */ /** @@ -87,9 +87,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableDoubleMeasurementFixAndroid( facebook::jni::alias_ref); - static bool enableEagerMainQueueModulesOnIOS( - facebook::jni::alias_ref); - static bool enableEagerRootViewAttachment( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 73cd464155ca..37dec3e5f476 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5c308b51617953c21d3ae60dc8c530bb>> + * @generated SignedSource<<30c0afbb7c40ba8953e5ffb692224a34>> */ /** @@ -102,10 +102,6 @@ bool ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid() { return getAccessor().enableDoubleMeasurementFixAndroid(); } -bool ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS() { - return getAccessor().enableEagerMainQueueModulesOnIOS(); -} - bool ReactNativeFeatureFlags::enableEagerRootViewAttachment() { return getAccessor().enableEagerRootViewAttachment(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 9b23f06a34e5..95ad0a1583f1 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -134,11 +134,6 @@ 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. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 444a64318c34..ac1480c623c8 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<881e6059574bdce33654620eb847a0fc>> */ /** @@ -371,24 +371,6 @@ 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(19, "enableEagerMainQueueModulesOnIOS"); - - flagValue = currentProvider_->enableEagerMainQueueModulesOnIOS(); - enableEagerMainQueueModulesOnIOS_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::enableEagerRootViewAttachment() { auto flagValue = enableEagerRootViewAttachment_.load(); @@ -398,7 +380,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(20, "enableEagerRootViewAttachment"); + markFlagAsAccessed(19, "enableEagerRootViewAttachment"); flagValue = currentProvider_->enableEagerRootViewAttachment(); enableEagerRootViewAttachment_ = flagValue; @@ -416,7 +398,7 @@ bool ReactNativeFeatureFlagsAccessor::enableExclusivePropsUpdateAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(21, "enableExclusivePropsUpdateAndroid"); + markFlagAsAccessed(20, "enableExclusivePropsUpdateAndroid"); flagValue = currentProvider_->enableExclusivePropsUpdateAndroid(); enableExclusivePropsUpdateAndroid_ = flagValue; @@ -434,7 +416,7 @@ bool ReactNativeFeatureFlagsAccessor::enableFabricCommitBranching() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(22, "enableFabricCommitBranching"); + markFlagAsAccessed(21, "enableFabricCommitBranching"); flagValue = currentProvider_->enableFabricCommitBranching(); enableFabricCommitBranching_ = flagValue; @@ -452,7 +434,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(23, "enableFabricLogs"); + markFlagAsAccessed(22, "enableFabricLogs"); flagValue = currentProvider_->enableFabricLogs(); enableFabricLogs_ = flagValue; @@ -470,7 +452,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(24, "enableFontScaleChangesUpdatingLayout"); + markFlagAsAccessed(23, "enableFontScaleChangesUpdatingLayout"); flagValue = currentProvider_->enableFontScaleChangesUpdatingLayout(); enableFontScaleChangesUpdatingLayout_ = flagValue; @@ -488,7 +470,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(25, "enableIOSTextBaselineOffsetPerLine"); + markFlagAsAccessed(24, "enableIOSTextBaselineOffsetPerLine"); flagValue = currentProvider_->enableIOSTextBaselineOffsetPerLine(); enableIOSTextBaselineOffsetPerLine_ = flagValue; @@ -506,7 +488,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(26, "enableIOSViewClipToPaddingBox"); + markFlagAsAccessed(25, "enableIOSViewClipToPaddingBox"); flagValue = currentProvider_->enableIOSViewClipToPaddingBox(); enableIOSViewClipToPaddingBox_ = flagValue; @@ -524,7 +506,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImagePrefetchingAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(27, "enableImagePrefetchingAndroid"); + markFlagAsAccessed(26, "enableImagePrefetchingAndroid"); flagValue = currentProvider_->enableImagePrefetchingAndroid(); enableImagePrefetchingAndroid_ = flagValue; @@ -542,7 +524,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImmediateUpdateModeForContentOffsetC // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(28, "enableImmediateUpdateModeForContentOffsetChanges"); + markFlagAsAccessed(27, "enableImmediateUpdateModeForContentOffsetChanges"); flagValue = currentProvider_->enableImmediateUpdateModeForContentOffsetChanges(); enableImmediateUpdateModeForContentOffsetChanges_ = flagValue; @@ -560,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::enableImperativeFocus() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(29, "enableImperativeFocus"); + markFlagAsAccessed(28, "enableImperativeFocus"); flagValue = currentProvider_->enableImperativeFocus(); enableImperativeFocus_ = flagValue; @@ -578,7 +560,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(30, "enableInteropViewManagerClassLookUpOptimizationIOS"); + markFlagAsAccessed(29, "enableInteropViewManagerClassLookUpOptimizationIOS"); flagValue = currentProvider_->enableInteropViewManagerClassLookUpOptimizationIOS(); enableInteropViewManagerClassLookUpOptimizationIOS_ = flagValue; @@ -596,7 +578,7 @@ bool ReactNativeFeatureFlagsAccessor::enableIntersectionObserverByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(31, "enableIntersectionObserverByDefault"); + markFlagAsAccessed(30, "enableIntersectionObserverByDefault"); flagValue = currentProvider_->enableIntersectionObserverByDefault(); enableIntersectionObserverByDefault_ = flagValue; @@ -614,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::enableKeyEvents() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(32, "enableKeyEvents"); + markFlagAsAccessed(31, "enableKeyEvents"); flagValue = currentProvider_->enableKeyEvents(); enableKeyEvents_ = flagValue; @@ -632,7 +614,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(33, "enableLayoutAnimationsOnAndroid"); + markFlagAsAccessed(32, "enableLayoutAnimationsOnAndroid"); flagValue = currentProvider_->enableLayoutAnimationsOnAndroid(); enableLayoutAnimationsOnAndroid_ = flagValue; @@ -650,7 +632,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(34, "enableLayoutAnimationsOnIOS"); + markFlagAsAccessed(33, "enableLayoutAnimationsOnIOS"); flagValue = currentProvider_->enableLayoutAnimationsOnIOS(); enableLayoutAnimationsOnIOS_ = flagValue; @@ -668,7 +650,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(35, "enableMainQueueCoordinatorOnIOS"); + markFlagAsAccessed(34, "enableMainQueueCoordinatorOnIOS"); flagValue = currentProvider_->enableMainQueueCoordinatorOnIOS(); enableMainQueueCoordinatorOnIOS_ = flagValue; @@ -686,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(36, "enableModuleArgumentNSNullConversionIOS"); + markFlagAsAccessed(35, "enableModuleArgumentNSNullConversionIOS"); flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS(); enableModuleArgumentNSNullConversionIOS_ = flagValue; @@ -704,7 +686,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMutationObserverByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(37, "enableMutationObserverByDefault"); + markFlagAsAccessed(36, "enableMutationObserverByDefault"); flagValue = currentProvider_->enableMutationObserverByDefault(); enableMutationObserverByDefault_ = flagValue; @@ -722,7 +704,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(38, "enableNativeCSSParsing"); + markFlagAsAccessed(37, "enableNativeCSSParsing"); flagValue = currentProvider_->enableNativeCSSParsing(); enableNativeCSSParsing_ = flagValue; @@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNetworkEventReporting() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "enableNetworkEventReporting"); + markFlagAsAccessed(38, "enableNetworkEventReporting"); flagValue = currentProvider_->enableNetworkEventReporting(); enableNetworkEventReporting_ = flagValue; @@ -758,7 +740,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(40, "enablePreparedTextLayout"); + markFlagAsAccessed(39, "enablePreparedTextLayout"); flagValue = currentProvider_->enablePreparedTextLayout(); enablePreparedTextLayout_ = flagValue; @@ -776,7 +758,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(41, "enablePropsUpdateReconciliationAndroid"); + markFlagAsAccessed(40, "enablePropsUpdateReconciliationAndroid"); flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid(); enablePropsUpdateReconciliationAndroid_ = flagValue; @@ -794,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableRuntimeSchedulerQueueClearingOnError // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(42, "enableRuntimeSchedulerQueueClearingOnError"); + markFlagAsAccessed(41, "enableRuntimeSchedulerQueueClearingOnError"); flagValue = currentProvider_->enableRuntimeSchedulerQueueClearingOnError(); enableRuntimeSchedulerQueueClearingOnError_ = flagValue; @@ -812,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSchedulerDelegateInvalidation() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(43, "enableSchedulerDelegateInvalidation"); + markFlagAsAccessed(42, "enableSchedulerDelegateInvalidation"); flagValue = currentProvider_->enableSchedulerDelegateInvalidation(); enableSchedulerDelegateInvalidation_ = flagValue; @@ -830,7 +812,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(44, "enableSwiftUIBasedFilters"); + markFlagAsAccessed(43, "enableSwiftUIBasedFilters"); flagValue = currentProvider_->enableSwiftUIBasedFilters(); enableSwiftUIBasedFilters_ = flagValue; @@ -848,7 +830,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(45, "enableViewCulling"); + markFlagAsAccessed(44, "enableViewCulling"); flagValue = currentProvider_->enableViewCulling(); enableViewCulling_ = flagValue; @@ -866,7 +848,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(46, "enableViewRecycling"); + markFlagAsAccessed(45, "enableViewRecycling"); flagValue = currentProvider_->enableViewRecycling(); enableViewRecycling_ = flagValue; @@ -884,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(47, "enableViewRecyclingForImage"); + markFlagAsAccessed(46, "enableViewRecyclingForImage"); flagValue = currentProvider_->enableViewRecyclingForImage(); enableViewRecyclingForImage_ = flagValue; @@ -902,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(48, "enableViewRecyclingForScrollView"); + markFlagAsAccessed(47, "enableViewRecyclingForScrollView"); flagValue = currentProvider_->enableViewRecyclingForScrollView(); enableViewRecyclingForScrollView_ = flagValue; @@ -920,7 +902,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(49, "enableViewRecyclingForText"); + markFlagAsAccessed(48, "enableViewRecyclingForText"); flagValue = currentProvider_->enableViewRecyclingForText(); enableViewRecyclingForText_ = flagValue; @@ -938,7 +920,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(50, "enableViewRecyclingForView"); + markFlagAsAccessed(49, "enableViewRecyclingForView"); flagValue = currentProvider_->enableViewRecyclingForView(); enableViewRecyclingForView_ = flagValue; @@ -956,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(51, "enableVirtualViewContainerStateExperimental"); + markFlagAsAccessed(50, "enableVirtualViewContainerStateExperimental"); flagValue = currentProvider_->enableVirtualViewContainerStateExperimental(); enableVirtualViewContainerStateExperimental_ = flagValue; @@ -974,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewDebugFeatures() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(52, "enableVirtualViewDebugFeatures"); + markFlagAsAccessed(51, "enableVirtualViewDebugFeatures"); flagValue = currentProvider_->enableVirtualViewDebugFeatures(); enableVirtualViewDebugFeatures_ = flagValue; @@ -992,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fixDifferentiatorParentTagForUnflattenCase"); + markFlagAsAccessed(52, "fixDifferentiatorParentTagForUnflattenCase"); flagValue = currentProvider_->fixDifferentiatorParentTagForUnflattenCase(); fixDifferentiatorParentTagForUnflattenCase_ = flagValue; @@ -1010,7 +992,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(54, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1028,7 +1010,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(55, "fixYogaFlexBasisFitContentInMainAxis"); + markFlagAsAccessed(54, "fixYogaFlexBasisFitContentInMainAxis"); flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis(); fixYogaFlexBasisFitContentInMainAxis_ = flagValue; @@ -1046,7 +1028,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(56, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(55, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1064,7 +1046,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(57, "fuseboxEnabledRelease"); + markFlagAsAccessed(56, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1082,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "fuseboxFrameRecordingEnabled"); + markFlagAsAccessed(57, "fuseboxFrameRecordingEnabled"); flagValue = currentProvider_->fuseboxFrameRecordingEnabled(); fuseboxFrameRecordingEnabled_ = flagValue; @@ -1100,7 +1082,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(59, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(58, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1118,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "fuseboxScreenshotCaptureEnabled"); + markFlagAsAccessed(59, "fuseboxScreenshotCaptureEnabled"); flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled(); fuseboxScreenshotCaptureEnabled_ = flagValue; @@ -1136,7 +1118,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(61, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(60, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1154,7 +1136,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(62, "optimizedAnimatedPropUpdates"); + markFlagAsAccessed(61, "optimizedAnimatedPropUpdates"); flagValue = currentProvider_->optimizedAnimatedPropUpdates(); optimizedAnimatedPropUpdates_ = flagValue; @@ -1172,7 +1154,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(63, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(62, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1190,7 +1172,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(64, "perfIssuesEnabled"); + markFlagAsAccessed(63, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1208,7 +1190,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(65, "perfMonitorV2Enabled"); + markFlagAsAccessed(64, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1226,7 +1208,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(66, "preparedTextCacheSize"); + markFlagAsAccessed(65, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1244,7 +1226,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(67, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(66, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "redBoxV2Android"); + markFlagAsAccessed(67, "redBoxV2Android"); flagValue = currentProvider_->redBoxV2Android(); redBoxV2Android_ = flagValue; @@ -1280,7 +1262,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(69, "redBoxV2IOS"); + markFlagAsAccessed(68, "redBoxV2IOS"); flagValue = currentProvider_->redBoxV2IOS(); redBoxV2IOS_ = 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::syncAndroidClipBoundsWithOverflow() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(73, "syncAndroidClipBoundsWithOverflow"); + markFlagAsAccessed(72, "syncAndroidClipBoundsWithOverflow"); flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow(); syncAndroidClipBoundsWithOverflow_ = 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::useOptimizedViewRegistryOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(81, "useOptimizedViewRegistryOnAndroid"); + markFlagAsAccessed(80, "useOptimizedViewRegistryOnAndroid"); flagValue = currentProvider_->useOptimizedViewRegistryOnAndroid(); useOptimizedViewRegistryOnAndroid_ = flagValue; @@ -1514,7 +1496,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(82, "useSharedAnimatedBackend"); + markFlagAsAccessed(81, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1532,7 +1514,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(83, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(82, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1550,7 +1532,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(84, "useTurboModuleInterop"); + markFlagAsAccessed(83, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = 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 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(88, "viewTransitionUseHardwareBitmapAndroid"); + markFlagAsAccessed(87, "viewTransitionUseHardwareBitmapAndroid"); flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid(); viewTransitionUseHardwareBitmapAndroid_ = flagValue; @@ -1640,7 +1622,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(89, "virtualViewPrerenderRatio"); + markFlagAsAccessed(88, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 1a60247f0d1e..40f6f10c8353 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<0dd9d8307ff12ff45ba01544f36f7f68>> */ /** @@ -51,7 +51,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableDestroyShadowTreeRevisionAsync(); bool enableDifferentiatorMutationVectorPreallocation(); bool enableDoubleMeasurementFixAndroid(); - bool enableEagerMainQueueModulesOnIOS(); bool enableEagerRootViewAttachment(); bool enableExclusivePropsUpdateAndroid(); bool enableFabricCommitBranching(); @@ -133,7 +132,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 90> accessedFeatureFlags_; + std::array, 89> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -154,7 +153,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableDestroyShadowTreeRevisionAsync_; std::atomic> enableDifferentiatorMutationVectorPreallocation_; std::atomic> enableDoubleMeasurementFixAndroid_; - std::atomic> enableEagerMainQueueModulesOnIOS_; std::atomic> enableEagerRootViewAttachment_; std::atomic> enableExclusivePropsUpdateAndroid_; std::atomic> enableFabricCommitBranching_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 2dd5ab8ccf80..bc9f4dedb7ef 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -103,10 +103,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool enableEagerMainQueueModulesOnIOS() override { - return false; - } - bool enableEagerRootViewAttachment() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 02a18178c55a..94d99a5bc012 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<53aabf690e44b87c4887930f882158df>> */ /** @@ -216,15 +216,6 @@ 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()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index c487722fbac1..79944169cc11 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<584f593b7ca1ea2ab72b7de7afd6b70d>> + * @generated SignedSource<> */ /** @@ -44,7 +44,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableDestroyShadowTreeRevisionAsync() = 0; virtual bool enableDifferentiatorMutationVectorPreallocation() = 0; virtual bool enableDoubleMeasurementFixAndroid() = 0; - virtual bool enableEagerMainQueueModulesOnIOS() = 0; virtual bool enableEagerRootViewAttachment() = 0; virtual bool enableExclusivePropsUpdateAndroid() = 0; virtual bool enableFabricCommitBranching() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 734b486c0210..758b53775a5f 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<086755643a71f66d1cd023fd36d74fd6>> + * @generated SignedSource<> */ /** @@ -139,11 +139,6 @@ bool NativeReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid( return ReactNativeFeatureFlags::enableDoubleMeasurementFixAndroid(); } -bool NativeReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableEagerMainQueueModulesOnIOS(); -} - bool NativeReactNativeFeatureFlags::enableEagerRootViewAttachment( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::enableEagerRootViewAttachment(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index 4baefa424685..1ccfc7638e8c 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0eb12f4ad26d7d2b558057e3a6bf2de7>> + * @generated SignedSource<> */ /** @@ -74,8 +74,6 @@ class NativeReactNativeFeatureFlags bool enableDoubleMeasurementFixAndroid(jsi::Runtime& runtime); - bool enableEagerMainQueueModulesOnIOS(jsi::Runtime& runtime); - bool enableEagerRootViewAttachment(jsi::Runtime& runtime); bool enableExclusivePropsUpdateAndroid(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm b/packages/react-native/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm index 367dae41e412..b1d1b16b45ee 100644 --- a/packages/react-native/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm +++ b/packages/react-native/ReactCommon/react/runtime/iostests/RCTInstanceTests.mm @@ -15,25 +15,9 @@ #import #import #import -#import -#import using namespace facebook::react; -namespace { -class EagerMainQueueOverride : public ReactNativeFeatureFlagsDefaults { - public: - explicit EagerMainQueueOverride(bool enabled) : enabled_(enabled) {} - bool enableEagerMainQueueModulesOnIOS() override - { - return enabled_; - } - - private: - bool enabled_; -}; -} // namespace - @interface FakeEagerModule : NSObject @property (class, readonly) NSCountedSet *initCounts; @property (class, nullable) void (^onInit)(void); @@ -114,7 +98,6 @@ @implementation RCTInstanceTests { - (void)setUp { [super setUp]; - ReactNativeFeatureFlags::dangerouslyReset(); [FakeEagerModule reset]; _mockDelegate = OCMProtocolMock(@protocol(RCTInstanceDelegate)); @@ -137,7 +120,6 @@ - (void)tearDown [[NSNotificationCenter defaultCenter] removeObserver:_bundleLoadObserver]; _bundleLoadObserver = nil; } - ReactNativeFeatureFlags::dangerouslyReset(); [FakeEagerModule reset]; _mockDelegate = nil; _mockTMMDelegate = nil; @@ -165,20 +147,8 @@ - (RCTInstance *)makeInstance launchOptions:nil]; } -- (void)testFlagOff_doesNotConsultDelegate -{ - OCMReject([_mockDelegate unstableModulesRequiringMainQueueSetup]); - - RCTInstance *instance = [self makeInstance]; - - XCTAssertEqual([FakeEagerModule.initCounts countForObject:FakeEagerModule.moduleName], 0u); - - [instance invalidate]; -} - -- (void)testFlagOn_consultsDelegateExactlyOnce +- (void)testConsultsDelegateExactlyOnce { - ReactNativeFeatureFlags::override(std::make_unique(true)); OCMStub([_mockDelegate unstableModulesRequiringMainQueueSetup]).andReturn(@[]); RCTInstance *instance = [self makeInstance]; @@ -188,9 +158,8 @@ - (void)testFlagOn_consultsDelegateExactlyOnce [instance invalidate]; } -- (void)testFlagOn_instantiatesRequestedModuleOnMainQueue +- (void)testInstantiatesRequestedModuleOnMainQueue { - ReactNativeFeatureFlags::override(std::make_unique(true)); OCMStub([_mockDelegate unstableModulesRequiringMainQueueSetup]).andReturn(@[ FakeEagerModule.moduleName ]); RCTInstance *instance = [self makeInstance]; @@ -203,9 +172,8 @@ - (void)testFlagOn_instantiatesRequestedModuleOnMainQueue [instance invalidate]; } -- (void)testFlagOn_bundleLoadAwaitsMainQueueModuleSetup +- (void)testBundleLoadAwaitsMainQueueModuleSetup { - ReactNativeFeatureFlags::override(std::make_unique(true)); OCMStub([_mockDelegate unstableModulesRequiringMainQueueSetup]).andReturn(@[ FakeEagerModule.moduleName ]); // Hand the instance an empty bundle the moment it asks for one. The JS thread diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index 0cdbb3183f5b..13ebbe825393 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -371,33 +371,31 @@ - (void)_start // Initialize RCTModuleRegistry so that TurboModules can require other TurboModules. [_bridgeModuleDecorator.moduleRegistry setTurboModuleRegistry:_turboModuleManager]; - 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 - * will wait until this module init finishes, before executing the js bundle. - */ - NSArray *modulesRequiringMainQueueSetup = [_delegate unstableModulesRequiringMainQueueSetup]; + /** + * Some native modules need to capture uikit objects on the main thread. + * Start initializing those modules on the main queue here. The JavaScript thread + * will wait until this module init finishes, before executing the js bundle. + */ + NSArray *modulesRequiringMainQueueSetup = [_delegate unstableModulesRequiringMainQueueSetup]; - dispatch_semaphore_t moduleSetupComplete = dispatch_semaphore_create(0); + dispatch_semaphore_t moduleSetupComplete = dispatch_semaphore_create(0); - _waitUntilModuleSetupComplete = ^{ - dispatch_semaphore_wait(moduleSetupComplete, DISPATCH_TIME_FOREVER); - }; + _waitUntilModuleSetupComplete = ^{ + dispatch_semaphore_wait(moduleSetupComplete, DISPATCH_TIME_FOREVER); + }; - // TODO(T218039767): Integrate perf logging into main queue module init - RCTExecuteOnMainQueue(^{ - for (NSString *moduleName in modulesRequiringMainQueueSetup) { - [self->_bridgeModuleDecorator.moduleRegistry moduleForName:[moduleName UTF8String]]; - } + // TODO(T218039767): Integrate perf logging into main queue module init + RCTExecuteOnMainQueue(^{ + for (NSString *moduleName in modulesRequiringMainQueueSetup) { + [self->_bridgeModuleDecorator.moduleRegistry moduleForName:[moduleName UTF8String]]; + } - RCTScreenSize(); - RCTScreenScale(); - RCTSwitchSize(); + RCTScreenSize(); + RCTScreenScale(); + RCTSwitchSize(); - dispatch_semaphore_signal(moduleSetupComplete); - }); - } + dispatch_semaphore_signal(moduleSetupComplete); + }); RCTLogSetBridgelessModuleRegistry(_bridgeModuleDecorator.moduleRegistry); RCTLogSetBridgelessCallableJSModules(_bridgeModuleDecorator.callableJSModules); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index dfc8cda5ab5c..9f3b103f8969 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -253,16 +253,6 @@ 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: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 3203b40172e9..556ca897f4df 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -65,7 +65,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableDestroyShadowTreeRevisionAsync: Getter, enableDifferentiatorMutationVectorPreallocation: Getter, enableDoubleMeasurementFixAndroid: Getter, - enableEagerMainQueueModulesOnIOS: Getter, enableEagerRootViewAttachment: Getter, enableExclusivePropsUpdateAndroid: Getter, enableFabricCommitBranching: Getter, @@ -273,10 +272,6 @@ export const enableDifferentiatorMutationVectorPreallocation: Getter = * When enabled a subset of components will avoid double measurement on Android. */ export const enableDoubleMeasurementFixAndroid: Getter = createNativeFlagGetter('enableDoubleMeasurementFixAndroid', false); -/** - * This infra allows native modules to initialize on the main thread, during React Native init. - */ -export const enableEagerMainQueueModulesOnIOS: Getter = createNativeFlagGetter('enableEagerMainQueueModulesOnIOS', false); /** * Feature flag to configure eager attachment of the root view/initialisation of the JS code. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index af309dee200f..45ad92b9a960 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<922d3f0709d01e77b6ef4061c541130f>> + * @generated SignedSource<<3a76e84abc652289fe66065dadcab77c>> * @flow strict * @noformat */ @@ -44,7 +44,6 @@ export interface Spec extends TurboModule { +enableDestroyShadowTreeRevisionAsync?: () => boolean; +enableDifferentiatorMutationVectorPreallocation?: () => boolean; +enableDoubleMeasurementFixAndroid?: () => boolean; - +enableEagerMainQueueModulesOnIOS?: () => boolean; +enableEagerRootViewAttachment?: () => boolean; +enableExclusivePropsUpdateAndroid?: () => boolean; +enableFabricCommitBranching?: () => boolean; From d07f020651b27fa61a8c8a429eb03f21fbd27d21 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 22 May 2026 02:57:22 -0700 Subject: [PATCH 3/5] Remove enableVirtualViewDebugFeatures and FlingItemOverlay MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The \`enableVirtualViewDebugFeatures\` feature flag was effectively dead — its only MobileConfig backing param (\`rn_fling.fling_debug\`) hadn't been updated in 365+ days, and the codemod-tracking diff D105936405 was already queued to remove the three native overrides. Rather than carry the FF + JS overlay surface forward, delete the whole stack: the FF, the overrides, the BUCK dep, the JS overlay components (\`FlingItemOverlay\`, \`FlingDebugItemOverlay\`, \`FlingDebugOverlay\`), the debug-log helpers in the native ScrollView/VirtualView implementations on both iOS and Android, and the now-orphaned references in \`VirtualCollectionView\`. Net: 4 files deleted, the FF removed from the cross-language codegen, native debug logging dropped from 5 files (1 ObjC++, 4 Kotlin), and consumer code in \`VirtualCollectionView\` simplified. Changelog: [General][Removed] - Remove unused \`enableVirtualViewDebugFeatures\` feature flag and the associated \`FlingItemOverlay\` / \`FlingDebugItemOverlay\` debug surfaces. Differential Revision: D105959433 --- .../RCTVirtualViewContainerState.mm | 44 --------- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +-- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +-- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../views/scroll/VirtualViewContainer.kt | 26 +---- .../VirtualViewContainerStateClassic.kt | 15 --- .../VirtualViewContainerStateExperimental.kt | 41 +------- .../views/virtual/view/ReactVirtualView.kt | 21 ----- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +--- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 94 ++++++++----------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +-- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../ReactNativeFeatureFlags.config.js | 10 -- .../VirtualCollectionView.js | 4 - .../debug/FlingItemOverlay.js | 13 --- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 27 files changed, 59 insertions(+), 335 deletions(-) delete mode 100644 packages/react-native/src/private/components/virtualcollection/debug/FlingItemOverlay.js diff --git a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm index 34f150efaae9..b2113b07acb9 100644 --- a/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm +++ b/packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTVirtualViewContainerState.mm @@ -16,23 +16,6 @@ using namespace facebook; using namespace facebook::react; -#if RCT_DEBUG -static void debugLog(NSString *msg, ...) -{ - auto debugEnabled = ReactNativeFeatureFlags::enableVirtualViewDebugFeatures(); - if (!debugEnabled) { - return; - } - - va_list args; - va_start(args, msg); - NSString *msgString = [[NSString alloc] initWithFormat:msg arguments:args]; - RCTLogInfo(@"%@", msgString); - va_end(args); // Don't forget to call va_end to clean up -} - -#endif - /** * Checks whether one CGRect overlaps with another CGRect. * @@ -86,19 +69,12 @@ - (instancetype)initWithScrollView:(RCTScrollViewComponentView *)scrollView _scrollViewComponentView = scrollView; _prerenderRatio = ReactNativeFeatureFlags::virtualViewPrerenderRatio(); [_scrollViewComponentView addScrollListener:self]; - -#if RCT_DEBUG - debugLog(@"initWithScrollView"); -#endif } return self; } - (void)dealloc { -#if RCT_DEBUG - debugLog(@"dealloc"); -#endif if (_scrollViewComponentView != nil) { [_scrollViewComponentView removeScrollListener:self]; _scrollViewComponentView = nil; @@ -112,14 +88,6 @@ - (void)onChange:(id)virtualView { if (![_virtualViews containsObject:virtualView]) { [_virtualViews addObject:virtualView]; -#if RCT_DEBUG - debugLog(@"Add virtualViewID=%@", virtualView.virtualViewID); -#endif - - } else { -#if RCT_DEBUG - debugLog(@"Update virtualViewID=%@", virtualView.virtualViewID); -#endif } [self _updateModes:virtualView]; } @@ -131,10 +99,6 @@ - (void)remove:(id)virtualView } [_virtualViews removeObject:virtualView]; - -#if RCT_DEBUG - debugLog(@"Remove virtualViewID=%@", virtualView.virtualViewID); -#endif } #pragma mark - Private Helpers @@ -169,14 +133,6 @@ - (void)_updateModes:(id)virtualView thresholdRect = _prerenderRect; } -#if RCT_DEBUG - debugLog( - @"UpdateModes virtualView=%@ mode=%ld rect=%@ thresholdRect=%@", - vv.virtualViewID, - (long)mode, - NSStringFromCGRect(rect), - NSStringFromCGRect(thresholdRect)); -#endif [vv onModeChange:mode targetRect:rect thresholdRect:thresholdRect]; } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index c3d46811f0c4..d75d10e19aaa 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<23b48657a64e620a108351385cac9f79>> + * @generated SignedSource<> */ /** @@ -336,12 +336,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun enableVirtualViewContainerStateExperimental(): Boolean = accessor.enableVirtualViewContainerStateExperimental() - /** - * Enables VirtualView debug features such as logging and overlays. - */ - @JvmStatic - public fun enableVirtualViewDebugFeatures(): Boolean = accessor.enableVirtualViewDebugFeatures() - /** * Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener, which causes UPDATE mutations to reference a parent being created in the same batch. */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index 01f674c94c90..d04a4ce1fef8 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<76c912049c6cbfac8bd0e27418dab700>> */ /** @@ -71,7 +71,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableViewRecyclingForTextCache: Boolean? = null private var enableViewRecyclingForViewCache: Boolean? = null private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null - private var enableVirtualViewDebugFeaturesCache: Boolean? = null private var fixDifferentiatorParentTagForUnflattenCaseCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null @@ -569,15 +568,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun enableVirtualViewDebugFeatures(): Boolean { - var cached = enableVirtualViewDebugFeaturesCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.enableVirtualViewDebugFeatures() - enableVirtualViewDebugFeaturesCache = cached - } - return cached - } - override fun fixDifferentiatorParentTagForUnflattenCase(): Boolean { var cached = fixDifferentiatorParentTagForUnflattenCaseCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index 6654acebb845..a949e723af59 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<32026408e198a903deb51eeb6157d3c5>> + * @generated SignedSource<<425c8a86705214aa021e413211468e97>> */ /** @@ -130,8 +130,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableVirtualViewContainerStateExperimental(): Boolean - @DoNotStrip @JvmStatic public external fun enableVirtualViewDebugFeatures(): Boolean - @DoNotStrip @JvmStatic public external fun fixDifferentiatorParentTagForUnflattenCase(): Boolean @DoNotStrip @JvmStatic public external fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index b5b673bea6f2..2795ff208d05 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<30bd20f9479756c3dce574c05b80a1f4>> */ /** @@ -125,8 +125,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableVirtualViewContainerStateExperimental(): Boolean = false - override fun enableVirtualViewDebugFeatures(): Boolean = false - override fun fixDifferentiatorParentTagForUnflattenCase(): Boolean = false override fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 40e674b77032..3ef8be916734 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -75,7 +75,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableViewRecyclingForTextCache: Boolean? = null private var enableViewRecyclingForViewCache: Boolean? = null private var enableVirtualViewContainerStateExperimentalCache: Boolean? = null - private var enableVirtualViewDebugFeaturesCache: Boolean? = null private var fixDifferentiatorParentTagForUnflattenCaseCache: Boolean? = null private var fixMappingOfEventPrioritiesBetweenFabricAndReactCache: Boolean? = null private var fixYogaFlexBasisFitContentInMainAxisCache: Boolean? = null @@ -624,16 +623,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun enableVirtualViewDebugFeatures(): Boolean { - var cached = enableVirtualViewDebugFeaturesCache - if (cached == null) { - cached = currentProvider.enableVirtualViewDebugFeatures() - accessedFeatureFlags.add("enableVirtualViewDebugFeatures") - enableVirtualViewDebugFeaturesCache = cached - } - return cached - } - override fun fixDifferentiatorParentTagForUnflattenCase(): Boolean { var cached = fixDifferentiatorParentTagForUnflattenCaseCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 3c7244334819..9e090cebd311 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -125,8 +125,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableVirtualViewContainerStateExperimental(): Boolean - @DoNotStrip public fun enableVirtualViewDebugFeatures(): Boolean - @DoNotStrip public fun fixDifferentiatorParentTagForUnflattenCase(): Boolean @DoNotStrip public fun fixMappingOfEventPrioritiesBetweenFabricAndReact(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt index 57cb7bb6421b..1022b2abd2ba 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainer.kt @@ -9,8 +9,6 @@ package com.facebook.react.views.scroll import android.graphics.Rect import android.view.ViewGroup -import com.facebook.common.logging.FLog -import com.facebook.react.common.build.ReactBuildConfig import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.views.virtual.VirtualViewMode import java.util.* @@ -69,11 +67,7 @@ internal abstract class VirtualViewContainerState { } open fun onChange(virtualView: VirtualView) { - if (virtualViews.add(virtualView)) { - debugLog("add", { "virtualViewID=${virtualView.virtualViewID}" }) - } else { - debugLog("update", { "virtualViewID=${virtualView.virtualViewID}" }) - } + virtualViews.add(virtualView) updateModes(virtualView) } @@ -81,12 +75,10 @@ internal abstract class VirtualViewContainerState { assert(virtualViews.remove(virtualView)) { "Attempting to remove non-existent VirtualView: ${virtualView.virtualViewID}" } - debugLog("remove", { "virtualViewID=${virtualView.virtualViewID}" }) } // Called on ScrollView onLayout or onScroll fun updateState() { - debugLog("updateState") updateModes() } @@ -98,7 +90,6 @@ internal abstract class VirtualViewContainerState { // intentionally goes but curently ScrollView and v1 Fling use this check to determine if // "content ready" if (visibleRect.isEmpty()) { - debugLog("updateRects", { "scrollView visibleRect is empty" }) // should set the other rects here in case scrollview is suddenly empty after the other rects // are non-empty prerenderRect.set(visibleRect) @@ -110,22 +101,7 @@ internal abstract class VirtualViewContainerState { (-prerenderRect.width() * prerenderRatio).toInt(), (-prerenderRect.height() * prerenderRatio).toInt(), ) - - debugLog( - "updateRects", - { "visibleRect ${visibleRect.toString()} prerenderRect ${prerenderRect.toString()}" }, - ) } protected abstract fun updateModes(virtualView: VirtualView? = null) } - -private const val DEBUG_TAG: String = "VirtualViewContainerState" -internal val IS_DEBUG_BUILD = - ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD || ReactBuildConfig.ENABLE_PERFETTO - -private inline fun debugLog(subtag: String, block: () -> String = { "" }) { - if (IS_DEBUG_BUILD && ReactNativeFeatureFlags.enableVirtualViewDebugFeatures()) { - FLog.d("$DEBUG_TAG:$subtag", block()) - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt index f817eb6cb583..e78b02c49c56 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateClassic.kt @@ -8,8 +8,6 @@ package com.facebook.react.views.scroll import android.view.ViewGroup -import com.facebook.common.logging.FLog -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.views.virtual.VirtualViewMode internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) : @@ -23,7 +21,6 @@ internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) : scrollView.getDrawingRect(visibleRect) if (visibleRect.isEmpty()) { - debugLog("updateModes", { "scrollView visibleRect is empty" }) return } @@ -52,18 +49,6 @@ internal class VirtualViewContainerStateClassic(scrollView: ViewGroup) : } vv.onModeChange(mode, thresholdRect) - debugLog( - "updateModes", - { "virtualView=${vv.virtualViewID} mode=$mode rect=$rect thresholdRect=$thresholdRect" }, - ) } } } - -private const val DEBUG_TAG: String = "VirtualViewContainerStateClassic" - -private inline fun debugLog(subtag: String, block: () -> String = { "" }) { - if (IS_DEBUG_BUILD && ReactNativeFeatureFlags.enableVirtualViewDebugFeatures()) { - FLog.d("$DEBUG_TAG:$subtag", block()) - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt index 63c495abfff0..0d7d28d2cb00 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/VirtualViewContainerStateExperimental.kt @@ -9,8 +9,6 @@ package com.facebook.react.views.scroll import android.graphics.Rect import android.view.ViewGroup -import com.facebook.common.logging.FLog -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.views.virtual.VirtualViewMode internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : @@ -32,11 +30,7 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : var V: MutableSet = mutableSetOf() override fun onChange(virtualView: VirtualView) { - if (virtualViews.add(virtualView)) { - debugLog("add", { "virtualViewID=${virtualView.virtualViewID}" }) - } else { - debugLog("update", { "virtualViewID=${virtualView.virtualViewID}" }) - } + virtualViews.add(virtualView) updateModes(virtualView) } @@ -110,14 +104,10 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : val VPrime = virtualViews.query(visibleRect) val PVPrime = virtualViews.query(prerenderRect) - debugLog("updateModes", { "V: ${V}, P: ${P}, PV: ${PV}" }) - /** Perform utility set differences: */ // P'=PV'-V' val PPrime = PVPrime.minus(VPrime) - debugLog("updateModes", { "V': ${VPrime}, P': ${PPrime}, PV': ${PVPrime}" }) - /** Get useful set differences */ // V'-V - update to visible val toVisible = VPrime.minus(V) @@ -126,8 +116,6 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : // PV-PV' - update to hidden val toHidden = PV.minus(PVPrime) - debugLog("updateModes", { "toV: ${toVisible}, toP: ${toPrerender}, toH: ${toHidden}" }) - /** Perform updates with the calculated sets */ for (vvID in toVisible) { virtualViews.getVirtualView(vvID)?.onModeChange(VirtualViewMode.Visible, visibleRect) @@ -153,10 +141,6 @@ internal class VirtualViewContainerStateExperimental(scrollView: ViewGroup) : */ private data class Interval(val start: Int, val end: Int, val id: String) { public fun intersects(other: Interval): Boolean { - debugLog( - "Interval: intersect", - { "${id}:(${start}, ${end}) vs ${other.id}:(${other.start}, ${other.end})" }, - ) return this.start < other.end && other.start < this.end } } @@ -352,12 +336,6 @@ internal class IntervalTree(private val horizontal: Boolean) : MutableCollection interval: Interval, results: MutableSet, ) { - debugLog( - "queryHelper", - { - "Check node (${node?.virtualView?.virtualViewID}, ${node?.virtualView?.containerRelativeRect}) against interval(${interval.start}, ${interval.end})" - }, - ) if (node == null || node.max <= interval.start) { return } @@ -389,9 +367,7 @@ internal class IntervalTree(private val horizontal: Boolean) : MutableCollection fun query(queryRect: Rect): MutableSet { val queryInterval = rectToInterval(queryRect) val results = HashSet() - debugLog("query", { "Querying tree for rect ${queryRect}" }) queryHelper(root, queryInterval, results) - debugLog("query", { "Query results: ${results}" }) return results } @@ -431,13 +407,6 @@ internal class IntervalTree(private val horizontal: Boolean) : MutableCollection root = insert(root, newIntervalNode) idToIntervalNode[id] = newIntervalNode - debugLog( - "IntervalTree: add", - { - "New VirtualView: (${element.virtualViewID}, ${element.containerRelativeRect}). Node interval ${newIntervalNode.interval.id}" - }, - ) - return newElement } @@ -502,11 +471,3 @@ internal class IntervalTree(private val horizontal: Boolean) : MutableCollection return (size == 0) } } - -private const val DEBUG_TAG: String = "VirtualViewContainerStateExperimental" - -private inline fun debugLog(subtag: String, block: () -> String = { "" }) { - if (IS_DEBUG_BUILD && ReactNativeFeatureFlags.enableVirtualViewDebugFeatures()) { - FLog.d("$DEBUG_TAG:$subtag", block()) - } -} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt index ca4e12b75704..d184cc857373 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/virtual/view/ReactVirtualView.kt @@ -12,10 +12,7 @@ import android.graphics.Rect import android.view.View import android.view.ViewParent import androidx.annotation.VisibleForTesting -import com.facebook.common.logging.FLog import com.facebook.react.R -import com.facebook.react.common.build.ReactBuildConfig -import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags import com.facebook.react.uimanager.ReactClippingViewGroup import com.facebook.react.uimanager.ReactRoot import com.facebook.react.views.scroll.VirtualView @@ -58,7 +55,6 @@ public class ReactVirtualView(context: Context) : updateParentOffset() reportRectChangeToContainer() } - debugLog("doAttachedToWindow") } /** From [View#onLayout] */ @@ -73,7 +69,6 @@ public class ReactVirtualView(context: Context) : right + offsetX, bottom + offsetY, ) - debugLog("onLayout") { "containerRelativeRect=$containerRelativeRect" } reportRectChangeToContainer() } } @@ -92,7 +87,6 @@ public class ReactVirtualView(context: Context) : ) { if (oldLeft != left || oldTop != top) { updateParentOffset() - debugLog("onLayoutChange") { "containerRelativeRect=$containerRelativeRect" } reportRectChangeToContainer() } } @@ -105,7 +99,6 @@ public class ReactVirtualView(context: Context) : right + offsetX, bottom + offsetY, ) - debugLog("onSizeChanged") { "container=$containerRelativeRect" } reportRectChangeToContainer() } @@ -140,15 +133,12 @@ public class ReactVirtualView(context: Context) : } if (newMode == mode) { - debugLog("onModeChange") { "no change $newMode" } return } val oldMode = mode mode = newMode - debugLog("onModeChange") { "$oldMode->$newMode" } - if (oldMode == VirtualViewMode.Visible) { updateClippingRect(null) } @@ -249,7 +239,6 @@ public class ReactVirtualView(context: Context) : private fun reportRectChangeToContainer() { if (lastContainerRelativeRect == containerRelativeRect) { - debugLog("reportRectChangeToContainer") { "no rect change $containerRelativeRect" } return } @@ -286,14 +275,4 @@ public class ReactVirtualView(context: Context) : } return null } - - internal inline fun debugLog(subtag: String, block: () -> String = { "" }) { - if (IS_DEBUG_BUILD && ReactNativeFeatureFlags.enableVirtualViewDebugFeatures()) { - FLog.d("$DEBUG_TAG:[$virtualViewID]:$subtag", block()) - } - } } - -private const val DEBUG_TAG: String = "ReactVirtualView" -private val IS_DEBUG_BUILD = - ReactBuildConfig.DEBUG || ReactBuildConfig.IS_INTERNAL_BUILD || ReactBuildConfig.ENABLE_PERFETTO diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 500eeddc8697..30b6e9f146a0 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<37167dea60330101b87d35ee9cbd8531>> + * @generated SignedSource<> */ /** @@ -345,12 +345,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableVirtualViewDebugFeatures() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableVirtualViewDebugFeatures"); - return method(javaProvider_); - } - bool fixDifferentiatorParentTagForUnflattenCase() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("fixDifferentiatorParentTagForUnflattenCase"); @@ -832,11 +826,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewContainerStateExperime return ReactNativeFeatureFlags::enableVirtualViewContainerStateExperimental(); } -bool JReactNativeFeatureFlagsCxxInterop::enableVirtualViewDebugFeatures( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableVirtualViewDebugFeatures(); -} - bool JReactNativeFeatureFlagsCxxInterop::fixDifferentiatorParentTagForUnflattenCase( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::fixDifferentiatorParentTagForUnflattenCase(); @@ -1206,9 +1195,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableVirtualViewContainerStateExperimental", JReactNativeFeatureFlagsCxxInterop::enableVirtualViewContainerStateExperimental), - makeNativeMethod( - "enableVirtualViewDebugFeatures", - JReactNativeFeatureFlagsCxxInterop::enableVirtualViewDebugFeatures), makeNativeMethod( "fixDifferentiatorParentTagForUnflattenCase", JReactNativeFeatureFlagsCxxInterop::fixDifferentiatorParentTagForUnflattenCase), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index 862bf17ee364..e9f49b0dbbe5 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5501bc377ccafc4dab778978ee3f33b2>> */ /** @@ -183,9 +183,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableVirtualViewContainerStateExperimental( facebook::jni::alias_ref); - static bool enableVirtualViewDebugFeatures( - facebook::jni::alias_ref); - static bool fixDifferentiatorParentTagForUnflattenCase( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 37dec3e5f476..d20791b13f93 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<30c0afbb7c40ba8953e5ffb692224a34>> + * @generated SignedSource<> */ /** @@ -230,10 +230,6 @@ bool ReactNativeFeatureFlags::enableVirtualViewContainerStateExperimental() { return getAccessor().enableVirtualViewContainerStateExperimental(); } -bool ReactNativeFeatureFlags::enableVirtualViewDebugFeatures() { - return getAccessor().enableVirtualViewDebugFeatures(); -} - bool ReactNativeFeatureFlags::fixDifferentiatorParentTagForUnflattenCase() { return getAccessor().fixDifferentiatorParentTagForUnflattenCase(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 95ad0a1583f1..190cc33d5117 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -294,11 +294,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool enableVirtualViewContainerStateExperimental(); - /** - * Enables VirtualView debug features such as logging and overlays. - */ - RN_EXPORT static bool enableVirtualViewDebugFeatures(); - /** * Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener, which causes UPDATE mutations to reference a parent being created in the same batch. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index ac1480c623c8..6bcbe817124e 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<881e6059574bdce33654620eb847a0fc>> + * @generated SignedSource<<86e02ee84cb27696920774c9e44636bb>> */ /** @@ -947,24 +947,6 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::enableVirtualViewDebugFeatures() { - auto flagValue = enableVirtualViewDebugFeatures_.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(51, "enableVirtualViewDebugFeatures"); - - flagValue = currentProvider_->enableVirtualViewDebugFeatures(); - enableVirtualViewDebugFeatures_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase() { auto flagValue = fixDifferentiatorParentTagForUnflattenCase_.load(); @@ -974,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(52, "fixDifferentiatorParentTagForUnflattenCase"); + markFlagAsAccessed(51, "fixDifferentiatorParentTagForUnflattenCase"); flagValue = currentProvider_->fixDifferentiatorParentTagForUnflattenCase(); fixDifferentiatorParentTagForUnflattenCase_ = flagValue; @@ -992,7 +974,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(53, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(52, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -1010,7 +992,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(54, "fixYogaFlexBasisFitContentInMainAxis"); + markFlagAsAccessed(53, "fixYogaFlexBasisFitContentInMainAxis"); flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis(); fixYogaFlexBasisFitContentInMainAxis_ = flagValue; @@ -1028,7 +1010,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(55, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(54, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1046,7 +1028,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(56, "fuseboxEnabledRelease"); + markFlagAsAccessed(55, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1064,7 +1046,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(57, "fuseboxFrameRecordingEnabled"); + markFlagAsAccessed(56, "fuseboxFrameRecordingEnabled"); flagValue = currentProvider_->fuseboxFrameRecordingEnabled(); fuseboxFrameRecordingEnabled_ = flagValue; @@ -1082,7 +1064,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(58, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(57, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1100,7 +1082,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(59, "fuseboxScreenshotCaptureEnabled"); + markFlagAsAccessed(58, "fuseboxScreenshotCaptureEnabled"); flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled(); fuseboxScreenshotCaptureEnabled_ = flagValue; @@ -1118,7 +1100,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(60, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(59, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1136,7 +1118,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(61, "optimizedAnimatedPropUpdates"); + markFlagAsAccessed(60, "optimizedAnimatedPropUpdates"); flagValue = currentProvider_->optimizedAnimatedPropUpdates(); optimizedAnimatedPropUpdates_ = flagValue; @@ -1154,7 +1136,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(62, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(61, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1172,7 +1154,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(63, "perfIssuesEnabled"); + markFlagAsAccessed(62, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1190,7 +1172,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(64, "perfMonitorV2Enabled"); + markFlagAsAccessed(63, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1208,7 +1190,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(65, "preparedTextCacheSize"); + markFlagAsAccessed(64, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1226,7 +1208,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(66, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(65, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "redBoxV2Android"); + markFlagAsAccessed(66, "redBoxV2Android"); flagValue = currentProvider_->redBoxV2Android(); redBoxV2Android_ = flagValue; @@ -1262,7 +1244,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(68, "redBoxV2IOS"); + markFlagAsAccessed(67, "redBoxV2IOS"); flagValue = currentProvider_->redBoxV2IOS(); redBoxV2IOS_ = flagValue; @@ -1280,7 +1262,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(69, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(68, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1298,7 +1280,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(70, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(69, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1316,7 +1298,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(71, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(70, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1334,7 +1316,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(72, "syncAndroidClipBoundsWithOverflow"); + markFlagAsAccessed(71, "syncAndroidClipBoundsWithOverflow"); flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow(); syncAndroidClipBoundsWithOverflow_ = flagValue; @@ -1352,7 +1334,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(73, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(72, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1370,7 +1352,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(74, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(73, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1388,7 +1370,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(75, "updateRuntimeShadowNodeReferencesOnCommitThread"); + markFlagAsAccessed(74, "updateRuntimeShadowNodeReferencesOnCommitThread"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread(); updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue; @@ -1406,7 +1388,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(76, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(75, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1424,7 +1406,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(77, "useFabricInterop"); + markFlagAsAccessed(76, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1442,7 +1424,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(78, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(77, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1460,7 +1442,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(79, "useNestedScrollViewAndroid"); + markFlagAsAccessed(78, "useNestedScrollViewAndroid"); flagValue = currentProvider_->useNestedScrollViewAndroid(); useNestedScrollViewAndroid_ = flagValue; @@ -1478,7 +1460,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedViewRegistryOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(80, "useOptimizedViewRegistryOnAndroid"); + markFlagAsAccessed(79, "useOptimizedViewRegistryOnAndroid"); flagValue = currentProvider_->useOptimizedViewRegistryOnAndroid(); useOptimizedViewRegistryOnAndroid_ = 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::useUnorderedMapInDifferentiator() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(84, "useUnorderedMapInDifferentiator"); + markFlagAsAccessed(83, "useUnorderedMapInDifferentiator"); flagValue = currentProvider_->useUnorderedMapInDifferentiator(); useUnorderedMapInDifferentiator_ = flagValue; @@ -1568,7 +1550,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(85, "viewCullingOutsetRatio"); + markFlagAsAccessed(84, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1586,7 +1568,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(86, "viewTransitionEnabled"); + markFlagAsAccessed(85, "viewTransitionEnabled"); flagValue = currentProvider_->viewTransitionEnabled(); viewTransitionEnabled_ = flagValue; @@ -1604,7 +1586,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(87, "viewTransitionUseHardwareBitmapAndroid"); + markFlagAsAccessed(86, "viewTransitionUseHardwareBitmapAndroid"); flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid(); viewTransitionUseHardwareBitmapAndroid_ = 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; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 40f6f10c8353..15f7ebb73bc1 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0dd9d8307ff12ff45ba01544f36f7f68>> + * @generated SignedSource<<0f17b690a3e57e30984b85f5c0bbc54e>> */ /** @@ -83,7 +83,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableViewRecyclingForText(); bool enableViewRecyclingForView(); bool enableVirtualViewContainerStateExperimental(); - bool enableVirtualViewDebugFeatures(); bool fixDifferentiatorParentTagForUnflattenCase(); bool fixMappingOfEventPrioritiesBetweenFabricAndReact(); bool fixYogaFlexBasisFitContentInMainAxis(); @@ -132,7 +131,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 89> accessedFeatureFlags_; + std::array, 88> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -185,7 +184,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableViewRecyclingForText_; std::atomic> enableViewRecyclingForView_; std::atomic> enableVirtualViewContainerStateExperimental_; - std::atomic> enableVirtualViewDebugFeatures_; std::atomic> fixDifferentiatorParentTagForUnflattenCase_; std::atomic> fixMappingOfEventPrioritiesBetweenFabricAndReact_; std::atomic> fixYogaFlexBasisFitContentInMainAxis_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index bc9f4dedb7ef..49105b632ba7 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<4146b96e76f73d1151be8f7af96d13fb>> */ /** @@ -231,10 +231,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return false; } - bool enableVirtualViewDebugFeatures() override { - return false; - } - bool fixDifferentiatorParentTagForUnflattenCase() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index 94d99a5bc012..b59165278b97 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<53aabf690e44b87c4887930f882158df>> + * @generated SignedSource<<12ea64df682b2285772cafb030a60e5e>> */ /** @@ -504,15 +504,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableVirtualViewContainerStateExperimental(); } - bool enableVirtualViewDebugFeatures() override { - auto value = values_["enableVirtualViewDebugFeatures"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::enableVirtualViewDebugFeatures(); - } - bool fixDifferentiatorParentTagForUnflattenCase() override { auto value = values_["fixDifferentiatorParentTagForUnflattenCase"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index 79944169cc11..e66f23b896a8 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -76,7 +76,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableViewRecyclingForText() = 0; virtual bool enableViewRecyclingForView() = 0; virtual bool enableVirtualViewContainerStateExperimental() = 0; - virtual bool enableVirtualViewDebugFeatures() = 0; virtual bool fixDifferentiatorParentTagForUnflattenCase() = 0; virtual bool fixMappingOfEventPrioritiesBetweenFabricAndReact() = 0; virtual bool fixYogaFlexBasisFitContentInMainAxis() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 758b53775a5f..b3447054a6ea 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5407b8f41ed854b1f296584ff374c929>> */ /** @@ -299,11 +299,6 @@ bool NativeReactNativeFeatureFlags::enableVirtualViewContainerStateExperimental( return ReactNativeFeatureFlags::enableVirtualViewContainerStateExperimental(); } -bool NativeReactNativeFeatureFlags::enableVirtualViewDebugFeatures( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableVirtualViewDebugFeatures(); -} - bool NativeReactNativeFeatureFlags::fixDifferentiatorParentTagForUnflattenCase( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::fixDifferentiatorParentTagForUnflattenCase(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index 1ccfc7638e8c..d8d21b4311ec 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -138,8 +138,6 @@ class NativeReactNativeFeatureFlags bool enableVirtualViewContainerStateExperimental(jsi::Runtime& runtime); - bool enableVirtualViewDebugFeatures(jsi::Runtime& runtime); - bool fixDifferentiatorParentTagForUnflattenCase(jsi::Runtime& runtime); bool fixMappingOfEventPrioritiesBetweenFabricAndReact(jsi::Runtime& runtime); diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 9f3b103f8969..f9423307b22a 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -593,16 +593,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - enableVirtualViewDebugFeatures: { - defaultValue: false, - metadata: { - description: - 'Enables VirtualView debug features such as logging and overlays.', - expectedReleaseValue: false, - purpose: 'operational', - }, - ossReleaseStage: 'none', - }, fixDifferentiatorParentTagForUnflattenCase: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/components/virtualcollection/VirtualCollectionView.js b/packages/react-native/src/private/components/virtualcollection/VirtualCollectionView.js index c8ad06b036a2..771b01f9be34 100644 --- a/packages/react-native/src/private/components/virtualcollection/VirtualCollectionView.js +++ b/packages/react-native/src/private/components/virtualcollection/VirtualCollectionView.js @@ -17,7 +17,6 @@ import { VirtualViewMode, createHiddenVirtualView, } from '../virtualview/VirtualView'; -import FlingItemOverlay from './debug/FlingItemOverlay'; import * as React from 'react'; import {useCallback, useMemo, useState} from 'react'; @@ -108,9 +107,6 @@ export function createVirtualCollectionView( key={key} nativeID={key} removeClippedSubviews={removeClippedSubviews}> - {FlingItemOverlay == null ? null : ( - - )} {children(item, key)} ); diff --git a/packages/react-native/src/private/components/virtualcollection/debug/FlingItemOverlay.js b/packages/react-native/src/private/components/virtualcollection/debug/FlingItemOverlay.js deleted file mode 100644 index 5e4972bf4647..000000000000 --- a/packages/react-native/src/private/components/virtualcollection/debug/FlingItemOverlay.js +++ /dev/null @@ -1,13 +0,0 @@ -/** - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - * @flow strict-local - * @format - */ - -const FlingItemOverlay: ?component(nativeID: string) = null; - -export default FlingItemOverlay; diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 556ca897f4df..1410dd843d48 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<454401abd8b8ccba96f92ad0b1545596>> * @flow strict * @noformat */ @@ -97,7 +97,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableViewRecyclingForText: Getter, enableViewRecyclingForView: Getter, enableVirtualViewContainerStateExperimental: Getter, - enableVirtualViewDebugFeatures: Getter, fixDifferentiatorParentTagForUnflattenCase: Getter, fixMappingOfEventPrioritiesBetweenFabricAndReact: Getter, fixYogaFlexBasisFitContentInMainAxis: Getter, @@ -400,10 +399,6 @@ export const enableViewRecyclingForView: Getter = createNativeFlagGette * Enables the experimental version of `VirtualViewContainerState`. */ export const enableVirtualViewContainerStateExperimental: Getter = createNativeFlagGetter('enableVirtualViewContainerStateExperimental', false); -/** - * Enables VirtualView debug features such as logging and overlays. - */ -export const enableVirtualViewDebugFeatures: Getter = createNativeFlagGetter('enableVirtualViewDebugFeatures', false); /** * Fix incorrect parentTag passed as parentTagForUpdate in the unflatten-unflatten branch of calculateShadowViewMutationsFlattener, which causes UPDATE mutations to reference a parent being created in the same batch. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 45ad92b9a960..a362c6228c95 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<3a76e84abc652289fe66065dadcab77c>> + * @generated SignedSource<<493d48c7bc834e73fe88939de3866159>> * @flow strict * @noformat */ @@ -76,7 +76,6 @@ export interface Spec extends TurboModule { +enableViewRecyclingForText?: () => boolean; +enableViewRecyclingForView?: () => boolean; +enableVirtualViewContainerStateExperimental?: () => boolean; - +enableVirtualViewDebugFeatures?: () => boolean; +fixDifferentiatorParentTagForUnflattenCase?: () => boolean; +fixMappingOfEventPrioritiesBetweenFabricAndReact?: () => boolean; +fixYogaFlexBasisFitContentInMainAxis?: () => boolean; From 61b279308aa0217b307c1e7c1daab42d1c02bd9a Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 22 May 2026 03:13:49 -0700 Subject: [PATCH 4/5] Add unit tests for enableMainQueueCoordinatorOnIOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: The \`enableMainQueueCoordinatorOnIOS\` flag swaps two non-trivial threading primitives — \`RCTUnsafeExecuteOnMainQueueSync\` uses either \`dispatch_sync(main, ...)\` or \`unsafeExecuteOnMainThreadSync\`, and \`executeSynchronouslyOnSameThread_CAN_DEADLOCK\` switches between \`saferExecuteSynchronouslyOnSameThread_CAN_DEADLOCK\` and the legacy variant. There was zero in-tree test coverage for either branch. Adds three characterization tests: - \`testRCTUnsafeExecuteOnMainQueueSync_flagOff_runsBlockOnMainFromBG\` and \`...flagOn_...\` pin the basic contract for both branches: from a background thread, the block runs on the main queue and the call returns synchronously. - \`testExecuteSynchronouslyOnSameThread_flagOn_pumpsUITasksWhileWaitingForJS\` is the coordinator's signature property: while the main thread is blocked in the safer impl's wait loop, a UI task posted from a background thread is pumped before the runtime work resumes. The test wires a deliberately slow \`RuntimeExecutor\` (300ms sleep before invoking its callback) so a BG thread can post a \`RCTUnsafeExecuteOnMainQueueSync\` work item during the window, then asserts the ordering via a monotonic sequence counter. Changelog: [Internal] Differential Revision: D105972787 --- .../tests/RuntimeSchedulerTest.cpp | 34 ++++ .../iostests/MainQueueCoordinatorTests.mm | 147 ++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index 37c34b632ffb..840669a68a69 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -951,6 +951,40 @@ TEST_P(RuntimeSchedulerTest, basicSameThreadExecution) { EXPECT_TRUE(didRunSynchronousTask); } +// Mirror of `basicSameThreadExecution` for the production call pattern: the +// caller is the UI thread (XCTest test methods run on the main NSThread on +// Apple), so `executeNowOnTheSameThread` routes through the coordinator path +// in `executeSynchronouslyOnSameThread_CAN_DEADLOCK`. The off-main `driver` +// thread drives the stub queue ("JS thread") so the main thread can wake up. +TEST_P(RuntimeSchedulerTest, basicUIThreadExecution) { + class CoordinatorFeatureFlags : public RuntimeSchedulerTestFeatureFlags { + public: + using RuntimeSchedulerTestFeatureFlags::RuntimeSchedulerTestFeatureFlags; + bool enableMainQueueCoordinatorOnIOS() override { + return true; + } + }; + ReactNativeFeatureFlags::dangerouslyReset(); + ReactNativeFeatureFlags::override( + std::make_unique(GetParam())); + + bool didRunSynchronousTask = false; + + std::thread driver([this]() { + stubQueue_->waitForTask(); + stubQueue_->tick(); + }); + + runtimeScheduler_->executeNowOnTheSameThread( + [&didRunSynchronousTask](jsi::Runtime& /*rt*/) { + didRunSynchronousTask = true; + }); + + driver.join(); + + EXPECT_TRUE(didRunSynchronousTask); +} + TEST_P(RuntimeSchedulerTest, sameThreadTaskCreatesImmediatePriorityTask) { bool didRunSynchronousTask = false; bool didRunSubsequentTask = false; diff --git a/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm b/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm new file mode 100644 index 000000000000..f0fa55eacdbf --- /dev/null +++ b/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm @@ -0,0 +1,147 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +#import +#import +#import +#import +#import +#import +#import +#import +#import + +using namespace facebook::react; + +namespace { +class MainQueueCoordinatorOverride : public ReactNativeFeatureFlagsDefaults { + public: + explicit MainQueueCoordinatorOverride(bool enabled) : enabled_(enabled) {} + bool enableMainQueueCoordinatorOnIOS() override + { + return enabled_; + } + + private: + bool enabled_; +}; +} // namespace + +@interface MainQueueCoordinatorTests : XCTestCase +@end + +@implementation MainQueueCoordinatorTests + +- (void)setUp +{ + [super setUp]; + ReactNativeFeatureFlags::dangerouslyReset(); +} + +- (void)tearDown +{ + ReactNativeFeatureFlags::dangerouslyReset(); + [super tearDown]; +} + +#pragma mark - RCTUnsafeExecuteOnMainQueueSync + +- (void)_assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread +{ + XCTestExpectation *done = [self expectationWithDescription:@"BG-thread call completed"]; + __block BOOL ranOnMain = NO; + __block BOOL returnedToBG = NO; + + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ + RCTUnsafeExecuteOnMainQueueSync(^{ + ranOnMain = RCTIsMainQueue(); + }); + returnedToBG = YES; + [done fulfill]; + }); + + [self waitForExpectations:@[ done ] timeout:5.0]; + XCTAssertTrue(ranOnMain, @"Block must execute on main queue"); + XCTAssertTrue(returnedToBG, @"BG thread must resume after sync call returns"); +} + +- (void)testRCTUnsafeExecuteOnMainQueueSync_flagOff_runsBlockOnMainFromBG +{ + // Default off — exercises the dispatch_sync(main) branch. + [self _assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread]; +} + +- (void)testRCTUnsafeExecuteOnMainQueueSync_flagOn_runsBlockOnMainFromBG +{ + ReactNativeFeatureFlags::override(std::make_unique(true)); + // Coordinator branch — `unsafeExecuteOnMainThreadSync` posts a UI task and waits. + [self _assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread]; +} + +#pragma mark - executeSynchronouslyOnSameThread_CAN_DEADLOCK + +- (void)testExecuteSynchronouslyOnSameThread_flagOn_pumpsUITasksWhileWaitingForJS +{ + ReactNativeFeatureFlags::override(std::make_unique(true)); + + // A real runtime — needed only for the reference type. We never call into it. + auto runtime = facebook::hermes::makeHermesRuntime(); + + // A "JS thread" that the executor posts to. Sleeps before invoking the callback + // so that the main thread is forced to wait, giving us a window to post a UI task. + constexpr auto kJSDelay = std::chrono::milliseconds(300); + + RuntimeExecutor slowJSExecutor = [&runtime, kJSDelay](std::function &&callback) { + std::thread([cb = std::move(callback), &runtime, kJSDelay]() mutable { + std::this_thread::sleep_for(kJSDelay); + cb(*runtime); + }).detach(); + }; + + // Both threads only ever write on main, so plain ints are race-free. Held in + // a struct so we can capture a pointer from an ObjC block and a reference + // from a C++ lambda without `__block` (which doesn't compose with lambdas). + struct State { + int sequence = 0; + int uiTaskOrder = 0; + int runtimeWorkOrder = 0; + BOOL uiTaskRanOnMain = NO; + BOOL runtimeWorkRanOnMain = NO; + }; + State state; + State *statePtr = &state; + + // Background thread posts a UI task ~100ms after the main thread enters the + // wait loop — well before the JS thread wakes up at +300ms. + XCTestExpectation *bgDone = [self expectationWithDescription:@"BG-thread sync call completed"]; + dispatch_async(dispatch_get_global_queue(QOS_CLASS_USER_INITIATED, 0), ^{ + std::this_thread::sleep_for(std::chrono::milliseconds(100)); + RCTUnsafeExecuteOnMainQueueSync(^{ + statePtr->uiTaskOrder = ++statePtr->sequence; + statePtr->uiTaskRanOnMain = RCTIsMainQueue(); + }); + [bgDone fulfill]; + }); + + // This call blocks main inside the coordinator's wait loop. While it waits, + // it should pump the UI task posted by the BG thread above. + executeSynchronouslyOnSameThread_CAN_DEADLOCK(slowJSExecutor, [&state](facebook::jsi::Runtime & /*_*/) { + state.runtimeWorkOrder = ++state.sequence; + state.runtimeWorkRanOnMain = RCTIsMainQueue(); + }); + + [self waitForExpectations:@[ bgDone ] timeout:5.0]; + + XCTAssertTrue(state.uiTaskRanOnMain, @"UI task posted from BG should run on main"); + XCTAssertTrue(state.runtimeWorkRanOnMain, @"runtimeWork should run on main"); + XCTAssertEqual(state.uiTaskOrder, 1, @"UI task should be pumped before runtimeWork"); + XCTAssertEqual(state.runtimeWorkOrder, 2, @"runtimeWork should run after the pumped UI task"); +} + +@end From 01b2c5be6dd8f0afdde17ee89724a102efc86e86 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Fri, 22 May 2026 03:36:47 -0700 Subject: [PATCH 5/5] Remove enableMainQueueCoordinatorOnIOS, make coordinator always-on Summary: The `enableMainQueueCoordinatorOnIOS` flag has finished rollout. Drop it from the feature-flag config, regenerate the per-language accessors, and inline the previously-gated paths: - `RCTUtils.mm`: `RCTUnsafeExecuteOnMainQueueSync` and the `RCTUnsafeExecuteOnMainQueueOnceSync` helper always use `unsafeExecuteOnMainThreadSync` on iOS (the TV fallback to `dispatch_sync(main, ...)` stays). - `RuntimeExecutorSyncUIThreadUtils.mm`: `executeSynchronouslyOnSameThread_CAN_DEADLOCK` switches between two paths based on the calling thread instead of the feature flag. Main-thread callers (production) take the coordinator path that pumps UI tasks while waiting for JS; off-main callers (e.g. RuntimeScheduler unit tests) take a simpler path that just waits for the runtime and runs `runtimeWork` synchronously on the calling thread. Trimmed the `runtimeCaptureBlockDone` plumbing that an old TODO already flagged as unnecessary. Also drops the iOS override in the Wilde plugin, the now-dead `rn_fling.enable_main_queue_coordinator_on_ios` MobileConfig param, and the `flagOff` variant of the characterization test (the on-path test still pins the contract). Changelog: [iOS][Changed] - `RCTUnsafeExecuteOnMainQueueSync` and bridgeless sync runtime-thread calls now always use the coordinator implementation that pumps UI tasks while waiting for JS, eliminating a class of deadlocks. The previous opt-in flag has been removed. Differential Revision: D105984547 --- packages/react-native/React/Base/RCTUtils.mm | 19 +-- .../featureflags/ReactNativeFeatureFlags.kt | 8 +- .../ReactNativeFeatureFlagsCxxAccessor.kt | 12 +- .../ReactNativeFeatureFlagsCxxInterop.kt | 4 +- .../ReactNativeFeatureFlagsDefaults.kt | 4 +- .../ReactNativeFeatureFlagsLocalAccessor.kt | 13 +- .../ReactNativeFeatureFlagsProvider.kt | 4 +- .../JReactNativeFeatureFlagsCxxInterop.cpp | 16 +-- .../JReactNativeFeatureFlagsCxxInterop.h | 5 +- .../featureflags/ReactNativeFeatureFlags.cpp | 6 +- .../featureflags/ReactNativeFeatureFlags.h | 7 +- .../ReactNativeFeatureFlagsAccessor.cpp | 126 ++++++++---------- .../ReactNativeFeatureFlagsAccessor.h | 6 +- .../ReactNativeFeatureFlagsDefaults.h | 6 +- .../ReactNativeFeatureFlagsDynamicProvider.h | 11 +- .../ReactNativeFeatureFlagsProvider.h | 3 +- .../NativeReactNativeFeatureFlags.cpp | 7 +- .../NativeReactNativeFeatureFlags.h | 4 +- .../tests/RuntimeSchedulerTest.cpp | 11 -- .../iostests/MainQueueCoordinatorTests.mm | 58 +------- .../RuntimeExecutorSyncUIThreadUtils.mm | 55 +++----- .../ReactNativeFeatureFlags.config.js | 11 -- .../featureflags/ReactNativeFeatureFlags.js | 7 +- .../specs/NativeReactNativeFeatureFlags.js | 3 +- 24 files changed, 102 insertions(+), 304 deletions(-) diff --git a/packages/react-native/React/Base/RCTUtils.mm b/packages/react-native/React/Base/RCTUtils.mm index ba4e930c731d..44ebe7d3260a 100644 --- a/packages/react-native/React/Base/RCTUtils.mm +++ b/packages/react-native/React/Base/RCTUtils.mm @@ -11,7 +11,6 @@ #import #import #import -#import #import #import @@ -312,15 +311,12 @@ void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block) } #if !TARGET_OS_TV - if (ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS()) { - unsafeExecuteOnMainThreadSync(block); - return; - } -#endif - + unsafeExecuteOnMainThreadSync(block); +#else dispatch_sync(dispatch_get_main_queue(), ^{ block(); }); +#endif } static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, dispatch_block_t block) @@ -342,13 +338,10 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp } #if !TARGET_OS_TV - if (ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS()) { - unsafeExecuteOnMainThreadSync(block); - return; - } -#endif - + unsafeExecuteOnMainThreadSync(block); +#else dispatch_sync(dispatch_get_main_queue(), executeOnce); +#endif } CGFloat RCTScreenScale(void) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt index d75d10e19aaa..0cecabd845e4 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<1daf42834a0bcc06caae571c6541fecd>> */ /** @@ -234,12 +234,6 @@ public object ReactNativeFeatureFlags { @JvmStatic public fun enableLayoutAnimationsOnIOS(): Boolean = accessor.enableLayoutAnimationsOnIOS() - /** - * Make RCTUnsafeExecuteOnMainQueueSync less likely to deadlock, when used in conjuction with sync rendering/events. - */ - @JvmStatic - public fun enableMainQueueCoordinatorOnIOS(): Boolean = accessor.enableMainQueueCoordinatorOnIOS() - /** * Enable NSNull conversion when handling module arguments on iOS */ diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt index d04a4ce1fef8..b1c9473412a2 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<76c912049c6cbfac8bd0e27418dab700>> + * @generated SignedSource<<6b189752d6dedc9d814179ddd6d605f4>> */ /** @@ -54,7 +54,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableKeyEventsCache: Boolean? = null private var enableLayoutAnimationsOnAndroidCache: Boolean? = null private var enableLayoutAnimationsOnIOSCache: Boolean? = null - private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableMutationObserverByDefaultCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null @@ -415,15 +414,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces return cached } - override fun enableMainQueueCoordinatorOnIOS(): Boolean { - var cached = enableMainQueueCoordinatorOnIOSCache - if (cached == null) { - cached = ReactNativeFeatureFlagsCxxInterop.enableMainQueueCoordinatorOnIOS() - enableMainQueueCoordinatorOnIOSCache = cached - } - return cached - } - override fun enableModuleArgumentNSNullConversionIOS(): Boolean { var cached = enableModuleArgumentNSNullConversionIOSCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt index a949e723af59..74130baf41c9 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<425c8a86705214aa021e413211468e97>> + * @generated SignedSource<<34dc75d00f7dad4922361c5661a5c527>> */ /** @@ -96,8 +96,6 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnIOS(): Boolean - @DoNotStrip @JvmStatic public external fun enableMainQueueCoordinatorOnIOS(): Boolean - @DoNotStrip @JvmStatic public external fun enableModuleArgumentNSNullConversionIOS(): Boolean @DoNotStrip @JvmStatic public external fun enableMutationObserverByDefault(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt index 2795ff208d05..bd5c92590025 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<30bd20f9479756c3dce574c05b80a1f4>> + * @generated SignedSource<> */ /** @@ -91,8 +91,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableLayoutAnimationsOnIOS(): Boolean = true - override fun enableMainQueueCoordinatorOnIOS(): Boolean = false - override fun enableModuleArgumentNSNullConversionIOS(): Boolean = false override fun enableMutationObserverByDefault(): Boolean = false diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt index 3ef8be916734..4d476cab95e9 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -58,7 +58,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableKeyEventsCache: Boolean? = null private var enableLayoutAnimationsOnAndroidCache: Boolean? = null private var enableLayoutAnimationsOnIOSCache: Boolean? = null - private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableMutationObserverByDefaultCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null @@ -453,16 +452,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc return cached } - override fun enableMainQueueCoordinatorOnIOS(): Boolean { - var cached = enableMainQueueCoordinatorOnIOSCache - if (cached == null) { - cached = currentProvider.enableMainQueueCoordinatorOnIOS() - accessedFeatureFlags.add("enableMainQueueCoordinatorOnIOS") - enableMainQueueCoordinatorOnIOSCache = cached - } - return cached - } - override fun enableModuleArgumentNSNullConversionIOS(): Boolean { var cached = enableModuleArgumentNSNullConversionIOSCache if (cached == null) { diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt index 9e090cebd311..3359fc2df5c6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3bdd4f869245c79c42fbd09646d753ba>> */ /** @@ -91,8 +91,6 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableLayoutAnimationsOnIOS(): Boolean - @DoNotStrip public fun enableMainQueueCoordinatorOnIOS(): Boolean - @DoNotStrip public fun enableModuleArgumentNSNullConversionIOS(): Boolean @DoNotStrip public fun enableMutationObserverByDefault(): Boolean diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp index 30b6e9f146a0..b2558821774c 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<641a3191c119df804bdf975fd4841072>> */ /** @@ -243,12 +243,6 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } - bool enableMainQueueCoordinatorOnIOS() override { - static const auto method = - getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableMainQueueCoordinatorOnIOS"); - return method(javaProvider_); - } - bool enableModuleArgumentNSNullConversionIOS() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableModuleArgumentNSNullConversionIOS"); @@ -741,11 +735,6 @@ bool JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS( return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS(); } -bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS( - facebook::jni::alias_ref /*unused*/) { - return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS(); -} - bool JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS(); @@ -1144,9 +1133,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableLayoutAnimationsOnIOS", JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS), - makeNativeMethod( - "enableMainQueueCoordinatorOnIOS", - JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS), makeNativeMethod( "enableModuleArgumentNSNullConversionIOS", JReactNativeFeatureFlagsCxxInterop::enableModuleArgumentNSNullConversionIOS), diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h index e9f49b0dbbe5..5659ba401085 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5501bc377ccafc4dab778978ee3f33b2>> + * @generated SignedSource<<8ae9d1ef2789deae877f273dc47a5cad>> */ /** @@ -132,9 +132,6 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableLayoutAnimationsOnIOS( facebook::jni::alias_ref); - static bool enableMainQueueCoordinatorOnIOS( - facebook::jni::alias_ref); - static bool enableModuleArgumentNSNullConversionIOS( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index d20791b13f93..e277c8720756 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<28287e973a90e07fb8cfc2c0c2e8396f>> */ /** @@ -162,10 +162,6 @@ bool ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS() { return getAccessor().enableLayoutAnimationsOnIOS(); } -bool ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS() { - return getAccessor().enableMainQueueCoordinatorOnIOS(); -} - bool ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS() { return getAccessor().enableModuleArgumentNSNullConversionIOS(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 190cc33d5117..5491721be9ee 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<5a7a5248f817b5f00831eea191c82e7f>> */ /** @@ -209,11 +209,6 @@ class ReactNativeFeatureFlags { */ RN_EXPORT static bool enableLayoutAnimationsOnIOS(); - /** - * Make RCTUnsafeExecuteOnMainQueueSync less likely to deadlock, when used in conjuction with sync rendering/events. - */ - RN_EXPORT static bool enableMainQueueCoordinatorOnIOS(); - /** * Enable NSNull conversion when handling module arguments on iOS */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index 6bcbe817124e..af5be222ab46 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<86e02ee84cb27696920774c9e44636bb>> + * @generated SignedSource<> */ /** @@ -641,24 +641,6 @@ bool ReactNativeFeatureFlagsAccessor::enableLayoutAnimationsOnIOS() { return flagValue.value(); } -bool ReactNativeFeatureFlagsAccessor::enableMainQueueCoordinatorOnIOS() { - auto flagValue = enableMainQueueCoordinatorOnIOS_.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(34, "enableMainQueueCoordinatorOnIOS"); - - flagValue = currentProvider_->enableMainQueueCoordinatorOnIOS(); - enableMainQueueCoordinatorOnIOS_ = flagValue; - } - - return flagValue.value(); -} - bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS() { auto flagValue = enableModuleArgumentNSNullConversionIOS_.load(); @@ -668,7 +650,7 @@ bool ReactNativeFeatureFlagsAccessor::enableModuleArgumentNSNullConversionIOS() // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(35, "enableModuleArgumentNSNullConversionIOS"); + markFlagAsAccessed(34, "enableModuleArgumentNSNullConversionIOS"); flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS(); enableModuleArgumentNSNullConversionIOS_ = flagValue; @@ -686,7 +668,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMutationObserverByDefault() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(36, "enableMutationObserverByDefault"); + markFlagAsAccessed(35, "enableMutationObserverByDefault"); flagValue = currentProvider_->enableMutationObserverByDefault(); enableMutationObserverByDefault_ = flagValue; @@ -704,7 +686,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(37, "enableNativeCSSParsing"); + markFlagAsAccessed(36, "enableNativeCSSParsing"); flagValue = currentProvider_->enableNativeCSSParsing(); enableNativeCSSParsing_ = flagValue; @@ -722,7 +704,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNetworkEventReporting() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(38, "enableNetworkEventReporting"); + markFlagAsAccessed(37, "enableNetworkEventReporting"); flagValue = currentProvider_->enableNetworkEventReporting(); enableNetworkEventReporting_ = flagValue; @@ -740,7 +722,7 @@ bool ReactNativeFeatureFlagsAccessor::enablePreparedTextLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "enablePreparedTextLayout"); + markFlagAsAccessed(38, "enablePreparedTextLayout"); flagValue = currentProvider_->enablePreparedTextLayout(); enablePreparedTextLayout_ = flagValue; @@ -758,7 +740,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(40, "enablePropsUpdateReconciliationAndroid"); + markFlagAsAccessed(39, "enablePropsUpdateReconciliationAndroid"); flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid(); enablePropsUpdateReconciliationAndroid_ = flagValue; @@ -776,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::enableRuntimeSchedulerQueueClearingOnError // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(41, "enableRuntimeSchedulerQueueClearingOnError"); + markFlagAsAccessed(40, "enableRuntimeSchedulerQueueClearingOnError"); flagValue = currentProvider_->enableRuntimeSchedulerQueueClearingOnError(); enableRuntimeSchedulerQueueClearingOnError_ = flagValue; @@ -794,7 +776,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSchedulerDelegateInvalidation() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(42, "enableSchedulerDelegateInvalidation"); + markFlagAsAccessed(41, "enableSchedulerDelegateInvalidation"); flagValue = currentProvider_->enableSchedulerDelegateInvalidation(); enableSchedulerDelegateInvalidation_ = flagValue; @@ -812,7 +794,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSwiftUIBasedFilters() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(43, "enableSwiftUIBasedFilters"); + markFlagAsAccessed(42, "enableSwiftUIBasedFilters"); flagValue = currentProvider_->enableSwiftUIBasedFilters(); enableSwiftUIBasedFilters_ = flagValue; @@ -830,7 +812,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(44, "enableViewCulling"); + markFlagAsAccessed(43, "enableViewCulling"); flagValue = currentProvider_->enableViewCulling(); enableViewCulling_ = flagValue; @@ -848,7 +830,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(45, "enableViewRecycling"); + markFlagAsAccessed(44, "enableViewRecycling"); flagValue = currentProvider_->enableViewRecycling(); enableViewRecycling_ = flagValue; @@ -866,7 +848,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForImage() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(46, "enableViewRecyclingForImage"); + markFlagAsAccessed(45, "enableViewRecyclingForImage"); flagValue = currentProvider_->enableViewRecyclingForImage(); enableViewRecyclingForImage_ = flagValue; @@ -884,7 +866,7 @@ bool ReactNativeFeatureFlagsAccessor::enableViewRecyclingForScrollView() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(47, "enableViewRecyclingForScrollView"); + markFlagAsAccessed(46, "enableViewRecyclingForScrollView"); flagValue = currentProvider_->enableViewRecyclingForScrollView(); enableViewRecyclingForScrollView_ = flagValue; @@ -902,7 +884,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(48, "enableViewRecyclingForText"); + markFlagAsAccessed(47, "enableViewRecyclingForText"); flagValue = currentProvider_->enableViewRecyclingForText(); enableViewRecyclingForText_ = flagValue; @@ -920,7 +902,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(49, "enableViewRecyclingForView"); + markFlagAsAccessed(48, "enableViewRecyclingForView"); flagValue = currentProvider_->enableViewRecyclingForView(); enableViewRecyclingForView_ = flagValue; @@ -938,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::enableVirtualViewContainerStateExperimenta // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(50, "enableVirtualViewContainerStateExperimental"); + markFlagAsAccessed(49, "enableVirtualViewContainerStateExperimental"); flagValue = currentProvider_->enableVirtualViewContainerStateExperimental(); enableVirtualViewContainerStateExperimental_ = flagValue; @@ -956,7 +938,7 @@ bool ReactNativeFeatureFlagsAccessor::fixDifferentiatorParentTagForUnflattenCase // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(51, "fixDifferentiatorParentTagForUnflattenCase"); + markFlagAsAccessed(50, "fixDifferentiatorParentTagForUnflattenCase"); flagValue = currentProvider_->fixDifferentiatorParentTagForUnflattenCase(); fixDifferentiatorParentTagForUnflattenCase_ = flagValue; @@ -974,7 +956,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(52, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(51, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -992,7 +974,7 @@ bool ReactNativeFeatureFlagsAccessor::fixYogaFlexBasisFitContentInMainAxis() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(53, "fixYogaFlexBasisFitContentInMainAxis"); + markFlagAsAccessed(52, "fixYogaFlexBasisFitContentInMainAxis"); flagValue = currentProvider_->fixYogaFlexBasisFitContentInMainAxis(); fixYogaFlexBasisFitContentInMainAxis_ = flagValue; @@ -1010,7 +992,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(54, "fuseboxAssertSingleHostState"); + markFlagAsAccessed(53, "fuseboxAssertSingleHostState"); flagValue = currentProvider_->fuseboxAssertSingleHostState(); fuseboxAssertSingleHostState_ = flagValue; @@ -1028,7 +1010,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(55, "fuseboxEnabledRelease"); + markFlagAsAccessed(54, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -1046,7 +1028,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxFrameRecordingEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(56, "fuseboxFrameRecordingEnabled"); + markFlagAsAccessed(55, "fuseboxFrameRecordingEnabled"); flagValue = currentProvider_->fuseboxFrameRecordingEnabled(); fuseboxFrameRecordingEnabled_ = flagValue; @@ -1064,7 +1046,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(57, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(56, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -1082,7 +1064,7 @@ bool ReactNativeFeatureFlagsAccessor::fuseboxScreenshotCaptureEnabled() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(58, "fuseboxScreenshotCaptureEnabled"); + markFlagAsAccessed(57, "fuseboxScreenshotCaptureEnabled"); flagValue = currentProvider_->fuseboxScreenshotCaptureEnabled(); fuseboxScreenshotCaptureEnabled_ = flagValue; @@ -1100,7 +1082,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(59, "hideOffscreenVirtualViewsOnIOS"); + markFlagAsAccessed(58, "hideOffscreenVirtualViewsOnIOS"); flagValue = currentProvider_->hideOffscreenVirtualViewsOnIOS(); hideOffscreenVirtualViewsOnIOS_ = flagValue; @@ -1118,7 +1100,7 @@ bool ReactNativeFeatureFlagsAccessor::optimizedAnimatedPropUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(60, "optimizedAnimatedPropUpdates"); + markFlagAsAccessed(59, "optimizedAnimatedPropUpdates"); flagValue = currentProvider_->optimizedAnimatedPropUpdates(); optimizedAnimatedPropUpdates_ = flagValue; @@ -1136,7 +1118,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(61, "overrideBySynchronousMountPropsAtMountingAndroid"); + markFlagAsAccessed(60, "overrideBySynchronousMountPropsAtMountingAndroid"); flagValue = currentProvider_->overrideBySynchronousMountPropsAtMountingAndroid(); overrideBySynchronousMountPropsAtMountingAndroid_ = flagValue; @@ -1154,7 +1136,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(62, "perfIssuesEnabled"); + markFlagAsAccessed(61, "perfIssuesEnabled"); flagValue = currentProvider_->perfIssuesEnabled(); perfIssuesEnabled_ = flagValue; @@ -1172,7 +1154,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(63, "perfMonitorV2Enabled"); + markFlagAsAccessed(62, "perfMonitorV2Enabled"); flagValue = currentProvider_->perfMonitorV2Enabled(); perfMonitorV2Enabled_ = flagValue; @@ -1190,7 +1172,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(64, "preparedTextCacheSize"); + markFlagAsAccessed(63, "preparedTextCacheSize"); flagValue = currentProvider_->preparedTextCacheSize(); preparedTextCacheSize_ = flagValue; @@ -1208,7 +1190,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(65, "preventShadowTreeCommitExhaustion"); + markFlagAsAccessed(64, "preventShadowTreeCommitExhaustion"); flagValue = currentProvider_->preventShadowTreeCommitExhaustion(); preventShadowTreeCommitExhaustion_ = flagValue; @@ -1226,7 +1208,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2Android() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(66, "redBoxV2Android"); + markFlagAsAccessed(65, "redBoxV2Android"); flagValue = currentProvider_->redBoxV2Android(); redBoxV2Android_ = flagValue; @@ -1244,7 +1226,7 @@ bool ReactNativeFeatureFlagsAccessor::redBoxV2IOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(67, "redBoxV2IOS"); + markFlagAsAccessed(66, "redBoxV2IOS"); flagValue = currentProvider_->redBoxV2IOS(); redBoxV2IOS_ = flagValue; @@ -1262,7 +1244,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(68, "shouldPressibilityUseW3CPointerEventsForHover"); + markFlagAsAccessed(67, "shouldPressibilityUseW3CPointerEventsForHover"); flagValue = currentProvider_->shouldPressibilityUseW3CPointerEventsForHover(); shouldPressibilityUseW3CPointerEventsForHover_ = flagValue; @@ -1280,7 +1262,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(69, "shouldTriggerResponderTransferOnScrollAndroid"); + markFlagAsAccessed(68, "shouldTriggerResponderTransferOnScrollAndroid"); flagValue = currentProvider_->shouldTriggerResponderTransferOnScrollAndroid(); shouldTriggerResponderTransferOnScrollAndroid_ = flagValue; @@ -1298,7 +1280,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(70, "skipActivityIdentityAssertionOnHostPause"); + markFlagAsAccessed(69, "skipActivityIdentityAssertionOnHostPause"); flagValue = currentProvider_->skipActivityIdentityAssertionOnHostPause(); skipActivityIdentityAssertionOnHostPause_ = flagValue; @@ -1316,7 +1298,7 @@ bool ReactNativeFeatureFlagsAccessor::syncAndroidClipBoundsWithOverflow() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(71, "syncAndroidClipBoundsWithOverflow"); + markFlagAsAccessed(70, "syncAndroidClipBoundsWithOverflow"); flagValue = currentProvider_->syncAndroidClipBoundsWithOverflow(); syncAndroidClipBoundsWithOverflow_ = flagValue; @@ -1334,7 +1316,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(72, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(71, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -1352,7 +1334,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(73, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(72, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -1370,7 +1352,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(74, "updateRuntimeShadowNodeReferencesOnCommitThread"); + markFlagAsAccessed(73, "updateRuntimeShadowNodeReferencesOnCommitThread"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommitThread(); updateRuntimeShadowNodeReferencesOnCommitThread_ = flagValue; @@ -1388,7 +1370,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(75, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(74, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -1406,7 +1388,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(76, "useFabricInterop"); + markFlagAsAccessed(75, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -1424,7 +1406,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(77, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(76, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -1442,7 +1424,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(78, "useNestedScrollViewAndroid"); + markFlagAsAccessed(77, "useNestedScrollViewAndroid"); flagValue = currentProvider_->useNestedScrollViewAndroid(); useNestedScrollViewAndroid_ = flagValue; @@ -1460,7 +1442,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedViewRegistryOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(79, "useOptimizedViewRegistryOnAndroid"); + markFlagAsAccessed(78, "useOptimizedViewRegistryOnAndroid"); flagValue = currentProvider_->useOptimizedViewRegistryOnAndroid(); useOptimizedViewRegistryOnAndroid_ = flagValue; @@ -1478,7 +1460,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(80, "useSharedAnimatedBackend"); + markFlagAsAccessed(79, "useSharedAnimatedBackend"); flagValue = currentProvider_->useSharedAnimatedBackend(); useSharedAnimatedBackend_ = flagValue; @@ -1496,7 +1478,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(81, "useTraitHiddenOnAndroid"); + markFlagAsAccessed(80, "useTraitHiddenOnAndroid"); flagValue = currentProvider_->useTraitHiddenOnAndroid(); useTraitHiddenOnAndroid_ = flagValue; @@ -1514,7 +1496,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(82, "useTurboModuleInterop"); + markFlagAsAccessed(81, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -1532,7 +1514,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(83, "useUnorderedMapInDifferentiator"); + markFlagAsAccessed(82, "useUnorderedMapInDifferentiator"); flagValue = currentProvider_->useUnorderedMapInDifferentiator(); useUnorderedMapInDifferentiator_ = flagValue; @@ -1550,7 +1532,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(84, "viewCullingOutsetRatio"); + markFlagAsAccessed(83, "viewCullingOutsetRatio"); flagValue = currentProvider_->viewCullingOutsetRatio(); viewCullingOutsetRatio_ = flagValue; @@ -1568,7 +1550,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(85, "viewTransitionEnabled"); + markFlagAsAccessed(84, "viewTransitionEnabled"); flagValue = currentProvider_->viewTransitionEnabled(); viewTransitionEnabled_ = flagValue; @@ -1586,7 +1568,7 @@ bool ReactNativeFeatureFlagsAccessor::viewTransitionUseHardwareBitmapAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(86, "viewTransitionUseHardwareBitmapAndroid"); + markFlagAsAccessed(85, "viewTransitionUseHardwareBitmapAndroid"); flagValue = currentProvider_->viewTransitionUseHardwareBitmapAndroid(); viewTransitionUseHardwareBitmapAndroid_ = flagValue; @@ -1604,7 +1586,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(87, "virtualViewPrerenderRatio"); + markFlagAsAccessed(86, "virtualViewPrerenderRatio"); flagValue = currentProvider_->virtualViewPrerenderRatio(); virtualViewPrerenderRatio_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index 15f7ebb73bc1..048d1dadafe1 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<0f17b690a3e57e30984b85f5c0bbc54e>> + * @generated SignedSource<<966ea58ea2bea2938311ccbed541c15f>> */ /** @@ -66,7 +66,6 @@ class ReactNativeFeatureFlagsAccessor { bool enableKeyEvents(); bool enableLayoutAnimationsOnAndroid(); bool enableLayoutAnimationsOnIOS(); - bool enableMainQueueCoordinatorOnIOS(); bool enableModuleArgumentNSNullConversionIOS(); bool enableMutationObserverByDefault(); bool enableNativeCSSParsing(); @@ -131,7 +130,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 88> accessedFeatureFlags_; + std::array, 87> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> cdpInteractionMetricsEnabled_; @@ -167,7 +166,6 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableKeyEvents_; std::atomic> enableLayoutAnimationsOnAndroid_; std::atomic> enableLayoutAnimationsOnIOS_; - std::atomic> enableMainQueueCoordinatorOnIOS_; std::atomic> enableModuleArgumentNSNullConversionIOS_; std::atomic> enableMutationObserverByDefault_; std::atomic> enableNativeCSSParsing_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 49105b632ba7..ed16368f3d85 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<4146b96e76f73d1151be8f7af96d13fb>> + * @generated SignedSource<<0d3da3bc44fefe0a2e32169b2ba31802>> */ /** @@ -163,10 +163,6 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return true; } - bool enableMainQueueCoordinatorOnIOS() override { - return false; - } - bool enableModuleArgumentNSNullConversionIOS() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index b59165278b97..136ff1c34fbe 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<12ea64df682b2285772cafb030a60e5e>> + * @generated SignedSource<<8464acaf265b1bcbe220d4f30ba68dc9>> */ /** @@ -351,15 +351,6 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableLayoutAnimationsOnIOS(); } - bool enableMainQueueCoordinatorOnIOS() override { - auto value = values_["enableMainQueueCoordinatorOnIOS"]; - if (!value.isNull()) { - return value.getBool(); - } - - return ReactNativeFeatureFlagsDefaults::enableMainQueueCoordinatorOnIOS(); - } - bool enableModuleArgumentNSNullConversionIOS() override { auto value = values_["enableModuleArgumentNSNullConversionIOS"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index e66f23b896a8..ba167e75f38f 100644 --- a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h +++ b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<<3a9213182e33b82085ae53db2c1cc126>> */ /** @@ -59,7 +59,6 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableKeyEvents() = 0; virtual bool enableLayoutAnimationsOnAndroid() = 0; virtual bool enableLayoutAnimationsOnIOS() = 0; - virtual bool enableMainQueueCoordinatorOnIOS() = 0; virtual bool enableModuleArgumentNSNullConversionIOS() = 0; virtual bool enableMutationObserverByDefault() = 0; virtual bool enableNativeCSSParsing() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index b3447054a6ea..7f7d52f0d54d 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<5407b8f41ed854b1f296584ff374c929>> + * @generated SignedSource<> */ /** @@ -214,11 +214,6 @@ bool NativeReactNativeFeatureFlags::enableLayoutAnimationsOnIOS( return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS(); } -bool NativeReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS( - jsi::Runtime& /*runtime*/) { - return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS(); -} - bool NativeReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::enableModuleArgumentNSNullConversionIOS(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index d8d21b4311ec..00d595719baf 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h +++ b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<> + * @generated SignedSource<> */ /** @@ -104,8 +104,6 @@ class NativeReactNativeFeatureFlags bool enableLayoutAnimationsOnIOS(jsi::Runtime& runtime); - bool enableMainQueueCoordinatorOnIOS(jsi::Runtime& runtime); - bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime& runtime); bool enableMutationObserverByDefault(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp index 840669a68a69..574ec8884fcc 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -957,17 +957,6 @@ TEST_P(RuntimeSchedulerTest, basicSameThreadExecution) { // in `executeSynchronouslyOnSameThread_CAN_DEADLOCK`. The off-main `driver` // thread drives the stub queue ("JS thread") so the main thread can wake up. TEST_P(RuntimeSchedulerTest, basicUIThreadExecution) { - class CoordinatorFeatureFlags : public RuntimeSchedulerTestFeatureFlags { - public: - using RuntimeSchedulerTestFeatureFlags::RuntimeSchedulerTestFeatureFlags; - bool enableMainQueueCoordinatorOnIOS() override { - return true; - } - }; - ReactNativeFeatureFlags::dangerouslyReset(); - ReactNativeFeatureFlags::override( - std::make_unique(GetParam())); - bool didRunSynchronousTask = false; std::thread driver([this]() { diff --git a/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm b/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm index f0fa55eacdbf..7f3183db0060 100644 --- a/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm +++ b/packages/react-native/ReactCommon/react/runtime/iostests/MainQueueCoordinatorTests.mm @@ -11,48 +11,17 @@ #import #import #import -#import -#import -#import #import #import using namespace facebook::react; -namespace { -class MainQueueCoordinatorOverride : public ReactNativeFeatureFlagsDefaults { - public: - explicit MainQueueCoordinatorOverride(bool enabled) : enabled_(enabled) {} - bool enableMainQueueCoordinatorOnIOS() override - { - return enabled_; - } - - private: - bool enabled_; -}; -} // namespace - @interface MainQueueCoordinatorTests : XCTestCase @end @implementation MainQueueCoordinatorTests -- (void)setUp -{ - [super setUp]; - ReactNativeFeatureFlags::dangerouslyReset(); -} - -- (void)tearDown -{ - ReactNativeFeatureFlags::dangerouslyReset(); - [super tearDown]; -} - -#pragma mark - RCTUnsafeExecuteOnMainQueueSync - -- (void)_assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread +- (void)testRCTUnsafeExecuteOnMainQueueSync_runsBlockOnMainFromBG { XCTestExpectation *done = [self expectationWithDescription:@"BG-thread call completed"]; __block BOOL ranOnMain = NO; @@ -71,25 +40,8 @@ - (void)_assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThrea XCTAssertTrue(returnedToBG, @"BG thread must resume after sync call returns"); } -- (void)testRCTUnsafeExecuteOnMainQueueSync_flagOff_runsBlockOnMainFromBG +- (void)testExecuteSynchronouslyOnSameThread_pumpsUITasksWhileWaitingForJS { - // Default off — exercises the dispatch_sync(main) branch. - [self _assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread]; -} - -- (void)testRCTUnsafeExecuteOnMainQueueSync_flagOn_runsBlockOnMainFromBG -{ - ReactNativeFeatureFlags::override(std::make_unique(true)); - // Coordinator branch — `unsafeExecuteOnMainThreadSync` posts a UI task and waits. - [self _assertRCTUnsafeExecuteOnMainQueueSyncRunsBlockOnMainFromBackgroundThread]; -} - -#pragma mark - executeSynchronouslyOnSameThread_CAN_DEADLOCK - -- (void)testExecuteSynchronouslyOnSameThread_flagOn_pumpsUITasksWhileWaitingForJS -{ - ReactNativeFeatureFlags::override(std::make_unique(true)); - // A real runtime — needed only for the reference type. We never call into it. auto runtime = facebook::hermes::makeHermesRuntime(); @@ -104,9 +56,9 @@ - (void)testExecuteSynchronouslyOnSameThread_flagOn_pumpsUITasksWhileWaitingForJ }).detach(); }; - // Both threads only ever write on main, so plain ints are race-free. Held in - // a struct so we can capture a pointer from an ObjC block and a reference - // from a C++ lambda without `__block` (which doesn't compose with lambdas). + // Both writes happen on main, so plain ints are race-free. Held in a struct + // so we can capture a pointer from an ObjC block and a reference from a C++ + // lambda without `__block` (which doesn't compose with lambdas). struct State { int sequence = 0; int uiTaskOrder = 0; diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm index 34b335d7f928..61a039a35943 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm @@ -9,9 +9,7 @@ #import #import -#import #import -#import #import #import #import @@ -111,8 +109,8 @@ void runUITask(UITask &uiTask) } /** - * This method is resilient to multiple javascript threads. - * This can happen when multiple react instances interleave. + * Coordinator-style implementation that is resilient to multiple javascript + * threads. This can happen when multiple react instances interleave. * * The extension from 1 js thread to n: All js threads race to * get a ticket to post a ui task. The first one to get the ticket @@ -122,10 +120,13 @@ void runUITask(UITask &uiTask) * * For simplicity, we will just use this algorithm for all bg threads. * Not just the js thread. + * + * Requires the caller to be on the main thread, because the wait loop pumps + * UI tasks that are dispatched to the main queue. */ -void saferExecuteSynchronouslyOnSameThread_CAN_DEADLOCK( +void coordinatedExecuteSynchronouslyOnSameThread_CAN_DEADLOCK( const RuntimeExecutor &runtimeExecutor, - std::function &&runtimeWork) + std::function &&runtimeWork) { react_native_assert([[NSThread currentThread] isMainThread] && !g_isRunningUITask); @@ -159,52 +160,32 @@ void saferExecuteSynchronouslyOnSameThread_CAN_DEADLOCK( runtimeWork(*runtime); } -/* +/** * Schedules `runtimeWork` to be executed on the same thread using the - * `RuntimeExecutor`, and blocks on its completion. - * - * Example: - * - [UI thread] Schedule `runtimeCaptureBlock` on js thread - * - [UI thread] Wait for runtime capture: await(runtime) - * - [JS thread] Capture runtime for ui thread: resolve(runtime, &rt); - * - [JS thread] Wait until runtimeWork done: await(runtimeWorkDone) - * - [UI thread] Call runtimeWork: runtimeWork(*runtimePrt); - * - [UI thread] Signal runtimeWork done: resolve(runtimeWorkDone) - * - [UI thread] Wait until runtime capture block finished: - * await(runtimeCaptureBlockDone); - * - [JS thread] Signal runtime capture block is finished: - * resolve(runtimeCaptureBlockDone); + * `RuntimeExecutor`, and blocks on its completion. Used when the caller is + * not on the main thread (the coordinator implementation requires main). */ -void legacyExecuteSynchronouslyOnSameThread_CAN_DEADLOCK( +void simpleExecuteSynchronouslyOnSameThread_CAN_DEADLOCK( const RuntimeExecutor &runtimeExecutor, std::function &&runtimeWork) { std::promise runtime; - std::promise runtimeCaptureBlockDone; std::promise runtimeWorkDone; auto callingThread = std::this_thread::get_id(); - auto runtimeCaptureBlock = [&](jsi::Runtime &rt) { + runtimeExecutor([&](jsi::Runtime &rt) { runtime.set_value(&rt); - auto runtimeThread = std::this_thread::get_id(); - if (callingThread != runtimeThread) { - // Block `runtimeThread` on execution of `runtimeWork` on `callingThread`. + if (callingThread != std::this_thread::get_id()) { + // Block the runtime thread on execution of `runtimeWork` on the calling thread. runtimeWorkDone.get_future().wait(); } - - // TODO(T225331233): This is likely unnecessary. Remove it. - runtimeCaptureBlockDone.set_value(); - }; - runtimeExecutor(std::move(runtimeCaptureBlock)); + }); jsi::Runtime *runtimePtr = runtime.get_future().get(); runtimeWork(*runtimePtr); runtimeWorkDone.set_value(); - - // TODO(T225331233): This is likely unnecessary. Remove it. - runtimeCaptureBlockDone.get_future().wait(); } } // namespace @@ -213,10 +194,10 @@ void executeSynchronouslyOnSameThread_CAN_DEADLOCK( const RuntimeExecutor &runtimeExecutor, std::function &&runtimeWork) { - if (ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS()) { - saferExecuteSynchronouslyOnSameThread_CAN_DEADLOCK(runtimeExecutor, std::move(runtimeWork)); + if ([[NSThread currentThread] isMainThread] && !g_isRunningUITask) { + coordinatedExecuteSynchronouslyOnSameThread_CAN_DEADLOCK(runtimeExecutor, std::move(runtimeWork)); } else { - legacyExecuteSynchronouslyOnSameThread_CAN_DEADLOCK(runtimeExecutor, std::move(runtimeWork)); + simpleExecuteSynchronouslyOnSameThread_CAN_DEADLOCK(runtimeExecutor, std::move(runtimeWork)); } } diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index f9423307b22a..abfe736a22f6 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -411,17 +411,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - enableMainQueueCoordinatorOnIOS: { - defaultValue: false, - metadata: { - dateAdded: '2025-05-17', - description: - 'Make RCTUnsafeExecuteOnMainQueueSync less likely to deadlock, when used in conjuction with sync rendering/events.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, enableModuleArgumentNSNullConversionIOS: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 1410dd843d48..4f350769fcfb 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<454401abd8b8ccba96f92ad0b1545596>> + * @generated SignedSource<<9b77e2e765f442938a71b06f35673125>> * @flow strict * @noformat */ @@ -80,7 +80,6 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableKeyEvents: Getter, enableLayoutAnimationsOnAndroid: Getter, enableLayoutAnimationsOnIOS: Getter, - enableMainQueueCoordinatorOnIOS: Getter, enableModuleArgumentNSNullConversionIOS: Getter, enableMutationObserverByDefault: Getter, enableNativeCSSParsing: Getter, @@ -331,10 +330,6 @@ export const enableLayoutAnimationsOnAndroid: Getter = createNativeFlag * When enabled, LayoutAnimations API will animate state changes on iOS. */ export const enableLayoutAnimationsOnIOS: Getter = createNativeFlagGetter('enableLayoutAnimationsOnIOS', true); -/** - * Make RCTUnsafeExecuteOnMainQueueSync less likely to deadlock, when used in conjuction with sync rendering/events. - */ -export const enableMainQueueCoordinatorOnIOS: Getter = createNativeFlagGetter('enableMainQueueCoordinatorOnIOS', false); /** * Enable NSNull conversion when handling module arguments on iOS */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index a362c6228c95..93ec12184ecd 100644 --- a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<493d48c7bc834e73fe88939de3866159>> + * @generated SignedSource<> * @flow strict * @noformat */ @@ -59,7 +59,6 @@ export interface Spec extends TurboModule { +enableKeyEvents?: () => boolean; +enableLayoutAnimationsOnAndroid?: () => boolean; +enableLayoutAnimationsOnIOS?: () => boolean; - +enableMainQueueCoordinatorOnIOS?: () => boolean; +enableModuleArgumentNSNullConversionIOS?: () => boolean; +enableMutationObserverByDefault?: () => boolean; +enableNativeCSSParsing?: () => boolean;