From ad353856dd05fb14b619be6cf7ac633d31bd3ff1 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 14 May 2026 09:36:38 -0700 Subject: [PATCH 1/2] Compile out RCTCxxBridge when legacy arch is disabled Differential Revision: D105167968 --- .../Libraries/AppDelegate/RCTAppDelegate.h | 9 +-- .../Libraries/AppDelegate/RCTAppDelegate.mm | 2 + .../AppDelegate/RCTRootViewFactory.h | 5 +- .../AppDelegate/RCTRootViewFactory.mm | 63 +------------------ .../React/Base/RCTBridge+Private.h | 4 +- packages/react-native/React/Base/RCTBridge.mm | 4 ++ .../react-native/React/Base/RCTBridgeProxy.mm | 4 ++ .../React/CxxBridge/RCTCxxBridge.mm | 5 +- .../Fabric/RCTSurfacePresenterBridgeAdapter.h | 2 + .../RCTSurfacePresenterBridgeAdapter.mm | 2 + .../platform/ios/ReactCommon/RCTTurboModule.h | 13 ---- .../ios/ReactCommon/RCTTurboModuleManager.mm | 26 ++++++-- 12 files changed, 49 insertions(+), 90 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h index 66d64d22044d..00f5e97ccdad 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.h @@ -66,8 +66,13 @@ __attribute__((deprecated( /// The window object, used to render the UViewControllers @property (nonatomic, strong, nonnull) UIWindow *window; +#if !defined(RCT_REMOVE_LEGACY_ARCH) @property (nonatomic, nullable) RCTBridge *bridge __attribute__((deprecated("The bridge is deprecated and will be removed when removing the legacy architecture."))); +@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter __attribute__(( + deprecated("The bridge adapter is deprecated and will be removed when removing the legacy architecture."))); +#endif + @property (nonatomic, strong, nullable) NSString *moduleName; @property (nonatomic, strong, nullable) NSDictionary *initialProps; @property (nonatomic, strong) RCTReactNativeFactory *reactNativeFactory; @@ -75,10 +80,6 @@ __attribute__((deprecated( /// If `automaticallyLoadReactNativeWindow` is set to `true`, the React Native window will be loaded automatically. @property (nonatomic, assign) BOOL automaticallyLoadReactNativeWindow; -@property (nonatomic, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter __attribute__(( - deprecated("The bridge adapter is deprecated and will be removed when removing the legacy architecture."))); -; - - (RCTRootViewFactory *)rootViewFactory; @end diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 8abc2fc431bf..6bda970079cc 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -67,6 +67,7 @@ - (RCTRootViewFactory *)rootViewFactory return self.reactNativeFactory.rootViewFactory; } +#if !defined(RCT_REMOVE_LEGACY_ARCH) - (RCTBridge *)bridge { return self.rootViewFactory.bridge; @@ -86,5 +87,6 @@ - (void)setBridgeAdapter:(RCTSurfacePresenterBridgeAdapter *)bridgeAdapter { self.reactNativeFactory.rootViewFactory.bridgeAdapter = bridgeAdapter; } +#endif @end diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h index de533570ea60..ddd3c09ebfbf 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h @@ -184,9 +184,12 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc */ @interface RCTRootViewFactory : NSObject +#if !defined(RCT_REMOVE_LEGACY_ARCH) @property (nonatomic, strong, nullable) RCTBridge *bridge; -@property (nonatomic, strong, nullable) RCTHost *reactHost; @property (nonatomic, strong, nullable) RCTSurfacePresenterBridgeAdapter *bridgeAdapter; +#endif + +@property (nonatomic, strong, nullable) RCTHost *reactHost; - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configuration andTurboModuleManagerDelegate:(id _Nullable)turboModuleManagerDelegate; diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index 4eaecb0b46ef..6528eb70d448 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -6,11 +6,9 @@ */ #import "RCTRootViewFactory.h" -#import #import #import #import -#import #import #import #import "RCTAppDelegate.h" @@ -90,7 +88,7 @@ - (instancetype)initWithBundleURL:(NSURL *)bundleURL @end -@interface RCTRootViewFactory () { +@interface RCTRootViewFactory () { std::shared_ptr _contextContainer; std::shared_ptr _runtimeScheduler; } @@ -201,63 +199,6 @@ - (UIView *)viewWithModuleName:(NSString *)moduleName return surfaceHostingProxyRootView; } -- (RCTBridge *)createBridgeWithDelegate:(id)delegate launchOptions:(NSDictionary *)launchOptions -{ - return [[RCTBridge alloc] initWithDelegate:delegate launchOptions:launchOptions]; -} - -- (UIView *)createRootViewWithBridge:(RCTBridge *)bridge - moduleName:(NSString *)moduleName - initProps:(NSDictionary *)initProps -{ - UIView *rootView = RCTAppSetupDefaultRootView(bridge, moduleName, initProps, YES); -#if !TARGET_OS_TV - rootView.backgroundColor = [UIColor systemBackgroundColor]; -#else - rootView.backgroundColor = [UIColor blackColor]; -#endif - return rootView; -} - -#pragma mark - RCTCxxBridgeDelegate -- (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge -{ - _runtimeScheduler = std::make_shared(RCTRuntimeExecutorFromBridge(bridge)); - - std::shared_ptr callInvoker = - std::make_shared(_runtimeScheduler); - RCTTurboModuleManager *turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge - delegate:_turboModuleManagerDelegate - jsInvoker:callInvoker]; - _contextContainer->erase(facebook::react::RuntimeSchedulerKey); - _contextContainer->insert(facebook::react::RuntimeSchedulerKey, _runtimeScheduler); - return RCTAppSetupDefaultJsExecutorFactory(bridge, turboModuleManager, _runtimeScheduler); -} - -- (void)createBridgeIfNeeded:(NSDictionary *)launchOptions -{ - if (self.bridge != nil) { - return; - } - - if (self->_configuration.createBridgeWithDelegate != nil) { - self.bridge = self->_configuration.createBridgeWithDelegate(self, launchOptions); - } else { - self.bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions]; - } -} - -- (void)createBridgeAdapterIfNeeded -{ - if (self.bridgeAdapter != nullptr) { - return; - } - - self.bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:self.bridge - contextContainer:_contextContainer]; - self.bridge.surfacePresenter = self.bridgeAdapter.surfacePresenter; -} - #pragma mark - New Arch Utilities - (void)createReactHostIfNeeded:(NSDictionary *)launchOptions @@ -316,6 +257,7 @@ - (RCTHost *)createReactHost:(NSDictionary *)launchOptions reinterpret_cast(jsRuntimeFactory), &js_runtime_factory_destroy); } +#ifndef RCT_REMOVE_LEGACY_ARCH - (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge { if (_configuration.extraModulesForBridge != nil) { @@ -363,6 +305,7 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge _configuration.loadSourceForBridgeWithProgress(bridge, onProgress, loadCallback); } } +#endif - (NSURL *)bundleURL { diff --git a/packages/react-native/React/Base/RCTBridge+Private.h b/packages/react-native/React/Base/RCTBridge+Private.h index 3a69f317ebf3..6c2c82832850 100644 --- a/packages/react-native/React/Base/RCTBridge+Private.h +++ b/packages/react-native/React/Base/RCTBridge+Private.h @@ -145,14 +145,14 @@ RCT_EXTERN void RCTRegisterModule(Class); @end +#if !defined(RCT_REMOVE_LEGACY_ARCH) @interface RCTCxxBridge : RCTBridge // TODO(cjhopman): this seems unsafe unless we require that it is only called on the main js queue. @property (nonatomic, readonly) void *runtime; -#ifndef RCT_REMOVE_LEGACY_ARCH - (instancetype)initWithParentBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER __deprecated_msg("This API will be removed along with the legacy architecture."); -#endif // RCT_REMOVE_LEGACY_ARCH @end +#endif // RCT_REMOVE_LEGACY_ARCH diff --git a/packages/react-native/React/Base/RCTBridge.mm b/packages/react-native/React/Base/RCTBridge.mm index 661f8f0fa64d..08ec9fb3736d 100644 --- a/packages/react-native/React/Base/RCTBridge.mm +++ b/packages/react-native/React/Base/RCTBridge.mm @@ -550,7 +550,11 @@ - (void)requestReload - (Class)bridgeClass { +#if !defined(RCT_REMOVE_LEGACY_ARCH) return [RCTCxxBridge class]; +#else + return nil; +#endif } - (void)setUp diff --git a/packages/react-native/React/Base/RCTBridgeProxy.mm b/packages/react-native/React/Base/RCTBridgeProxy.mm index c840503be2ba..f7b343818772 100644 --- a/packages/react-native/React/Base/RCTBridgeProxy.mm +++ b/packages/react-native/React/Base/RCTBridgeProxy.mm @@ -387,7 +387,11 @@ - (RCTBridgeProxy *)object */ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel; { +#ifndef RCT_REMOVE_LEGACY_ARCH return [RCTCxxBridge instanceMethodSignatureForSelector:sel]; +#else + return [RCTBridge instanceMethodSignatureForSelector:sel]; +#endif } - (void)forwardInvocation:(NSInvocation *)invocation diff --git a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm index a67f5bc646b9..9f44f339f33b 100644 --- a/packages/react-native/React/CxxBridge/RCTCxxBridge.mm +++ b/packages/react-native/React/CxxBridge/RCTCxxBridge.mm @@ -1566,7 +1566,4 @@ - (RCTCallInvoker *)callInvokerForModuleData:(RCTModuleData *)moduleData @end -#else // RCT_REMOVE_LEGACY_ARCH -@implementation RCTCxxBridge -@end -#endif // RCT_REMOVE_LEGACY_ARCH +#endif // RCT_REMOVE_LEGACY_ARCHH diff --git a/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.h b/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.h index f3d8bbb0100d..27f622a906e2 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.h +++ b/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.h @@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN @class RCTSurfacePresenter; @class RCTBridge; +#ifndef RCT_REMOVE_LEGACY_ARCH facebook::react::RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge); /* @@ -39,5 +40,6 @@ facebook::react::RuntimeExecutor RCTRuntimeExecutorFromBridge(RCTBridge *bridge) @property (nonatomic, weak) RCTBridge *bridge; @end +#endif NS_ASSUME_NONNULL_END diff --git a/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm b/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm index 73d3ed9b6794..0f428970cb9a 100644 --- a/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm +++ b/packages/react-native/React/Fabric/RCTSurfacePresenterBridgeAdapter.mm @@ -24,6 +24,7 @@ using namespace facebook::react; +#ifndef RCT_REMOVE_LEGACY_ARCH @interface RCTBridge () - (std::shared_ptr)jsMessageThread; - (void)invokeAsync:(std::function &&)func; @@ -203,3 +204,4 @@ - (void)handleJavaScriptDidLoadNotification:(NSNotification *)notification } @end +#endif diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h index d3fc87e6f148..43c783df8593 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h @@ -193,16 +193,3 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule { @optional - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper; @end - -/** - * These methods are all implemented by RCTCxxBridge, which subclasses RCTBridge. Hence, they must only be used in - * contexts where the concrete class of an RCTBridge instance is RCTCxxBridge. This happens, for example, when - * [RCTCxxBridgeDelegate jsExecutorFactoryForBridge:(RCTBridge *)] is invoked by RCTCxxBridge. - * - * TODO: Consolidate this extension with the one in RCTSurfacePresenter. - */ -@interface RCTBridge (RCTTurboModule) -- (std::shared_ptr)jsCallInvoker; -- (std::shared_ptr)decorateNativeMethodCallInvoker: - (std::shared_ptr)nativeMethodCallInvoker; -@end diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm index 4f709dcfd580..4c780b39d7aa 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModuleManager.mm @@ -7,6 +7,7 @@ #import "RCTTurboModuleManager.h" #import "RCTInteropTurboModule.h" +#import "RCTTurboModule.h" #import #import @@ -165,23 +166,36 @@ bool isTurboModuleInstance(id module) return isTurboModuleClass([module class]); } -} // namespace +struct ModuleQueuePair { + id module; + dispatch_queue_t methodQueue; +}; // Fallback lookup since RCT class prefix is sometimes stripped in the existing NativeModule system. // This will be removed in the future. static Class getFallbackClassFromName(const char *name) { Class moduleClass = NSClassFromString([NSString stringWithUTF8String:name]); - if (!moduleClass) { + if (moduleClass == nil) { moduleClass = NSClassFromString([NSString stringWithFormat:@"RCT%s", name]); } return moduleClass; } -typedef struct { - id module; - dispatch_queue_t methodQueue; -} ModuleQueuePair; +} // namespace + +/** + * These methods are all implemented by RCTCxxBridge, which subclasses RCTBridge. Hence, they must only be used in + * contexts where the concrete class of an RCTBridge instance is RCTCxxBridge. This happens, for example, when + * [RCTCxxBridgeDelegate jsExecutorFactoryForBridge:(RCTBridge *)] is invoked by RCTCxxBridge. + * + * TODO: Consolidate this extension with the one in RCTSurfacePresenter. + */ +@interface RCTBridge (RCTTurboModule) +- (std::shared_ptr)jsCallInvoker; +- (std::shared_ptr)decorateNativeMethodCallInvoker: + (std::shared_ptr)nativeMethodCallInvoker; +@end @implementation RCTTurboModuleManager { std::shared_ptr _jsInvoker; From e24446d5c530af6bac6db9b93e9c42b0e16d5311 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Thu, 14 May 2026 09:36:38 -0700 Subject: [PATCH 2/2] Remove RCTCxxMethod Summary: This is part of the legacy arch, and the last usage of it in RCTCxxModule was removed in D81294192 Changelog: [iOS][Removed] Legacy arch removal: RCTCxxMethod and DispatchMessageQueueThread Reviewed By: christophpurrer Differential Revision: D105168516 --- .../CxxModule/DispatchMessageQueueThread.h | 50 ------ .../React/CxxModule/RCTCxxMethod.h | 17 -- .../React/CxxModule/RCTCxxMethod.mm | 147 ------------------ .../React/CxxModule/RCTCxxUtils.mm | 1 - .../React/CxxModule/RCTNativeModule.mm | 1 - 5 files changed, 216 deletions(-) delete mode 100644 packages/react-native/React/CxxModule/DispatchMessageQueueThread.h delete mode 100644 packages/react-native/React/CxxModule/RCTCxxMethod.h delete mode 100644 packages/react-native/React/CxxModule/RCTCxxMethod.mm diff --git a/packages/react-native/React/CxxModule/DispatchMessageQueueThread.h b/packages/react-native/React/CxxModule/DispatchMessageQueueThread.h deleted file mode 100644 index f082c0598300..000000000000 --- a/packages/react-native/React/CxxModule/DispatchMessageQueueThread.h +++ /dev/null @@ -1,50 +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. - */ - -#include - -#include -#include - -#ifndef RCT_REMOVE_LEGACY_ARCH - -namespace facebook::react { - -// RCTNativeModule arranges for native methods to be invoked on a queue which -// is not the JS thread. C++ modules don't use RCTNativeModule, so this little -// adapter does the work. - -class [[deprecated("This API will be removed along with the legacy architecture.")]] DispatchMessageQueueThread - : public MessageQueueThread { - public: - DispatchMessageQueueThread(RCTModuleData *moduleData) : moduleData_(moduleData) {} - - void runOnQueue(std::function &&func) override - { - dispatch_queue_t queue = moduleData_.methodQueue; - dispatch_block_t block = [func = std::move(func)] { func(); }; - RCTAssert(block != nullptr, @"Invalid block generated in call to %@", moduleData_); - if (queue && block) { - dispatch_async(queue, block); - } - } - void runOnQueueSync(std::function &&__unused func) override - { - LOG(FATAL) << "Unsupported operation"; - } - void quitSynchronous() override - { - LOG(FATAL) << "Unsupported operation"; - } - - private: - RCTModuleData *moduleData_; -}; - -} // namespace facebook::react - -#endif // RCT_REMOVE_LEGACY_ARCH diff --git a/packages/react-native/React/CxxModule/RCTCxxMethod.h b/packages/react-native/React/CxxModule/RCTCxxMethod.h deleted file mode 100644 index f126032dca48..000000000000 --- a/packages/react-native/React/CxxModule/RCTCxxMethod.h +++ /dev/null @@ -1,17 +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. - */ - -#import - -#import -#import - -@interface RCTCxxMethod : NSObject - -- (instancetype)initWithCxxMethod:(const facebook::xplat::module::CxxModule::Method &)cxxMethod; - -@end diff --git a/packages/react-native/React/CxxModule/RCTCxxMethod.mm b/packages/react-native/React/CxxModule/RCTCxxMethod.mm deleted file mode 100644 index bfbf1253643d..000000000000 --- a/packages/react-native/React/CxxModule/RCTCxxMethod.mm +++ /dev/null @@ -1,147 +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. - */ - -#import "RCTCxxMethod.h" - -#import -#import -#import -#import -#import - -#import "RCTCxxUtils.h" - -#import - -using facebook::xplat::module::CxxModule; -using namespace facebook::react; - -@implementation RCTCxxMethod { - std::unique_ptr _method; -} - -- (instancetype)initWithCxxMethod:(const CxxModule::Method &)method -{ - if ((self = [super init]) != nullptr) { - _method = std::make_unique(method); - } - return self; -} - -- (const char *)JSMethodName -{ - return _method->name.c_str(); -} - -- (RCTFunctionType)functionType -{ - std::string type(_method->getType()); - if (type == "sync") { - return RCTFunctionTypeSync; - } else if (type == "async") { - return RCTFunctionTypeNormal; - } else { - return RCTFunctionTypePromise; - } -} - -- (id)invokeWithBridge:(RCTBridge *)bridge module:(id)module arguments:(NSArray *)arguments -{ - // module is unused except for printing errors. The C++ object it represents - // is also baked into _method. - - // the last N arguments are callbacks, according to the Method data. The - // preceding arguments are values which have already been parsed from JS: they - // may be NSNumber (bool, int, double), NSString, NSArray, or NSObject. - - CxxModule::Callback first; - CxxModule::Callback second; - - if (arguments.count < _method->callbacks) { - RCTLogError( - @"Method %@.%s expects at least %zu arguments, but got %tu", - RCTBridgeModuleNameForClass([module class]), - _method->name.c_str(), - _method->callbacks, - arguments.count); - return nil; - } - - if (_method->callbacks >= 1) { - if (![arguments[arguments.count - 1] isKindOfClass:[NSNumber class]]) { - RCTLogError( - @"Argument %tu (%@) of %@.%s should be a function", - arguments.count - 1, - arguments[arguments.count - 1], - RCTBridgeModuleNameForClass([module class]), - _method->name.c_str()); - return nil; - } - - NSNumber *id1; - if (_method->callbacks == 2) { - if (![arguments[arguments.count - 2] isKindOfClass:[NSNumber class]]) { - RCTLogError( - @"Argument %tu (%@) of %@.%s should be a function", - arguments.count - 2, - arguments[arguments.count - 2], - RCTBridgeModuleNameForClass([module class]), - _method->name.c_str()); - return nil; - } - - id1 = arguments[arguments.count - 2]; - NSNumber *id2 = arguments[arguments.count - 1]; - - second = ^(std::vector args) { - folly::dynamic obj = folly::dynamic::array; - for (auto &arg : args) { - obj.push_back(std::move(arg)); - } - [bridge enqueueCallback:id2 args:convertFollyDynamicToId(std::move(obj))]; - }; - } else { - id1 = arguments[arguments.count - 1]; - } - - first = ^(std::vector args) { - folly::dynamic obj = folly::dynamic::array; - for (auto &arg : args) { - obj.push_back(std::move(arg)); - } - [bridge enqueueCallback:id1 args:convertFollyDynamicToId(std::move(obj))]; - }; - } - - folly::dynamic args = convertIdToFollyDynamic(arguments); - args.resize(args.size() - _method->callbacks); - - try { - if (_method->func) { - _method->func(std::move(args), first, second); - return nil; - } else { - auto result = _method->syncFunc(std::move(args)); - // TODO: we should convert this to JSValue directly - return convertFollyDynamicToId(result); - } - } catch ([[maybe_unused]] const facebook::xplat::JsArgumentException &ex) { - RCTLogError( - @"Method %@.%s argument error: %s", - RCTBridgeModuleNameForClass([module class]), - _method->name.c_str(), - ex.what()); - return nil; - } -} - -- (NSString *)description -{ - return [NSString stringWithFormat:@"<%@: %p; name = %s>", [self class], self, self.JSMethodName]; -} - -@end diff --git a/packages/react-native/React/CxxModule/RCTCxxUtils.mm b/packages/react-native/React/CxxModule/RCTCxxUtils.mm index 820b87dd1f81..42e1b666006b 100644 --- a/packages/react-native/React/CxxModule/RCTCxxUtils.mm +++ b/packages/react-native/React/CxxModule/RCTCxxUtils.mm @@ -12,7 +12,6 @@ #import #import -#import "DispatchMessageQueueThread.h" #import "RCTNativeModule.h" namespace facebook::react { diff --git a/packages/react-native/React/CxxModule/RCTNativeModule.mm b/packages/react-native/React/CxxModule/RCTNativeModule.mm index 9d35eb72b998..c725778c2fc8 100644 --- a/packages/react-native/React/CxxModule/RCTNativeModule.mm +++ b/packages/react-native/React/CxxModule/RCTNativeModule.mm @@ -13,7 +13,6 @@ #import #import #import -#import #import #import #import