diff --git a/packages/react-native/React/Base/RCTBridge+Private.h b/packages/react-native/React/Base/RCTBridge+Private.h index bbccde965243..eaaff04b0f52 100644 --- a/packages/react-native/React/Base/RCTBridge+Private.h +++ b/packages/react-native/React/Base/RCTBridge+Private.h @@ -24,14 +24,17 @@ RCT_EXTERN void RCTRegisterModule(Class); * This method is used to invoke a callback that was registered in the * JavaScript application context. Safe to call from any thread. */ -- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args; +- (void)enqueueCallback:(NSNumber *)cbID + args:(NSArray *)args + __deprecated_msg("This API will be removed along with the legacy architecture."); /** * This property is mostly used on the main thread, but may be touched from * a background thread if the RCTBridge happens to deallocate on a background * thread. Therefore, we want all writes to it to be seen atomically. */ -@property (atomic, strong) RCTBridge *batchedBridge; +@property (atomic, strong) + RCTBridge *batchedBridge __deprecated_msg("This API will be removed along with the legacy architecture."); /** * An object that allows one to require NativeModules/TurboModules. @@ -48,11 +51,14 @@ RCT_EXTERN void RCTRegisterModule(Class); * Dispatch work to a module's queue - this is also supports the fake RCTJSThread * queue. Exposed for the RCTProfiler */ -- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue; +- (void)dispatchBlock:(dispatch_block_t)block + queue:(dispatch_queue_t)queue + __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Registers additional classes with the ModuleRegistry. */ -- (void)registerAdditionalModuleClasses:(NSArray *)newModules; +- (void)registerAdditionalModuleClasses:(NSArray *)newModules + __deprecated_msg("This API will be removed along with the legacy architecture."); @end diff --git a/packages/react-native/React/Base/RCTBridge.h b/packages/react-native/React/Base/RCTBridge.h index d09cdeed3edd..7f935068556a 100644 --- a/packages/react-native/React/Base/RCTBridge.h +++ b/packages/react-native/React/Base/RCTBridge.h @@ -41,7 +41,8 @@ NSString *RCTBridgeModuleNameForClass(Class bridgeModuleClass); /** * This function returns the list of modules that have been registered using the Old Architecture mechanism. */ -NSMutableArray *getModulesLoadedWithOldArch(void); +NSMutableArray *getModulesLoadedWithOldArch(void) + __deprecated_msg("This API will be removed along with the legacy architecture."); #ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP // Turn on TurboModule interop @@ -128,7 +129,9 @@ RCT_EXTERN_C_END * * @experimental */ -- (void)registerSegmentWithId:(NSUInteger)segmentId path:(NSString *)path; +- (void)registerSegmentWithId:(NSUInteger)segmentId + path:(NSString *)path + __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Retrieve a bridge module instance by name or class. Note that modules are @@ -184,7 +187,8 @@ RCT_EXTERN_C_END * The class of the executor currently being used. Changes to this value will * take effect after the bridge is reloaded. */ -@property (nonatomic, strong) Class executorClass; +@property (nonatomic, strong) + Class executorClass __deprecated_msg("This API will be removed along with the legacy architecture."); /** * The delegate provided during the bridge initialization @@ -194,22 +198,26 @@ RCT_EXTERN_C_END /** * The launch options that were used to initialize the bridge. */ -@property (nonatomic, copy, readonly) NSDictionary *launchOptions; +@property (nonatomic, copy, readonly) + NSDictionary *launchOptions __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Use this to check if the bridge is currently loading. */ -@property (nonatomic, readonly, getter=isLoading) BOOL loading; +@property (nonatomic, readonly, getter=isLoading) + BOOL loading __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Use this to check if the bridge has been invalidated. */ -@property (nonatomic, readonly, getter=isValid) BOOL valid; +@property (nonatomic, readonly, getter=isValid) + BOOL valid __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Link to the Performance Logger that logs React Native perf events. */ -@property (nonatomic, readonly, strong) RCTPerformanceLogger *performanceLogger; +@property (nonatomic, readonly, strong) RCTPerformanceLogger *performanceLogger __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * Reload the bundle and reset executor & modules. Safe to call from any thread. @@ -224,7 +232,7 @@ RCT_EXTERN_C_END /** * Handle notifications for a fast refresh. Safe to call from any thread. */ -- (void)onFastRefresh; +- (void)onFastRefresh __deprecated_msg("This API will be removed along with the legacy architecture."); /** * Inform the bridge, and anything subscribing to it, that it should reload. diff --git a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index bddc3b863912..87e71dd94b53 100644 --- a/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/packages/react-native/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -117,7 +117,10 @@ - (void)surface:(RCTSurface *)surface didChangeStage:(RCTSurfaceStage)stage { [super surface:surface didChangeStage:stage]; if (RCTSurfaceStageIsRunning(stage)) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" [_bridge.performanceLogger markStopForTag:RCTPLTTI]; +#pragma clang diagnostic pop #if TARGET_OS_TV dispatch_async(dispatch_get_main_queue(), ^{ self.reactPreferredFocusedView = nil; diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index fc0f82d267b2..e63ebc8994c5 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -553,7 +553,10 @@ - (void)_logOldArchitectureWarnings return; } +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" NSArray *modulesInOldArchMode = [getModulesLoadedWithOldArch() copy]; +#pragma clang diagnostic pop if (modulesInOldArchMode.count > 0) { NSMutableString *moduleList = [NSMutableString new]; for (NSString *moduleName in modulesInOldArchMode) {