Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/react-native/React/Base/RCTBridge+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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<Class> *)newModules;
- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules
__deprecated_msg("This API will be removed along with the legacy architecture.");

@end
24 changes: 16 additions & 8 deletions packages/react-native/React/Base/RCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<NSString *> *getModulesLoadedWithOldArch(void);
NSMutableArray<NSString *> *getModulesLoadedWithOldArch(void)
__deprecated_msg("This API will be removed along with the legacy architecture.");

#ifndef RCT_REMOVE_LEGACY_MODULE_INTEROP
// Turn on TurboModule interop
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,10 @@ - (void)_logOldArchitectureWarnings
return;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
NSArray<NSString *> *modulesInOldArchMode = [getModulesLoadedWithOldArch() copy];
#pragma clang diagnostic pop
if (modulesInOldArchMode.count > 0) {
NSMutableString *moduleList = [NSMutableString new];
for (NSString *moduleName in modulesInOldArchMode) {
Expand Down
Loading