From dca4803a65a9060a64b671b17758e30521a140c8 Mon Sep 17 00:00:00 2001 From: Shawn Dempsey Date: Thu, 15 Jun 2023 13:33:42 -0700 Subject: [PATCH] RuntimeSchedule is only used in 0.72 --- .../cocoa/RNXTurboModuleAdapter.mm | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm b/packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm index 45ee917397..97989b6035 100644 --- a/packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm +++ b/packages/react-native-host/cocoa/RNXTurboModuleAdapter.mm @@ -16,11 +16,30 @@ #else #import #import + +// We still get into this path because react-native-macos 0.71 picked up some +// 0.72 bits. AFAICT, `RCTLegacyInteropComponents.h` is a new addition in 0.72 +// in both react-native and react-native-macos. +#if __has_include() #import #import +#if __has_include() +#import +#endif // __has_include() #define USE_RUNTIME_SCHEDULER 1 +#else +#define USE_RUNTIME_SCHEDULER 0 +#endif // __has_include() + #endif // __has_include() +// RCTAppSetupDefaultJsExecutorFactory is in different locations for iOS (0.71)/macOS(0.71) +#if !TARGET_OS_OSX +#import +#else +#import +#endif + #endif // USE_TURBOMODULE @implementation RNXTurboModuleAdapter { @@ -45,7 +64,7 @@ @implementation RNXTurboModuleAdapter { _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:self jsInvoker:callInvoker]; - return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); + return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager, _runtimeScheduler); #else _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:self