diff --git a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec index 3b2fec41f4c4..5f0418b180b5 100644 --- a/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec +++ b/packages/react-native/Libraries/AppDelegate/React-RCTAppDelegate.podspec @@ -67,6 +67,7 @@ Pod::Spec.new do |s| s.dependency "React-RCTFBReactNativeSpec" s.dependency "React-defaultsnativemodule" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "ReactCommon", :subspec => "turbomodule/core", :additional_framework_paths => ["react/nativemodule/core"]) add_dependency(s, "React-NativeModulesApple") add_dependency(s, "React-runtimescheduler") diff --git a/packages/react-native/React-Core.podspec b/packages/react-native/React-Core.podspec index adf3279bb65d..4f91de5a0442 100644 --- a/packages/react-native/React-Core.podspec +++ b/packages/react-native/React-Core.podspec @@ -125,6 +125,7 @@ Pod::Spec.new do |s| s.resource_bundles = {'React-Core_privacy' => 'React/Resources/PrivacyInfo.xcprivacy'} + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsitooling", :framework_name => "JSITooling") diff --git a/packages/react-native/React/CoreModules/React-CoreModules.podspec b/packages/react-native/React/CoreModules/React-CoreModules.podspec index 07eb23ce91b6..f0d0fcd4ba29 100644 --- a/packages/react-native/React/CoreModules/React-CoreModules.podspec +++ b/packages/react-native/React/CoreModules/React-CoreModules.podspec @@ -52,6 +52,8 @@ Pod::Spec.new do |s| s.dependency "React-RCTImage", version s.dependency "React-jsi", version s.dependency 'React-RCTBlob' + + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') diff --git a/packages/react-native/React/React-RCTFabric.podspec b/packages/react-native/React/React-RCTFabric.podspec index df5cfc0ee885..289d9551a70c 100644 --- a/packages/react-native/React/React-RCTFabric.podspec +++ b/packages/react-native/React/React-RCTFabric.podspec @@ -83,6 +83,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-performancetimeline") add_dependency(s, "React-rendererdebug") add_dependency(s, "React-rendererconsistency") + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-runtimescheduler") add_dependency(s, "React-RCTAnimation", :framework_name => 'RCTAnimation') add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') diff --git a/packages/react-native/React/Runtime/React-RCTRuntime.podspec b/packages/react-native/React/Runtime/React-RCTRuntime.podspec index eba281d1a640..8a496d5beb39 100644 --- a/packages/react-native/React/Runtime/React-RCTRuntime.podspec +++ b/packages/react-native/React/Runtime/React-RCTRuntime.podspec @@ -49,6 +49,7 @@ Pod::Spec.new do |s| s.dependency "React-Core" s.dependency "React-jsi" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsitooling", :framework_name => "JSITooling") add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') 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 d5da0c091229..e7014329ab2f 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<> */ /** @@ -168,6 +168,12 @@ 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() + /** * Makes modules requiring main queue setup initialize on the main thread, during React Native init. */ 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 504ef330da3b..091deb94efd4 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<<4665e190f626b377f37e14c1c19f809d>> + * @generated SignedSource<<62a722030e9166b231e5368f193f6f0c>> */ /** @@ -43,6 +43,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces private var enableIntersectionObserverEventLoopIntegrationCache: Boolean? = null private var enableLayoutAnimationsOnAndroidCache: Boolean? = null private var enableLayoutAnimationsOnIOSCache: Boolean? = null + private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null private var enableMainQueueModulesOnIOSCache: Boolean? = null private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null @@ -279,6 +280,15 @@ 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 enableMainQueueModulesOnIOS(): Boolean { var cached = enableMainQueueModulesOnIOSCache 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 a71962aa0f9b..8003822ddd71 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<> + * @generated SignedSource<<39d78493b17f7abfb4220d25e663ae55>> */ /** @@ -74,6 +74,8 @@ public object ReactNativeFeatureFlagsCxxInterop { @DoNotStrip @JvmStatic public external fun enableLayoutAnimationsOnIOS(): Boolean + @DoNotStrip @JvmStatic public external fun enableMainQueueCoordinatorOnIOS(): Boolean + @DoNotStrip @JvmStatic public external fun enableMainQueueModulesOnIOS(): Boolean @DoNotStrip @JvmStatic public external fun enableModuleArgumentNSNullConversionIOS(): 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 9ecdf8b7c7d0..b0b39369151b 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<<07ea15d4fd3f3bc73c8f49cd24724caf>> + * @generated SignedSource<<830cbb41b3886b715b57c2f0c29f4623>> */ /** @@ -69,6 +69,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi override fun enableLayoutAnimationsOnIOS(): Boolean = true + override fun enableMainQueueCoordinatorOnIOS(): Boolean = false + override fun enableMainQueueModulesOnIOS(): Boolean = false override fun enableModuleArgumentNSNullConversionIOS(): 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 f8adedd34747..f8e79cd1fa68 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<> */ /** @@ -47,6 +47,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc private var enableIntersectionObserverEventLoopIntegrationCache: Boolean? = null private var enableLayoutAnimationsOnAndroidCache: Boolean? = null private var enableLayoutAnimationsOnIOSCache: Boolean? = null + private var enableMainQueueCoordinatorOnIOSCache: Boolean? = null private var enableMainQueueModulesOnIOSCache: Boolean? = null private var enableModuleArgumentNSNullConversionIOSCache: Boolean? = null private var enableNativeCSSParsingCache: Boolean? = null @@ -306,6 +307,16 @@ 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 enableMainQueueModulesOnIOS(): Boolean { var cached = enableMainQueueModulesOnIOSCache 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 b57eba090b6d..cdfa7660d614 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<<1e5562ce20c0735c926c1cb029b93e18>> + * @generated SignedSource<<25acda9d60691c0ca5ea4776bfae594a>> */ /** @@ -69,6 +69,8 @@ public interface ReactNativeFeatureFlagsProvider { @DoNotStrip public fun enableLayoutAnimationsOnIOS(): Boolean + @DoNotStrip public fun enableMainQueueCoordinatorOnIOS(): Boolean + @DoNotStrip public fun enableMainQueueModulesOnIOS(): Boolean @DoNotStrip public fun enableModuleArgumentNSNullConversionIOS(): 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 db038b4ff4df..b30dc6a7bad2 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<<078954ede626079b7d36ab63cdbab761>> + * @generated SignedSource<> */ /** @@ -177,6 +177,12 @@ class ReactNativeFeatureFlagsJavaProvider return method(javaProvider_); } + bool enableMainQueueCoordinatorOnIOS() override { + static const auto method = + getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableMainQueueCoordinatorOnIOS"); + return method(javaProvider_); + } + bool enableMainQueueModulesOnIOS() override { static const auto method = getReactNativeFeatureFlagsProviderJavaClass()->getMethod("enableMainQueueModulesOnIOS"); @@ -464,6 +470,11 @@ bool JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS( return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS(); } +bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS( + facebook::jni::alias_ref /*unused*/) { + return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS(); +} + bool JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS( facebook::jni::alias_ref /*unused*/) { return ReactNativeFeatureFlags::enableMainQueueModulesOnIOS(); @@ -704,6 +715,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() { makeNativeMethod( "enableLayoutAnimationsOnIOS", JReactNativeFeatureFlagsCxxInterop::enableLayoutAnimationsOnIOS), + makeNativeMethod( + "enableMainQueueCoordinatorOnIOS", + JReactNativeFeatureFlagsCxxInterop::enableMainQueueCoordinatorOnIOS), makeNativeMethod( "enableMainQueueModulesOnIOS", JReactNativeFeatureFlagsCxxInterop::enableMainQueueModulesOnIOS), 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 5ebb4a3db76e..c0d2b716b373 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<<083e45ab99622254be46213ba07c586b>> + * @generated SignedSource<<3a00be0b706f3513e1aca741c55a0747>> */ /** @@ -99,6 +99,9 @@ class JReactNativeFeatureFlagsCxxInterop static bool enableLayoutAnimationsOnIOS( facebook::jni::alias_ref); + static bool enableMainQueueCoordinatorOnIOS( + facebook::jni::alias_ref); + static bool enableMainQueueModulesOnIOS( facebook::jni::alias_ref); diff --git a/packages/react-native/ReactCommon/React-Fabric.podspec b/packages/react-native/ReactCommon/React-Fabric.podspec index efa23b559c84..fabbc1f7f2e0 100644 --- a/packages/react-native/ReactCommon/React-Fabric.podspec +++ b/packages/react-native/ReactCommon/React-Fabric.podspec @@ -49,6 +49,7 @@ Pod::Spec.new do |s| s.dependency "React-runtimescheduler" s.dependency "React-cxxreact" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-rendererdebug") add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"]) add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"]) diff --git a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec index e34e6e0d948f..d47eeada0504 100644 --- a/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/packages/react-native/ReactCommon/cxxreact/React-cxxreact.podspec @@ -39,7 +39,7 @@ Pod::Spec.new do |s| add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') s.dependency "React-callinvoker", version - s.dependency "React-runtimeexecutor", version + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) s.dependency "React-perflogger", version s.dependency "React-jsi", version s.dependency "React-logger", version diff --git a/packages/react-native/ReactCommon/hermes/React-hermes.podspec b/packages/react-native/ReactCommon/hermes/React-hermes.podspec index 1592899c190d..186177f6ebb6 100644 --- a/packages/react-native/ReactCommon/hermes/React-hermes.podspec +++ b/packages/react-native/ReactCommon/hermes/React-hermes.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| s.dependency "React-perflogger", version s.dependency "hermes-engine" s.dependency "React-jsi" - s.dependency "React-runtimeexecutor" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_rn_third_party_dependencies(s) end diff --git a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index 7b70f4e2188a..ebeddf24a236 100644 --- a/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/packages/react-native/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -32,6 +32,7 @@ Pod::Spec.new do |s| s.dependency "React-cxxreact", version s.dependency "React-jsi", version s.dependency "React-perflogger", version + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') diff --git a/packages/react-native/ReactCommon/jsinspector-modern/React-jsinspector.podspec b/packages/react-native/ReactCommon/jsinspector-modern/React-jsinspector.podspec index 6a666a7afa8b..a1f1766cc836 100644 --- a/packages/react-native/ReactCommon/jsinspector-modern/React-jsinspector.podspec +++ b/packages/react-native/ReactCommon/jsinspector-modern/React-jsinspector.podspec @@ -49,7 +49,7 @@ Pod::Spec.new do |s| end s.dependency "React-featureflags" - s.dependency "React-runtimeexecutor", version + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) s.dependency "React-jsi" add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectornetwork", :framework_name => 'jsinspector_modernnetwork') diff --git a/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec b/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec index ae1a79c38d0c..35b278483257 100644 --- a/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec +++ b/packages/react-native/ReactCommon/jsitooling/React-jsitooling.podspec @@ -40,6 +40,7 @@ Pod::Spec.new do |s| s.dependency "React-cxxreact", version s.dependency "React-jsi", version + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') add_dependency(s, "React-jsinspectortracing", :framework_name => 'jsinspector_moderntracing') diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp index 4d38e66d3ca8..ef7389534f05 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<<05405c3bb41e2511ac66792eb641db5e>> */ /** @@ -118,6 +118,10 @@ bool ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS() { return getAccessor().enableLayoutAnimationsOnIOS(); } +bool ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS() { + return getAccessor().enableMainQueueCoordinatorOnIOS(); +} + bool ReactNativeFeatureFlags::enableMainQueueModulesOnIOS() { return getAccessor().enableMainQueueModulesOnIOS(); } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h index 77d3a6b8a794..90aef2fa729b 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<> */ /** @@ -154,6 +154,11 @@ 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(); + /** * Makes modules requiring main queue setup initialize on the main thread, during React Native init. */ diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.cpp index e146b039da70..f09250be2ea6 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<<955524ea199666cfdd38ab4b73efcd2a>> + * @generated SignedSource<<5a2deb42cf254a1f8705d7d012394fad>> */ /** @@ -443,6 +443,24 @@ 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(23, "enableMainQueueCoordinatorOnIOS"); + + flagValue = currentProvider_->enableMainQueueCoordinatorOnIOS(); + enableMainQueueCoordinatorOnIOS_ = flagValue; + } + + return flagValue.value(); +} + bool ReactNativeFeatureFlagsAccessor::enableMainQueueModulesOnIOS() { auto flagValue = enableMainQueueModulesOnIOS_.load(); @@ -452,7 +470,7 @@ bool ReactNativeFeatureFlagsAccessor::enableMainQueueModulesOnIOS() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(23, "enableMainQueueModulesOnIOS"); + markFlagAsAccessed(24, "enableMainQueueModulesOnIOS"); flagValue = currentProvider_->enableMainQueueModulesOnIOS(); enableMainQueueModulesOnIOS_ = flagValue; @@ -470,7 +488,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(24, "enableModuleArgumentNSNullConversionIOS"); + markFlagAsAccessed(25, "enableModuleArgumentNSNullConversionIOS"); flagValue = currentProvider_->enableModuleArgumentNSNullConversionIOS(); enableModuleArgumentNSNullConversionIOS_ = flagValue; @@ -488,7 +506,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(25, "enableNativeCSSParsing"); + markFlagAsAccessed(26, "enableNativeCSSParsing"); flagValue = currentProvider_->enableNativeCSSParsing(); enableNativeCSSParsing_ = flagValue; @@ -506,7 +524,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(26, "enableNetworkEventReporting"); + markFlagAsAccessed(27, "enableNetworkEventReporting"); flagValue = currentProvider_->enableNetworkEventReporting(); enableNetworkEventReporting_ = flagValue; @@ -524,7 +542,7 @@ bool ReactNativeFeatureFlagsAccessor::enableNewBackgroundAndBorderDrawables() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(27, "enableNewBackgroundAndBorderDrawables"); + markFlagAsAccessed(28, "enableNewBackgroundAndBorderDrawables"); flagValue = currentProvider_->enableNewBackgroundAndBorderDrawables(); enableNewBackgroundAndBorderDrawables_ = flagValue; @@ -542,7 +560,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(28, "enablePreparedTextLayout"); + markFlagAsAccessed(29, "enablePreparedTextLayout"); flagValue = currentProvider_->enablePreparedTextLayout(); enablePreparedTextLayout_ = flagValue; @@ -560,7 +578,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(29, "enablePropsUpdateReconciliationAndroid"); + markFlagAsAccessed(30, "enablePropsUpdateReconciliationAndroid"); flagValue = currentProvider_->enablePropsUpdateReconciliationAndroid(); enablePropsUpdateReconciliationAndroid_ = flagValue; @@ -578,7 +596,7 @@ bool ReactNativeFeatureFlagsAccessor::enableResourceTimingAPI() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(30, "enableResourceTimingAPI"); + markFlagAsAccessed(31, "enableResourceTimingAPI"); flagValue = currentProvider_->enableResourceTimingAPI(); enableResourceTimingAPI_ = flagValue; @@ -596,7 +614,7 @@ bool ReactNativeFeatureFlagsAccessor::enableSynchronousStateUpdates() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(31, "enableSynchronousStateUpdates"); + markFlagAsAccessed(32, "enableSynchronousStateUpdates"); flagValue = currentProvider_->enableSynchronousStateUpdates(); enableSynchronousStateUpdates_ = flagValue; @@ -614,7 +632,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(32, "enableViewCulling"); + markFlagAsAccessed(33, "enableViewCulling"); flagValue = currentProvider_->enableViewCulling(); enableViewCulling_ = flagValue; @@ -632,7 +650,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(33, "enableViewRecycling"); + markFlagAsAccessed(34, "enableViewRecycling"); flagValue = currentProvider_->enableViewRecycling(); enableViewRecycling_ = flagValue; @@ -650,7 +668,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(34, "enableViewRecyclingForText"); + markFlagAsAccessed(35, "enableViewRecyclingForText"); flagValue = currentProvider_->enableViewRecyclingForText(); enableViewRecyclingForText_ = flagValue; @@ -668,7 +686,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(35, "enableViewRecyclingForView"); + markFlagAsAccessed(36, "enableViewRecyclingForView"); flagValue = currentProvider_->enableViewRecyclingForView(); enableViewRecyclingForView_ = flagValue; @@ -686,7 +704,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(36, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); + markFlagAsAccessed(37, "fixMappingOfEventPrioritiesBetweenFabricAndReact"); flagValue = currentProvider_->fixMappingOfEventPrioritiesBetweenFabricAndReact(); fixMappingOfEventPrioritiesBetweenFabricAndReact_ = flagValue; @@ -704,7 +722,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(37, "fuseboxEnabledRelease"); + markFlagAsAccessed(38, "fuseboxEnabledRelease"); flagValue = currentProvider_->fuseboxEnabledRelease(); fuseboxEnabledRelease_ = flagValue; @@ -722,7 +740,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(38, "fuseboxNetworkInspectionEnabled"); + markFlagAsAccessed(39, "fuseboxNetworkInspectionEnabled"); flagValue = currentProvider_->fuseboxNetworkInspectionEnabled(); fuseboxNetworkInspectionEnabled_ = flagValue; @@ -740,7 +758,7 @@ bool ReactNativeFeatureFlagsAccessor::incorporateMaxLinesDuringAndroidLayout() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(39, "incorporateMaxLinesDuringAndroidLayout"); + markFlagAsAccessed(40, "incorporateMaxLinesDuringAndroidLayout"); flagValue = currentProvider_->incorporateMaxLinesDuringAndroidLayout(); incorporateMaxLinesDuringAndroidLayout_ = flagValue; @@ -758,7 +776,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(40, "traceTurboModulePromiseRejectionsOnAndroid"); + markFlagAsAccessed(41, "traceTurboModulePromiseRejectionsOnAndroid"); flagValue = currentProvider_->traceTurboModulePromiseRejectionsOnAndroid(); traceTurboModulePromiseRejectionsOnAndroid_ = flagValue; @@ -776,7 +794,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(41, "updateRuntimeShadowNodeReferencesOnCommit"); + markFlagAsAccessed(42, "updateRuntimeShadowNodeReferencesOnCommit"); flagValue = currentProvider_->updateRuntimeShadowNodeReferencesOnCommit(); updateRuntimeShadowNodeReferencesOnCommit_ = flagValue; @@ -794,7 +812,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(42, "useAlwaysAvailableJSErrorHandling"); + markFlagAsAccessed(43, "useAlwaysAvailableJSErrorHandling"); flagValue = currentProvider_->useAlwaysAvailableJSErrorHandling(); useAlwaysAvailableJSErrorHandling_ = flagValue; @@ -812,7 +830,7 @@ bool ReactNativeFeatureFlagsAccessor::useAndroidTextLayoutWidthDirectly() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(43, "useAndroidTextLayoutWidthDirectly"); + markFlagAsAccessed(44, "useAndroidTextLayoutWidthDirectly"); flagValue = currentProvider_->useAndroidTextLayoutWidthDirectly(); useAndroidTextLayoutWidthDirectly_ = flagValue; @@ -830,7 +848,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(44, "useFabricInterop"); + markFlagAsAccessed(45, "useFabricInterop"); flagValue = currentProvider_->useFabricInterop(); useFabricInterop_ = flagValue; @@ -848,7 +866,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(45, "useNativeViewConfigsInBridgelessMode"); + markFlagAsAccessed(46, "useNativeViewConfigsInBridgelessMode"); flagValue = currentProvider_->useNativeViewConfigsInBridgelessMode(); useNativeViewConfigsInBridgelessMode_ = flagValue; @@ -866,7 +884,7 @@ bool ReactNativeFeatureFlagsAccessor::useOptimizedEventBatchingOnAndroid() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(46, "useOptimizedEventBatchingOnAndroid"); + markFlagAsAccessed(47, "useOptimizedEventBatchingOnAndroid"); flagValue = currentProvider_->useOptimizedEventBatchingOnAndroid(); useOptimizedEventBatchingOnAndroid_ = flagValue; @@ -884,7 +902,7 @@ bool ReactNativeFeatureFlagsAccessor::useRawPropsJsiValue() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(47, "useRawPropsJsiValue"); + markFlagAsAccessed(48, "useRawPropsJsiValue"); flagValue = currentProvider_->useRawPropsJsiValue(); useRawPropsJsiValue_ = flagValue; @@ -902,7 +920,7 @@ bool ReactNativeFeatureFlagsAccessor::useShadowNodeStateOnClone() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(48, "useShadowNodeStateOnClone"); + markFlagAsAccessed(49, "useShadowNodeStateOnClone"); flagValue = currentProvider_->useShadowNodeStateOnClone(); useShadowNodeStateOnClone_ = flagValue; @@ -920,7 +938,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(49, "useTurboModuleInterop"); + markFlagAsAccessed(50, "useTurboModuleInterop"); flagValue = currentProvider_->useTurboModuleInterop(); useTurboModuleInterop_ = flagValue; @@ -938,7 +956,7 @@ bool ReactNativeFeatureFlagsAccessor::useTurboModules() { // be accessing the provider multiple times but the end state of this // instance and the returned flag value would be the same. - markFlagAsAccessed(50, "useTurboModules"); + markFlagAsAccessed(51, "useTurboModules"); flagValue = currentProvider_->useTurboModules(); useTurboModules_ = flagValue; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsAccessor.h index b08975c91ca1..9d823b8eeb48 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<<83db564764ee7cd15de7d0ed647ddde2>> */ /** @@ -55,6 +55,7 @@ class ReactNativeFeatureFlagsAccessor { bool enableIntersectionObserverEventLoopIntegration(); bool enableLayoutAnimationsOnAndroid(); bool enableLayoutAnimationsOnIOS(); + bool enableMainQueueCoordinatorOnIOS(); bool enableMainQueueModulesOnIOS(); bool enableModuleArgumentNSNullConversionIOS(); bool enableNativeCSSParsing(); @@ -94,7 +95,7 @@ class ReactNativeFeatureFlagsAccessor { std::unique_ptr currentProvider_; bool wasOverridden_; - std::array, 51> accessedFeatureFlags_; + std::array, 52> accessedFeatureFlags_; std::atomic> commonTestFlag_; std::atomic> animatedShouldSignalBatch_; @@ -119,6 +120,7 @@ class ReactNativeFeatureFlagsAccessor { std::atomic> enableIntersectionObserverEventLoopIntegration_; std::atomic> enableLayoutAnimationsOnAndroid_; std::atomic> enableLayoutAnimationsOnIOS_; + std::atomic> enableMainQueueCoordinatorOnIOS_; std::atomic> enableMainQueueModulesOnIOS_; std::atomic> enableModuleArgumentNSNullConversionIOS_; std::atomic> enableNativeCSSParsing_; diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDefaults.h index 58a4520dab37..a06b7edec83c 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<<6692978a1497fa9e99d539511388c9fa>> + * @generated SignedSource<<3a3e4a601f680f792ebe624215e7f97f>> */ /** @@ -119,6 +119,10 @@ class ReactNativeFeatureFlagsDefaults : public ReactNativeFeatureFlagsProvider { return true; } + bool enableMainQueueCoordinatorOnIOS() override { + return false; + } + bool enableMainQueueModulesOnIOS() override { return false; } diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsDynamicProvider.h index a66b05c7b579..0633d1d177bc 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<<75a1b352cffa84394393992484dcb33c>> + * @generated SignedSource<<440403abd700123f4edee6f49b1d9886>> */ /** @@ -252,6 +252,15 @@ class ReactNativeFeatureFlagsDynamicProvider : public ReactNativeFeatureFlagsDef return ReactNativeFeatureFlagsDefaults::enableLayoutAnimationsOnIOS(); } + bool enableMainQueueCoordinatorOnIOS() override { + auto value = values_["enableMainQueueCoordinatorOnIOS"]; + if (!value.isNull()) { + return value.getBool(); + } + + return ReactNativeFeatureFlagsDefaults::enableMainQueueCoordinatorOnIOS(); + } + bool enableMainQueueModulesOnIOS() override { auto value = values_["enableMainQueueModulesOnIOS"]; if (!value.isNull()) { diff --git a/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h b/packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlagsProvider.h index b82ab921dd7c..16dec1cc085c 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<<57a8881e00c4208f97c4eccac202a3bb>> + * @generated SignedSource<> */ /** @@ -48,6 +48,7 @@ class ReactNativeFeatureFlagsProvider { virtual bool enableIntersectionObserverEventLoopIntegration() = 0; virtual bool enableLayoutAnimationsOnAndroid() = 0; virtual bool enableLayoutAnimationsOnIOS() = 0; + virtual bool enableMainQueueCoordinatorOnIOS() = 0; virtual bool enableMainQueueModulesOnIOS() = 0; virtual bool enableModuleArgumentNSNullConversionIOS() = 0; virtual bool enableNativeCSSParsing() = 0; diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec index 530383c5a735..caab2aa4508f 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/React-NativeModulesApple.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| s.dependency "React-cxxreact" s.dependency "React-jsi" s.dependency "React-featureflags" - s.dependency "React-runtimeexecutor" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-featureflags") add_dependency(s, "React-jsinspector", :framework_name => 'jsinspector_modern') add_dependency(s, "React-jsinspectorcdp", :framework_name => 'jsinspector_moderncdp') diff --git a/packages/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec b/packages/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec index 01492676e1e1..07fa49320f1e 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/dom/React-domnativemodule.podspec @@ -55,6 +55,7 @@ Pod::Spec.new do |s| s.dependency "ReactCommon/turbomodule/core" s.dependency "React-Fabric" s.dependency "React-FabricComponents" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-graphics", :additional_framework_paths => ["react/renderer/graphics/platform/ios"]) add_dependency(s, "React-RCTFBReactNativeSpec") end diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.cpp index 4eb297ef981d..2f1f4ccd522a 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<<167e35bd99451cbe24a2bb54db5c66b9>> + * @generated SignedSource<<48970fb0e5b9304cc54934791ba97d98>> */ /** @@ -159,6 +159,11 @@ bool NativeReactNativeFeatureFlags::enableLayoutAnimationsOnIOS( return ReactNativeFeatureFlags::enableLayoutAnimationsOnIOS(); } +bool NativeReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS( + jsi::Runtime& /*runtime*/) { + return ReactNativeFeatureFlags::enableMainQueueCoordinatorOnIOS(); +} + bool NativeReactNativeFeatureFlags::enableMainQueueModulesOnIOS( jsi::Runtime& /*runtime*/) { return ReactNativeFeatureFlags::enableMainQueueModulesOnIOS(); diff --git a/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h b/packages/react-native/ReactCommon/react/nativemodule/featureflags/NativeReactNativeFeatureFlags.h index ebb08d4febb2..ee299f847beb 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<<196bc6e1f0196c39029c3d2a45d3254b>> + * @generated SignedSource<<2b1f3f390fee81f7add6a556ee6faf8b>> */ /** @@ -83,6 +83,8 @@ class NativeReactNativeFeatureFlags bool enableLayoutAnimationsOnIOS(jsi::Runtime& runtime); + bool enableMainQueueCoordinatorOnIOS(jsi::Runtime& runtime); + bool enableMainQueueModulesOnIOS(jsi::Runtime& runtime); bool enableModuleArgumentNSNullConversionIOS(jsi::Runtime& runtime); diff --git a/packages/react-native/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec b/packages/react-native/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec index 7038acefb5ae..d1f48e7dd550 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec +++ b/packages/react-native/ReactCommon/react/nativemodule/idlecallbacks/React-idlecallbacksnativemodule.podspec @@ -52,5 +52,6 @@ Pod::Spec.new do |s| s.dependency "ReactCommon/turbomodule/core" s.dependency "React-runtimescheduler" add_dependency(s, "React-RCTFBReactNativeSpec") + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) end diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec index 0ec33c274799..e2ba39977360 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/React-runtimescheduler.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |s| s.header_mappings_dir = "../../.." end - s.dependency "React-runtimeexecutor" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) s.dependency "React-callinvoker" s.dependency "React-cxxreact" s.dependency "React-rendererdebug" diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp index f9f2f2232363..e8d9b4359cea 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Legacy.cpp @@ -8,6 +8,7 @@ #include "RuntimeScheduler_Legacy.h" #include "SchedulerPriorityUtils.h" +#include #include #include #include diff --git a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp index fcdb9565edb6..aa29da73fd8b 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/RuntimeScheduler_Modern.cpp @@ -8,6 +8,7 @@ #include "RuntimeScheduler_Modern.h" #include "SchedulerPriorityUtils.h" +#include #include #include #include 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 6251b5a552b6..aa2340f98fb5 100644 --- a/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp +++ b/packages/react-native/ReactCommon/react/renderer/runtimescheduler/tests/RuntimeSchedulerTest.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "StubClock.h" diff --git a/packages/react-native/ReactCommon/react/runtime/BufferedRuntimeExecutor.h b/packages/react-native/ReactCommon/react/runtime/BufferedRuntimeExecutor.h index c13e7aa459ea..6606e492ec5f 100644 --- a/packages/react-native/ReactCommon/react/runtime/BufferedRuntimeExecutor.h +++ b/packages/react-native/ReactCommon/react/runtime/BufferedRuntimeExecutor.h @@ -10,6 +10,7 @@ #include #include #include +#include #include namespace facebook::react { diff --git a/packages/react-native/ReactCommon/react/runtime/React-RuntimeCore.podspec b/packages/react-native/ReactCommon/react/runtime/React-RuntimeCore.podspec index ed2e7a1d1bb1..53cc77932892 100644 --- a/packages/react-native/ReactCommon/react/runtime/React-RuntimeCore.podspec +++ b/packages/react-native/ReactCommon/react/runtime/React-RuntimeCore.podspec @@ -40,7 +40,7 @@ Pod::Spec.new do |s| s.dependency "React-jsiexecutor" s.dependency "React-cxxreact" - s.dependency "React-runtimeexecutor" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) s.dependency "React-jsi" s.dependency "React-jserrorhandler" s.dependency "React-performancetimeline" diff --git a/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec b/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec index 7f08453b71bb..4f32e5c979e0 100644 --- a/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec +++ b/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec @@ -48,6 +48,7 @@ Pod::Spec.new do |s| s.dependency "React-hermes" s.dependency "hermes-engine" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) add_dependency(s, "React-jsitooling", :framework_name => "JSITooling") add_rn_third_party_dependencies(s) diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec b/packages/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec index 2d0daa00f635..ff17cec5b9e3 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec @@ -46,7 +46,7 @@ Pod::Spec.new do |s| s.dependency "React-jsiexecutor" s.dependency "React-cxxreact" s.dependency "React-callinvoker" - s.dependency "React-runtimeexecutor" + add_dependency(s, "React-runtimeexecutor", :additional_framework_paths => ["platform/ios"]) s.dependency "React-runtimescheduler" s.dependency "React-jsi" s.dependency "React-Core/Default" diff --git a/packages/react-native/ReactCommon/react/utils/React-utils.podspec b/packages/react-native/ReactCommon/react/utils/React-utils.podspec index 0648b495107e..c9eedbcb8f75 100644 --- a/packages/react-native/ReactCommon/react/utils/React-utils.podspec +++ b/packages/react-native/ReactCommon/react/utils/React-utils.podspec @@ -47,7 +47,6 @@ Pod::Spec.new do |s| s.dependency "React-jsi", version - depend_on_js_engine(s) add_rn_third_party_dependencies(s) add_dependency(s, "React-debug") diff --git a/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt b/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt index ca883784338d..6a1a14d29924 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt +++ b/packages/react-native/ReactCommon/runtimeexecutor/CMakeLists.txt @@ -8,11 +8,11 @@ set(CMAKE_VERBOSE_MAKEFILE on) include(${REACT_COMMON_DIR}/cmake-utils/react-native-flags.cmake) -file(GLOB_RECURSE runtimeexecutor_SRC CONFIGURE_DEPENDS *.cpp *.h) +file(GLOB_RECURSE runtimeexecutor_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ReactCommon/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx/*.cpp) add_library(runtimeexecutor OBJECT ${runtimeexecutor_SRC}) -target_include_directories(runtimeexecutor PUBLIC .) +target_include_directories(runtimeexecutor PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx) target_link_libraries(runtimeexecutor jsi) target_compile_reactnative_options(runtimeexecutor PRIVATE) diff --git a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec index c6fb40df8de7..2cf65a5db3a1 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +++ b/packages/react-native/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec @@ -17,7 +17,12 @@ else end Pod::Spec.new do |s| + header_search_paths = [ + "\"$(PODS_TARGET_SRCROOT)\"", + ] + s.name = "React-runtimeexecutor" + s.module_name = "React_runtimeexecutor" s.version = version s.summary = "-" # TODO s.homepage = "https://reactnative.dev/" @@ -25,8 +30,18 @@ Pod::Spec.new do |s| s.author = "Meta Platforms, Inc. and its affiliates" s.platforms = min_supported_versions s.source = source - s.source_files = "**/*.{cpp,h}" + s.source_files = "ReactCommon/*.{m,mm,cpp,h}", "platform/ios/**/*.{m,mm,cpp,h}" s.header_dir = "ReactCommon" + if ENV['USE_FRAMEWORKS'] + s.header_mappings_dir = '.' + header_search_paths = header_search_paths + ["\"$(PODS_TARGET_SRCROOT)/platform/ios\""] + end + + s.pod_target_xcconfig = { "USE_HEADERMAP" => "NO", + "CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(), + "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), + "DEFINES_MODULE" => "YES" } + s.dependency "React-jsi", version end diff --git a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h index 67dee4b59297..f8f69b54343e 100644 --- a/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h +++ b/packages/react-native/ReactCommon/runtimeexecutor/ReactCommon/RuntimeExecutor.h @@ -7,9 +7,6 @@ #pragma once -#include -#include - #include namespace facebook::react { @@ -25,73 +22,4 @@ namespace facebook::react { using RuntimeExecutor = std::function&& callback)>; -/* - * Executes a `callback` in a *synchronous* manner on the same thread using - * given `RuntimeExecutor`. - * Use this method when the caller needs to *be blocked* by executing the - * `callback` and requires that the callback will be executed on the same - * thread. - * Example order of events (when not a sync call in runtimeExecutor callback): - * - [UI thread] Lock all mutexes at start - * - [UI thread] runtimeCaptured.lock before callback - * - [JS thread] Set runtimePtr in runtimeExecutor callback - * - [JS thread] runtimeCaptured.unlock in runtimeExecutor callback - * - [UI thread] Call callback - * - [JS thread] callbackExecuted.lock in runtimeExecutor callback - * - [UI thread] callbackExecuted.unlock after callback - * - [UI thread] jsBlockExecuted.lock after callback - * - [JS thread] jsBlockExecuted.unlock in runtimeExecutor callback - */ -inline static void executeSynchronouslyOnSameThread_CAN_DEADLOCK( - const RuntimeExecutor& runtimeExecutor, - std::function&& callback) noexcept { - // Note: We need the third mutex to get back to the main thread before - // the lambda is finished (because all mutexes are allocated on the stack). - - std::mutex runtimeCaptured; - std::mutex callbackExecuted; - std::mutex jsBlockExecuted; - - runtimeCaptured.lock(); - callbackExecuted.lock(); - jsBlockExecuted.lock(); - - jsi::Runtime* runtimePtr; - - auto threadId = std::this_thread::get_id(); - - runtimeExecutor([&](jsi::Runtime& runtime) { - runtimePtr = &runtime; - - if (threadId == std::this_thread::get_id()) { - // In case of a synchronous call, we should unlock mutexes and return. - runtimeCaptured.unlock(); - jsBlockExecuted.unlock(); - return; - } - - runtimeCaptured.unlock(); - // `callback` is called somewhere here. - callbackExecuted.lock(); - jsBlockExecuted.unlock(); - }); - - runtimeCaptured.lock(); - callback(*runtimePtr); - callbackExecuted.unlock(); - jsBlockExecuted.lock(); -} - -template -inline static DataT executeSynchronouslyOnSameThread_CAN_DEADLOCK( - const RuntimeExecutor& runtimeExecutor, - std::function&& callback) noexcept { - DataT data; - - executeSynchronouslyOnSameThread_CAN_DEADLOCK( - runtimeExecutor, - [&](jsi::Runtime& runtime) { data = callback(runtime); }); - - return data; -} } // namespace facebook::react diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.cpp b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.cpp new file mode 100644 index 000000000000..d7a83751972f --- /dev/null +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.cpp @@ -0,0 +1,61 @@ +/* + * 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. + */ + +#include +#include +#include + +namespace facebook::react { + +/* + * 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); + */ +void executeSynchronouslyOnSameThread_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) { + runtime.set_value(&rt); + + auto runtimeThread = std::this_thread::get_id(); + if (callingThread != runtimeThread) { + // Block `runtimeThread` on execution of `runtimeWork` on `callingThread`. + 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 facebook::react diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h new file mode 100644 index 000000000000..fff9664f59fa --- /dev/null +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/cxx/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#pragma once + +#include + +#include + +namespace facebook::react { + +/* + * Schedules `runtimeWork` to be executed on the same thread using the + * `RuntimeExecutor`, and blocks on its completion. + */ +void executeSynchronouslyOnSameThread_CAN_DEADLOCK( + const RuntimeExecutor& runtimeExecutor, + std::function&& runtimeWork); + +template +inline static DataT executeSynchronouslyOnSameThread_CAN_DEADLOCK( + const RuntimeExecutor& runtimeExecutor, + std::function&& runtimeWork) { + DataT data; + + executeSynchronouslyOnSameThread_CAN_DEADLOCK( + runtimeExecutor, + [&](jsi::Runtime& runtime) { data = runtimeWork(runtime); }); + + return data; +} +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h new file mode 100644 index 000000000000..fff9664f59fa --- /dev/null +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.h @@ -0,0 +1,36 @@ +/* + * 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. + */ + +#pragma once + +#include + +#include + +namespace facebook::react { + +/* + * Schedules `runtimeWork` to be executed on the same thread using the + * `RuntimeExecutor`, and blocks on its completion. + */ +void executeSynchronouslyOnSameThread_CAN_DEADLOCK( + const RuntimeExecutor& runtimeExecutor, + std::function&& runtimeWork); + +template +inline static DataT executeSynchronouslyOnSameThread_CAN_DEADLOCK( + const RuntimeExecutor& runtimeExecutor, + std::function&& runtimeWork) { + DataT data; + + executeSynchronouslyOnSameThread_CAN_DEADLOCK( + runtimeExecutor, + [&](jsi::Runtime& runtime) { data = runtimeWork(runtime); }); + + return data; +} +} // namespace facebook::react diff --git a/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm new file mode 100644 index 000000000000..c2484f255952 --- /dev/null +++ b/packages/react-native/ReactCommon/runtimeexecutor/platform/ios/ReactCommon/RuntimeExecutorSyncUIThreadUtils.mm @@ -0,0 +1,61 @@ +/* + * 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 +#include +#include + +namespace facebook::react { +/* + * 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); + */ +void executeSynchronouslyOnSameThread_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) { + runtime.set_value(&rt); + + auto runtimeThread = std::this_thread::get_id(); + if (callingThread != runtimeThread) { + // Block `runtimeThread` on execution of `runtimeWork` on `callingThread`. + 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 facebook::react diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index 9e7249b0b9e0..881aee2332b4 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -289,6 +289,17 @@ 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', + }, enableMainQueueModulesOnIOS: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 8096ad8c0565..502f0f5acc91 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<<4d96a5f9132ea827faeb183fe8bbf095>> + * @generated SignedSource<<78ad9b5fe1a39174078219139f6bd06f>> * @flow strict * @noformat */ @@ -73,6 +73,7 @@ export type ReactNativeFeatureFlags = $ReadOnly<{ enableIntersectionObserverEventLoopIntegration: Getter, enableLayoutAnimationsOnAndroid: Getter, enableLayoutAnimationsOnIOS: Getter, + enableMainQueueCoordinatorOnIOS: Getter, enableMainQueueModulesOnIOS: Getter, enableModuleArgumentNSNullConversionIOS: Getter, enableNativeCSSParsing: Getter, @@ -274,6 +275,10 @@ 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); /** * Makes modules requiring main queue setup initialize on the main thread, during React Native init. */ diff --git a/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/specs/NativeReactNativeFeatureFlags.js index 8f94a77f2bd9..a117b441c92a 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<> + * @generated SignedSource<<273456c231b69ff9c24a532aaaa796eb>> * @flow strict * @noformat */ @@ -48,6 +48,7 @@ export interface Spec extends TurboModule { +enableIntersectionObserverEventLoopIntegration?: () => boolean; +enableLayoutAnimationsOnAndroid?: () => boolean; +enableLayoutAnimationsOnIOS?: () => boolean; + +enableMainQueueCoordinatorOnIOS?: () => boolean; +enableMainQueueModulesOnIOS?: () => boolean; +enableModuleArgumentNSNullConversionIOS?: () => boolean; +enableNativeCSSParsing?: () => boolean;