From b4876a3f6677068b6ec55a28fb6b7d4569a9c5fe Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Thu, 6 Nov 2025 05:06:50 -0800 Subject: [PATCH] Back out "Remove RCT_EXPORT_MODULE from Core modules" (#54428) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54428 Backing this out because there are a couple of internal tests going in timeout when this land. I believe that for the tests some of these modules are not registered correctly. ## Changelog: [Internal] - ## Facebook: See T244088155. For some reasons, these two tests: - `buck test @//fbobjc/mode/buck2/ios-tests fbsource//fbobjc/Libraries/FBReactKit:FDSMediaWrapperServerSnapshotTests_Facebook` ([link](https://www.internalfb.com/intern/test/844425131558081)) - `buck test @//fbobjc/mode/buck2/ios-tests fbsource//fbobjc/Libraries/FBReactKit:FDSInlineReactionsServerSnapshotTests_Facebook` ([link](https://www.internalfb.com/intern/test/844425131558078)) timeouts with diff D85580258. I need to investigate which modules make these tests time out. It could be that the test setup is missing some plugin. I'm also surprised why other FDS tests are actually passing... Reviewed By: javache Differential Revision: D86401358 fbshipit-source-id: b9c87fef3ab164340e2e4f108d9e6fb2c379ebc0 --- packages/react-native/Libraries/Blob/RCTBlobManager.mm | 5 +---- packages/react-native/Libraries/Blob/RCTFileReaderModule.mm | 5 +---- .../Libraries/Image/RCTBundleAssetImageLoader.mm | 5 +---- packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm | 5 +---- .../react-native/Libraries/Image/RCTImageEditingManager.mm | 5 +---- packages/react-native/Libraries/Image/RCTImageLoader.mm | 5 +---- .../react-native/Libraries/Image/RCTImageStoreManager.mm | 5 +---- .../react-native/Libraries/Image/RCTImageViewManager.mm | 5 +---- .../Libraries/Image/RCTLocalAssetImageLoader.mm | 5 +---- .../react-native/Libraries/LinkingIOS/RCTLinkingManager.mm | 5 +---- .../Libraries/NativeAnimation/RCTNativeAnimatedModule.mm | 5 +---- .../NativeAnimation/RCTNativeAnimatedTurboModule.mm | 5 +---- .../react-native/Libraries/Network/RCTDataRequestHandler.mm | 5 +---- .../react-native/Libraries/Network/RCTFileRequestHandler.mm | 5 +---- .../react-native/Libraries/Network/RCTHTTPRequestHandler.mm | 5 +---- packages/react-native/Libraries/Network/RCTNetworking.mm | 5 +---- .../PushNotificationIOS/RCTPushNotificationManager.mm | 5 +---- .../react-native/Libraries/Settings/RCTSettingsManager.mm | 5 +---- .../Libraries/Text/BaseText/RCTBaseTextViewManager.mm | 5 +---- .../Libraries/Text/RawText/RCTRawTextViewManager.mm | 5 +---- .../react-native/Libraries/Text/Text/RCTTextViewManager.mm | 5 +---- .../TextInput/Multiline/RCTMultilineTextInputViewManager.mm | 5 +---- .../Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm | 5 +---- .../Text/TextInput/RCTInputAccessoryViewManager.mm | 5 +---- .../Singleline/RCTSinglelineTextInputViewManager.mm | 5 +---- .../Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm | 5 +---- packages/react-native/Libraries/Vibration/RCTVibration.mm | 5 +---- .../React/CoreModules/RCTAccessibilityManager.mm | 5 +---- .../react-native/React/CoreModules/RCTActionSheetManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTAlertManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTAppState.mm | 5 +---- packages/react-native/React/CoreModules/RCTAppearance.mm | 5 +---- packages/react-native/React/CoreModules/RCTClipboard.mm | 5 +---- .../react-native/React/CoreModules/RCTDevLoadingView.mm | 5 +---- packages/react-native/React/CoreModules/RCTDevMenu.mm | 5 +---- packages/react-native/React/CoreModules/RCTDevSettings.mm | 5 +---- .../React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm | 6 +----- packages/react-native/React/CoreModules/RCTDeviceInfo.mm | 5 +---- .../react-native/React/CoreModules/RCTEventDispatcher.mm | 5 +---- .../react-native/React/CoreModules/RCTExceptionsManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTI18nManager.mm | 5 +---- .../react-native/React/CoreModules/RCTKeyboardObserver.mm | 5 +---- packages/react-native/React/CoreModules/RCTLogBox.mm | 5 +---- packages/react-native/React/CoreModules/RCTPerfMonitor.mm | 5 +---- packages/react-native/React/CoreModules/RCTPlatform.mm | 5 +---- packages/react-native/React/CoreModules/RCTRedBox.mm | 5 +---- packages/react-native/React/CoreModules/RCTSourceCode.mm | 5 +---- .../react-native/React/CoreModules/RCTStatusBarManager.mm | 5 +---- packages/react-native/React/CoreModules/RCTTiming.mm | 5 +---- .../react-native/React/CoreModules/RCTWebSocketModule.mm | 5 +---- packages/react-native/React/Modules/RCTUIManager.mm | 5 +---- .../React/Views/RCTActivityIndicatorViewManager.m | 5 +---- .../react-native/React/Views/RCTDebuggingOverlayManager.m | 5 +---- packages/react-native/React/Views/RCTModalHostViewManager.m | 5 +---- packages/react-native/React/Views/RCTModalManager.m | 5 +---- packages/react-native/React/Views/RCTSwitchManager.m | 5 +---- packages/react-native/React/Views/RCTViewManager.m | 5 +---- .../React/Views/RefreshControl/RCTRefreshControlManager.m | 5 +---- .../React/Views/SafeAreaView/RCTSafeAreaViewManager.m | 5 +---- .../React/Views/ScrollView/RCTScrollContentViewManager.m | 5 +---- .../React/Views/ScrollView/RCTScrollViewManager.m | 5 +---- .../platform/ios/ReactCommon/RCTSampleTurboModule.mm | 5 +---- 62 files changed, 62 insertions(+), 249 deletions(-) diff --git a/packages/react-native/Libraries/Blob/RCTBlobManager.mm b/packages/react-native/Libraries/Blob/RCTBlobManager.mm index 6dfcb4a1bcc..981778817ef 100755 --- a/packages/react-native/Libraries/Blob/RCTBlobManager.mm +++ b/packages/react-native/Libraries/Blob/RCTBlobManager.mm @@ -42,10 +42,7 @@ static NSString *const kBlobURIScheme = @"blob"; dispatch_queue_t _processingQueue; } -+ (NSString *)moduleName -{ - return @"BlobModule"; -} +RCT_EXPORT_MODULE(BlobModule) @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm index ae38238301d..02180144f28 100644 --- a/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm +++ b/packages/react-native/Libraries/Blob/RCTFileReaderModule.mm @@ -20,10 +20,7 @@ @implementation RCTFileReaderModule -+ (NSString *)moduleName -{ - return @"FileReaderModule"; -} +RCT_EXPORT_MODULE(FileReaderModule) @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm index 6f05e536bfe..538bf842fcf 100644 --- a/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTBundleAssetImageLoader.mm @@ -20,10 +20,7 @@ @implementation RCTBundleAssetImageLoader -+ (NSString *)moduleName -{ - return @"BundleAssetImageLoader"; -} +RCT_EXPORT_MODULE() - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm index f5e9cca76f0..92628c6c8f2 100644 --- a/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm +++ b/packages/react-native/Libraries/Image/RCTGIFImageDecoder.mm @@ -20,10 +20,7 @@ @implementation RCTGIFImageDecoder -+ (NSString *)moduleName -{ - return @"GIFImageDecoder"; -} +RCT_EXPORT_MODULE() - (BOOL)canDecodeImageData:(NSData *)imageData { diff --git a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm index bfd62aa1c7b..7f72f130217 100644 --- a/packages/react-native/Libraries/Image/RCTImageEditingManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageEditingManager.mm @@ -24,10 +24,7 @@ @implementation RCTImageEditingManager -+ (NSString *)moduleName -{ - return @"ImageEditingManager"; -} +RCT_EXPORT_MODULE() @synthesize moduleRegistry = _moduleRegistry; diff --git a/packages/react-native/Libraries/Image/RCTImageLoader.mm b/packages/react-native/Libraries/Image/RCTImageLoader.mm index ea29bef4294..9c2553d7ec5 100644 --- a/packages/react-native/Libraries/Image/RCTImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTImageLoader.mm @@ -92,10 +92,7 @@ static NSError *addResponseHeadersToError(NSError *originalError, NSHTTPURLRespo @synthesize maxConcurrentDecodingTasks = _maxConcurrentDecodingTasks; @synthesize maxConcurrentDecodingBytes = _maxConcurrentDecodingBytes; -+ (NSString *)moduleName -{ - return @"RCTImageLoader"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm index 8c8d62c6a43..f5f9a88b468 100644 --- a/packages/react-native/Libraries/Image/RCTImageStoreManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageStoreManager.mm @@ -32,10 +32,7 @@ static NSString *const RCTImageStoreURLScheme = @"rct-image-store"; @synthesize methodQueue = _methodQueue; -+ (NSString *)moduleName -{ - return @"ImageStoreManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Image/RCTImageViewManager.mm b/packages/react-native/Libraries/Image/RCTImageViewManager.mm index a316c39a2fa..74e1713b820 100644 --- a/packages/react-native/Libraries/Image/RCTImageViewManager.mm +++ b/packages/react-native/Libraries/Image/RCTImageViewManager.mm @@ -20,10 +20,7 @@ @implementation RCTImageViewManager -+ (NSString *)moduleName -{ - return @"ImageViewManager"; -} +RCT_EXPORT_MODULE() - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm index 74246d45f16..517804aaff3 100644 --- a/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm +++ b/packages/react-native/Libraries/Image/RCTLocalAssetImageLoader.mm @@ -20,10 +20,7 @@ @implementation RCTLocalAssetImageLoader -+ (NSString *)moduleName -{ - return @"LocalAssetImageLoader"; -} +RCT_EXPORT_MODULE() - (BOOL)canLoadImageURL:(NSURL *)requestURL { diff --git a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm index 7d66efdc946..db689678d65 100644 --- a/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm +++ b/packages/react-native/Libraries/LinkingIOS/RCTLinkingManager.mm @@ -27,10 +27,7 @@ static void postNotificationWithURL(NSURL *URL, id sender) @implementation RCTLinkingManager -+ (NSString *)moduleName -{ - return @"LinkingManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm index 818d71a2916..9120e8c4754 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm @@ -30,10 +30,7 @@ typedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager); NSMutableDictionary *_animIdIsManagedByFabric; } -+ (NSString *)moduleName -{ - return @"NativeAnimatedModule"; -} +RCT_EXPORT_MODULE(); + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm index b192de009ee..a168bddff83 100644 --- a/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm +++ b/packages/react-native/Libraries/NativeAnimation/RCTNativeAnimatedTurboModule.mm @@ -30,10 +30,7 @@ typedef void (^AnimatedOperation)(RCTNativeAnimatedNodesManager *nodesManager); NSSet *_userDrivenAnimationEndedEvents; } -+ (NSString *)moduleName -{ - return @"NativeAnimatedTurboModule"; -} +RCT_EXPORT_MODULE(); + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm index 0ed1ad4a8cf..d52f6ba8ad6 100644 --- a/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTDataRequestHandler.mm @@ -20,10 +20,7 @@ std::mutex _operationHandlerMutexLock; } -+ (NSString *)moduleName -{ - return @"DataRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm index 6a082bdb82b..a1de92f33fe 100644 --- a/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTFileRequestHandler.mm @@ -24,10 +24,7 @@ std::mutex _operationHandlerMutexLock; } -+ (NSString *)moduleName -{ - return @"FileRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm index 17e7c3a1eaa..0303970a2e4 100644 --- a/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm +++ b/packages/react-native/Libraries/Network/RCTHTTPRequestHandler.mm @@ -33,10 +33,7 @@ void RCTSetCustomNSURLSessionConfigurationProvider(NSURLSessionConfigurationProv @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"HTTPRequestHandler"; -} +RCT_EXPORT_MODULE() - (void)invalidate { diff --git a/packages/react-native/Libraries/Network/RCTNetworking.mm b/packages/react-native/Libraries/Network/RCTNetworking.mm index 7c53d0e8d1f..86e80e24cde 100644 --- a/packages/react-native/Libraries/Network/RCTNetworking.mm +++ b/packages/react-native/Libraries/Network/RCTNetworking.mm @@ -167,10 +167,7 @@ static NSString *RCTGenerateFormBoundary() @synthesize methodQueue = _methodQueue; -+ (NSString *)moduleName -{ - return @"Networking"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index e14a8780c55..b113503efe5 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -154,10 +154,7 @@ static BOOL IsNotificationRemote(UNNotification *notification) return [notification.request.trigger isKindOfClass:[UNPushNotificationTrigger class]]; } -+ (NSString *)moduleName -{ - return @"PushNotificationManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm index b66eb12900b..e1515ef05c2 100644 --- a/packages/react-native/Libraries/Settings/RCTSettingsManager.mm +++ b/packages/react-native/Libraries/Settings/RCTSettingsManager.mm @@ -25,10 +25,7 @@ @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"SettingsManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm index 076a78b08b9..4843a9bd4db 100644 --- a/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm +++ b/packages/react-native/Libraries/Text/BaseText/RCTBaseTextViewManager.mm @@ -11,10 +11,7 @@ @implementation RCTBaseTextViewManager -+ (NSString *)moduleName -{ - return @"BaseText"; -} +RCT_EXPORT_MODULE(RCTBaseText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm index 9595ff96de7..15a851da28d 100644 --- a/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm +++ b/packages/react-native/Libraries/Text/RawText/RCTRawTextViewManager.mm @@ -13,10 +13,7 @@ @implementation RCTRawTextViewManager -+ (NSString *)moduleName -{ - return @"RawText"; -} +RCT_EXPORT_MODULE(RCTRawText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm index b17ca60310c..cf093baaf48 100644 --- a/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm +++ b/packages/react-native/Libraries/Text/Text/RCTTextViewManager.mm @@ -26,10 +26,7 @@ NSHashTable *_shadowViews; } -+ (NSString *)moduleName -{ - return @"TextViewManager"; -} +RCT_EXPORT_MODULE(RCTText) RCT_REMAP_SHADOW_PROPERTY(numberOfLines, maximumNumberOfLines, NSInteger) RCT_REMAP_SHADOW_PROPERTY(ellipsizeMode, lineBreakMode, NSLineBreakMode) diff --git a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm index 44fd7dbbcbc..cbf1433cca0 100644 --- a/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Multiline/RCTMultilineTextInputViewManager.mm @@ -12,10 +12,7 @@ @implementation RCTMultilineTextInputViewManager -+ (NSString *)moduleName -{ - return @"MultilineTextInputViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm index 19a27781612..3503ccf4522 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTBaseTextInputViewManager.mm @@ -30,10 +30,7 @@ NSHashTable *_shadowViews; } -+ (NSString *)moduleName -{ - return @"BaseTextInputViewManager"; -} +RCT_EXPORT_MODULE() #pragma mark - Unified properties diff --git a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm index fa910d51602..34e4a575285 100644 --- a/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/RCTInputAccessoryViewManager.mm @@ -14,10 +14,7 @@ @implementation RCTInputAccessoryViewManager -+ (NSString *)moduleName -{ - return @"InputAccessoryViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm index 14dd7a52d9c..13cd754c765 100644 --- a/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm +++ b/packages/react-native/Libraries/Text/TextInput/Singleline/RCTSinglelineTextInputViewManager.mm @@ -14,10 +14,7 @@ @implementation RCTSinglelineTextInputViewManager -+ (NSString *)moduleName -{ - return @"SinglelineTextInputViewManager"; -} +RCT_EXPORT_MODULE() - (RCTShadowView *)shadowView { diff --git a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm index ebfdcccd4a2..e3d054ed17f 100644 --- a/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm +++ b/packages/react-native/Libraries/Text/VirtualText/RCTVirtualTextViewManager.mm @@ -13,10 +13,7 @@ @implementation RCTVirtualTextViewManager -+ (NSString *)moduleName -{ - return @"VirtualTextViewManager"; -} +RCT_EXPORT_MODULE(RCTVirtualText) - (UIView *)view { diff --git a/packages/react-native/Libraries/Vibration/RCTVibration.mm b/packages/react-native/Libraries/Vibration/RCTVibration.mm index 19b0b746397..389dc871c4d 100644 --- a/packages/react-native/Libraries/Vibration/RCTVibration.mm +++ b/packages/react-native/Libraries/Vibration/RCTVibration.mm @@ -18,10 +18,7 @@ @implementation RCTVibration -+ (NSString *)moduleName -{ - return @"Vibration"; -} +RCT_EXPORT_MODULE() - (void)vibrate { diff --git a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm index 4f4bd623ca1..37e4228d283 100644 --- a/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm +++ b/packages/react-native/React/CoreModules/RCTAccessibilityManager.mm @@ -33,10 +33,7 @@ NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification = @synthesize moduleRegistry = _moduleRegistry; @synthesize multipliers = _multipliers; -+ (NSString *)moduleName -{ - return @"AccessibilityManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm index 151223c6e6a..6472cc44f0b 100644 --- a/packages/react-native/React/CoreModules/RCTActionSheetManager.mm +++ b/packages/react-native/React/CoreModules/RCTActionSheetManager.mm @@ -42,10 +42,7 @@ using namespace facebook::react; return NO; } -+ (NSString *)moduleName -{ - return @"ActionSheetManager"; -} +RCT_EXPORT_MODULE() @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED; diff --git a/packages/react-native/React/CoreModules/RCTAlertManager.mm b/packages/react-native/React/CoreModules/RCTAlertManager.mm index 7a42f861a49..2b9fc60c968 100644 --- a/packages/react-native/React/CoreModules/RCTAlertManager.mm +++ b/packages/react-native/React/CoreModules/RCTAlertManager.mm @@ -40,10 +40,7 @@ RCT_ENUM_CONVERTER( NSHashTable *_alertControllers; } -+ (NSString *)moduleName -{ - return @"AlertManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTAppState.mm b/packages/react-native/React/CoreModules/RCTAppState.mm index 1b864f3b0fa..1998115ea27 100644 --- a/packages/react-native/React/CoreModules/RCTAppState.mm +++ b/packages/react-native/React/CoreModules/RCTAppState.mm @@ -43,10 +43,7 @@ static NSString *RCTCurrentAppState() facebook::react::ModuleConstants _constants; } -+ (NSString *)moduleName -{ - return @"AppState"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTAppearance.mm b/packages/react-native/React/CoreModules/RCTAppearance.mm index ebfea185c10..d25d9f64e6b 100644 --- a/packages/react-native/React/CoreModules/RCTAppearance.mm +++ b/packages/react-native/React/CoreModules/RCTAppearance.mm @@ -92,10 +92,7 @@ NSString *RCTColorSchemePreference(UITraitCollection *traitCollection) return self; } -+ (NSString *)moduleName -{ - return @"Appearance"; -} +RCT_EXPORT_MODULE(Appearance) + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTClipboard.mm b/packages/react-native/React/CoreModules/RCTClipboard.mm index cfb0883dfe0..2dc098a4730 100644 --- a/packages/react-native/React/CoreModules/RCTClipboard.mm +++ b/packages/react-native/React/CoreModules/RCTClipboard.mm @@ -19,10 +19,7 @@ using namespace facebook::react; @implementation RCTClipboard -+ (NSString *)moduleName -{ - return @"Clipboard"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm index 93d7d6b82ac..0dd2a7f100c 100644 --- a/packages/react-native/React/CoreModules/RCTDevLoadingView.mm +++ b/packages/react-native/React/CoreModules/RCTDevLoadingView.mm @@ -37,10 +37,7 @@ using namespace facebook::react; dispatch_block_t _initialMessageBlock; } -+ (NSString *)moduleName -{ - return @"DevLoadingView"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevMenu.mm b/packages/react-native/React/CoreModules/RCTDevMenu.mm index 85eee89af93..890c1596df7 100644 --- a/packages/react-native/React/CoreModules/RCTDevMenu.mm +++ b/packages/react-native/React/CoreModules/RCTDevMenu.mm @@ -124,10 +124,7 @@ typedef void (^RCTDevMenuAlertActionHandler)(UIAlertAction *action); @synthesize callableJSModules = _callableJSModules; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"DevMenu"; -} +RCT_EXPORT_MODULE() + (void)initialize { diff --git a/packages/react-native/React/CoreModules/RCTDevSettings.mm b/packages/react-native/React/CoreModules/RCTDevSettings.mm index 804e5a02b4f..fbbeec0e703 100644 --- a/packages/react-native/React/CoreModules/RCTDevSettings.mm +++ b/packages/react-native/React/CoreModules/RCTDevSettings.mm @@ -134,10 +134,7 @@ static std::atomic numInitializedModules{0}; @synthesize isInspectable = _isInspectable; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"RCTDevSettings"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm index 5793f88b083..ba4e2559697 100644 --- a/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm +++ b/packages/react-native/React/CoreModules/RCTDevToolsRuntimeSettingsModule.mm @@ -23,11 +23,7 @@ static Config _config; @end @implementation RCTDevToolsRuntimeSettingsModule - -+ (NSString *)moduleName -{ - return @"ReactDevToolsRuntimeSettingsModule)"; -} +RCT_EXPORT_MODULE(ReactDevToolsRuntimeSettingsModule) RCT_EXPORT_METHOD( setReloadAndProfileConfig : (JS::NativeReactDevToolsRuntimeSettingsModule::PartialReloadAndProfileConfig &)config) diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index bdefb1a0db0..8620af60246 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -39,10 +39,7 @@ static NSString *const kFrameKeyPath = @"frame"; @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"DeviceInfo"; -} +RCT_EXPORT_MODULE() - (instancetype)init { diff --git a/packages/react-native/React/CoreModules/RCTEventDispatcher.mm b/packages/react-native/React/CoreModules/RCTEventDispatcher.mm index 9554570567f..770c746c0bf 100644 --- a/packages/react-native/React/CoreModules/RCTEventDispatcher.mm +++ b/packages/react-native/React/CoreModules/RCTEventDispatcher.mm @@ -44,10 +44,7 @@ static uint16_t RCTUniqueCoalescingKeyGenerator = 0; @synthesize dispatchToJSThread = _dispatchToJSThread; @synthesize callableJSModules = _callableJSModules; -+ (NSString *)moduleName -{ - return @"EventDispatcher"; -} +RCT_EXPORT_MODULE() - (void)initialize { diff --git a/packages/react-native/React/CoreModules/RCTExceptionsManager.mm b/packages/react-native/React/CoreModules/RCTExceptionsManager.mm index ce58406e5d8..d49e49a029b 100644 --- a/packages/react-native/React/CoreModules/RCTExceptionsManager.mm +++ b/packages/react-native/React/CoreModules/RCTExceptionsManager.mm @@ -26,10 +26,7 @@ @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"ExceptionManager"; -} +RCT_EXPORT_MODULE() - (instancetype)initWithDelegate:(id)delegate { diff --git a/packages/react-native/React/CoreModules/RCTI18nManager.mm b/packages/react-native/React/CoreModules/RCTI18nManager.mm index c6dedeab7c3..7d3b9eaa11c 100644 --- a/packages/react-native/React/CoreModules/RCTI18nManager.mm +++ b/packages/react-native/React/CoreModules/RCTI18nManager.mm @@ -19,10 +19,7 @@ using namespace facebook::react; @implementation RCTI18nManager -+ (NSString *)moduleName -{ - return @"I18nManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm index 822dbe13de1..79f4f8f4170 100644 --- a/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm +++ b/packages/react-native/React/CoreModules/RCTKeyboardObserver.mm @@ -20,10 +20,7 @@ static NSDictionary *RCTParseKeyboardNotification(NSNotification *notification); @implementation RCTKeyboardObserver -+ (NSString *)moduleName -{ - return @"KeyboardObserver"; -} +RCT_EXPORT_MODULE() - (void)startObserving { diff --git a/packages/react-native/React/CoreModules/RCTLogBox.mm b/packages/react-native/React/CoreModules/RCTLogBox.mm index 8e5c19bdbe6..adfbb11a80e 100644 --- a/packages/react-native/React/CoreModules/RCTLogBox.mm +++ b/packages/react-native/React/CoreModules/RCTLogBox.mm @@ -27,10 +27,7 @@ @synthesize bridge = _bridge; -+ (NSString *)moduleName -{ - return @"LogBox"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm index 60dbaf5ffbb..e67ef6a4076 100644 --- a/packages/react-native/React/CoreModules/RCTPerfMonitor.mm +++ b/packages/react-native/React/CoreModules/RCTPerfMonitor.mm @@ -114,10 +114,7 @@ static vm_size_t RCTGetResidentMemorySize(void) @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"PerfMonitor"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTPlatform.mm b/packages/react-native/React/CoreModules/RCTPlatform.mm index 088157f20b8..09060d5e201 100644 --- a/packages/react-native/React/CoreModules/RCTPlatform.mm +++ b/packages/react-native/React/CoreModules/RCTPlatform.mm @@ -48,10 +48,7 @@ static NSString *interfaceIdiom(UIUserInterfaceIdiom idiom) ModuleConstants _constants; } -+ (NSString *)moduleName -{ - return @"PlatformConstants"; -} +RCT_EXPORT_MODULE(PlatformConstants) + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTRedBox.mm b/packages/react-native/React/CoreModules/RCTRedBox.mm index 71c1f277f76..fb057b96921 100644 --- a/packages/react-native/React/CoreModules/RCTRedBox.mm +++ b/packages/react-native/React/CoreModules/RCTRedBox.mm @@ -480,10 +480,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)aDecoder) @synthesize moduleRegistry = _moduleRegistry; @synthesize bundleManager = _bundleManager; -+ (NSString *)moduleName -{ - return @"RedBox"; -} +RCT_EXPORT_MODULE() - (void)registerErrorCustomizer:(id)errorCustomizer { diff --git a/packages/react-native/React/CoreModules/RCTSourceCode.mm b/packages/react-native/React/CoreModules/RCTSourceCode.mm index 47bf41729da..ad5008429f8 100644 --- a/packages/react-native/React/CoreModules/RCTSourceCode.mm +++ b/packages/react-native/React/CoreModules/RCTSourceCode.mm @@ -18,10 +18,7 @@ using namespace facebook::react; @implementation RCTSourceCode -+ (NSString *)moduleName -{ - return @"SourceCode"; -} +RCT_EXPORT_MODULE() @synthesize bundleManager = _bundleManager; diff --git a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm index 2e891bd446e..a7cd2cc9db5 100644 --- a/packages/react-native/React/CoreModules/RCTStatusBarManager.mm +++ b/packages/react-native/React/CoreModules/RCTStatusBarManager.mm @@ -68,10 +68,7 @@ static BOOL RCTViewControllerBasedStatusBarAppearance() return value; } -+ (NSString *)moduleName -{ - return @"StatusBarManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/CoreModules/RCTTiming.mm b/packages/react-native/React/CoreModules/RCTTiming.mm index f07d91a8044..14ee7844c7f 100644 --- a/packages/react-native/React/CoreModules/RCTTiming.mm +++ b/packages/react-native/React/CoreModules/RCTTiming.mm @@ -107,10 +107,7 @@ static const NSTimeInterval kIdleCallbackFrameDeadline = 0.001; @synthesize paused = _paused; @synthesize pauseCallback = _pauseCallback; -+ (NSString *)moduleName -{ - return @"Timing"; -} +RCT_EXPORT_MODULE() - (instancetype)initWithDelegate:(id)delegate { diff --git a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm index 1541561e78b..e29d76a76a2 100644 --- a/packages/react-native/React/CoreModules/RCTWebSocketModule.mm +++ b/packages/react-native/React/CoreModules/RCTWebSocketModule.mm @@ -39,10 +39,7 @@ NSMutableDictionary> *_contentHandlers; } -+ (NSString *)moduleName -{ - return @"WebSocketModule"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Modules/RCTUIManager.mm b/packages/react-native/React/Modules/RCTUIManager.mm index 0cfab141303..c3d1cf6d724 100644 --- a/packages/react-native/React/Modules/RCTUIManager.mm +++ b/packages/react-native/React/Modules/RCTUIManager.mm @@ -179,10 +179,7 @@ NSString *const RCTUIManagerWillUpdateViewsDueToContentSizeMultiplierChangeNotif @synthesize bridge = _bridge; @synthesize moduleRegistry = _moduleRegistry; -+ (NSString *)moduleName -{ - return @"RCTUIManager"; -} +RCT_EXPORT_MODULE() + (BOOL)requiresMainQueueSetup { diff --git a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m index 0d62c172ad0..8b9b79a0523 100644 --- a/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m +++ b/packages/react-native/React/Views/RCTActivityIndicatorViewManager.m @@ -27,10 +27,7 @@ RCT_ENUM_CONVERTER( @implementation RCTActivityIndicatorViewManager -+ (NSString *)moduleName -{ - return @"ActivityIndicatorViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m index 31bf173e12c..83a85a19039 100644 --- a/packages/react-native/React/Views/RCTDebuggingOverlayManager.m +++ b/packages/react-native/React/Views/RCTDebuggingOverlayManager.m @@ -17,10 +17,7 @@ @implementation RCTDebuggingOverlayManager -+ (NSString *)moduleName -{ - return @"DebuggingOverlay"; -} +RCT_EXPORT_MODULE(DebuggingOverlay) - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalHostViewManager.m b/packages/react-native/React/Views/RCTModalHostViewManager.m index c84b05da51c..147cd412439 100644 --- a/packages/react-native/React/Views/RCTModalHostViewManager.m +++ b/packages/react-native/React/Views/RCTModalHostViewManager.m @@ -40,10 +40,7 @@ NSPointerArray *_hostViews; } -+ (NSString *)moduleName -{ - return @"ModalHostViewManager "; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTModalManager.m b/packages/react-native/React/Views/RCTModalManager.m index effb33ffa30..6e15eb83416 100644 --- a/packages/react-native/React/Views/RCTModalManager.m +++ b/packages/react-native/React/Views/RCTModalManager.m @@ -17,10 +17,7 @@ @implementation RCTModalManager -+ (NSString *)moduleName -{ - return @"ModalManager"; -} +RCT_EXPORT_MODULE(); - (NSArray *)supportedEvents { diff --git a/packages/react-native/React/Views/RCTSwitchManager.m b/packages/react-native/React/Views/RCTSwitchManager.m index f758780f8d4..5398419a4c0 100644 --- a/packages/react-native/React/Views/RCTSwitchManager.m +++ b/packages/react-native/React/Views/RCTSwitchManager.m @@ -16,10 +16,7 @@ @implementation RCTSwitchManager -+ (NSString *)moduleName -{ - return @"SwitchManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/RCTViewManager.m b/packages/react-native/React/Views/RCTViewManager.m index d6f63ef1bd3..1ace350d242 100644 --- a/packages/react-native/React/Views/RCTViewManager.m +++ b/packages/react-native/React/Views/RCTViewManager.m @@ -128,10 +128,7 @@ RCT_MULTI_ENUM_CONVERTER( @synthesize bridge = _bridge; -+ (NSString *)moduleName -{ - return @"RCTViewManager"; -} +RCT_EXPORT_MODULE() - (dispatch_queue_t)methodQueue { diff --git a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m index 46b5d488b0d..1e9ff527f4e 100644 --- a/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m +++ b/packages/react-native/React/Views/RefreshControl/RCTRefreshControlManager.m @@ -15,10 +15,7 @@ @implementation RCTRefreshControlManager -+ (NSString *)moduleName -{ - return @"RefreshControlManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m index 61670f857f8..f8d2d8696dd 100644 --- a/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m +++ b/packages/react-native/React/Views/SafeAreaView/RCTSafeAreaViewManager.m @@ -15,10 +15,7 @@ @implementation RCTSafeAreaViewManager -+ (NSString *)moduleName -{ - return @"SafeAreaViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m index 896916f606b..4d79c3404c2 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollContentViewManager.m @@ -14,10 +14,7 @@ @implementation RCTScrollContentViewManager -+ (NSString *)moduleName -{ - return @"ScrollContentViewManager"; -} +RCT_EXPORT_MODULE() - (RCTScrollContentView *)view { diff --git a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m index fbf857f63aa..985771805c5 100644 --- a/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m +++ b/packages/react-native/React/Views/ScrollView/RCTScrollViewManager.m @@ -53,10 +53,7 @@ RCT_ENUM_CONVERTER( @implementation RCTScrollViewManager -+ (NSString *)moduleName -{ - return @"ScrollViewManager"; -} +RCT_EXPORT_MODULE() - (UIView *)view { diff --git a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm index 83f07891e3a..7486ffcb9ff 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm @@ -24,10 +24,7 @@ using namespace facebook::react; } // Backward-compatible export -+ (NSString *)moduleName -{ - return @"SampleTurboModule"; -} +RCT_EXPORT_MODULE() // Backward-compatible queue configuration + (BOOL)requiresMainQueueSetup