Skip to content

Commit 7d4fb92

Browse files
Delete orphan RCTBridgeProxy shims (#59444)
Summary: Remove proxy shims whose declarations were deleted from private headers (`parentBridge`, `moduleProvider`, `moduleSetupComplete`, `updateModuleWithInstance:`, profiling, `callNativeModule`, `logMessage`, `_immediatelyCallTimer:`) and never-declared ones (`object`, write-only `jsCallInvoker`). Keep `batchedBridge`, `bridgeDescription`, and `runtime`: Expo and Reanimated still call them. Shims backing deleted public API stay as runtime nets. Changelog: [Internal] Reviewed By: andrewdacenko Differential Revision: D127294703
1 parent 9add5b6 commit 7d4fb92

8 files changed

Lines changed: 0 additions & 127 deletions

File tree

‎packages/react-native/React/Base/RCTBridge.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@
2121
@class RCTBridge;
2222
@class RCTPerformanceLogger;
2323

24-
/**
25-
* This block can be used to instantiate modules that require additional
26-
* init parameters, or additional configuration prior to being used.
27-
* The bridge will call this block to instantiate the modules, and will
28-
* be responsible for invalidating/releasing them when the bridge is destroyed.
29-
* For this reason, the block should always return new module instances, and
30-
* module instances should not be shared between bridges.
31-
*/
32-
typedef NSArray<id<RCTBridgeModule>> * (^RCTBridgeModuleListProvider)(void);
33-
3424
RCT_EXTERN_C_BEGIN
3525

3626
/**

‎packages/react-native/React/Base/RCTBridgeProxy+Cxx.h‎

Lines changed: 0 additions & 20 deletions
This file was deleted.

‎packages/react-native/React/Base/RCTBridgeProxy.mm‎

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@
66
*/
77

88
#import "RCTBridgeProxy.h"
9-
#import "RCTBridgeProxy+Cxx.h"
109

1110
#import <React/RCTBridge+Private.h>
1211
#import <React/RCTBridge.h>
1312
#import <React/RCTLog.h>
1413
#import <React/RCTUIManager.h>
15-
#import <ReactCommon/CallInvoker.h>
1614
#import <jsi/jsi.h>
1715

1816
using namespace facebook;
@@ -24,12 +22,6 @@ - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel;
2422
- (void)forwardInvocation:(NSInvocation *)invocation;
2523
@end
2624

27-
@interface RCTBridgeProxy ()
28-
29-
@property (nonatomic, readwrite) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
30-
31-
@end
32-
3325
@implementation RCTBridgeProxy {
3426
RCTUIManagerProxy *_uiManagerProxy;
3527
RCTModuleRegistry *_moduleRegistry;
@@ -102,12 +94,6 @@ - (void *)runtime
10294
return _runtime;
10395
}
10496

105-
- (std::shared_ptr<facebook::react::CallInvoker>)jsCallInvoker
106-
{
107-
[self logWarning:@"Please migrate to RuntimeExecutor" cmd:_cmd];
108-
return _jsCallInvoker;
109-
}
110-
11197
/**
11298
* RCTModuleRegistry
11399
*/
@@ -262,40 +248,11 @@ - (RCTBridge *)batchedBridge
262248
return (RCTBridge *)self;
263249
}
264250

265-
- (void)setBatchedBridge
266-
{
267-
[self logError:@"This method is not supported. No-oping." cmd:_cmd];
268-
}
269-
270-
- (RCTBridgeModuleListProvider)moduleProvider
271-
{
272-
[self logWarning:@"This method is not supported. Returning empty block" cmd:_cmd];
273-
return ^{
274-
return @[];
275-
};
276-
}
277-
278251
- (RCTModuleRegistry *)moduleRegistry
279252
{
280253
return _moduleRegistry;
281254
}
282255

283-
/**
284-
* RCTBridge (RCTCxxBridge)
285-
*/
286-
287-
- (RCTBridge *)parentBridge
288-
{
289-
[self logWarning:@"This method is not supported. Returning bridge proxy." cmd:_cmd];
290-
return (RCTBridge *)self;
291-
}
292-
293-
- (BOOL)moduleSetupComplete
294-
{
295-
[self logWarning:@"This method is not supported. Returning YES." cmd:_cmd];
296-
return YES;
297-
}
298-
299256
- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules
300257
{
301258
[self
@@ -304,37 +261,6 @@ - (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules
304261
cmd:_cmd];
305262
}
306263

307-
- (void)updateModuleWithInstance:(id<RCTBridgeModule>)instance
308-
{
309-
[self logError:@"This method is not supported. Nooping." cmd:_cmd];
310-
}
311-
312-
- (void)startProfiling
313-
{
314-
[self logWarning:@"This method is not supported. Nooping." cmd:_cmd];
315-
}
316-
317-
- (void)stopProfiling:(void (^)(NSData *))callback
318-
{
319-
[self logWarning:@"This method is not supported. Nooping." cmd:_cmd];
320-
}
321-
322-
- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params
323-
{
324-
[self logError:@"This method is not supported. Nooping and returning nil." cmd:_cmd];
325-
return nil;
326-
}
327-
328-
- (void)logMessage:(NSString *)message level:(NSString *)level
329-
{
330-
[self logWarning:@"This method is not supported. Nooping." cmd:_cmd];
331-
}
332-
333-
- (void)_immediatelyCallTimer:(NSNumber *)timer
334-
{
335-
[self logWarning:@"This method is not supported. Nooping." cmd:_cmd];
336-
}
337-
338264
/**
339265
* RCTBridge (Inspector)
340266
*/
@@ -352,11 +278,6 @@ - (RCTUIManager *)uiManager
352278
return (RCTUIManager *)_uiManagerProxy;
353279
}
354280

355-
- (RCTBridgeProxy *)object
356-
{
357-
return self;
358-
}
359-
360281
/**
361282
* NSProxy setup
362283
*/

‎packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#import <React/RCTBridge.h>
1717
#import <React/RCTBridgeModule.h>
1818
#import <React/RCTBridgeModuleDecorator.h>
19-
#import <React/RCTBridgeProxy+Cxx.h>
2019
#import <React/RCTBridgeProxy.h>
2120
#import <React/RCTComponentViewFactory.h>
2221
#import <React/RCTConstants.h>
@@ -324,7 +323,6 @@ - (void)_start
324323
}
325324
runtime:_reactInstance->getJavaScriptContext()
326325
launchOptions:_launchOptions];
327-
bridgeProxy.jsCallInvoker = jsCallInvoker;
328326
bridgeProxy.performanceLogger = _performanceLogger;
329327
_bridgeProxy = bridgeProxy;
330328

‎scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) {
5151
public virtual RCTWebSocketModule* webSocketModule();
5252
}
5353

54-
category RCTBridgeProxy(Cxx) {
55-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
56-
}
57-
5854
category RCTBridgeProxy(RCTAccessibilityManager) {
5955
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
6056
}

‎scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) {
5151
public virtual RCTWebSocketModule* webSocketModule();
5252
}
5353

54-
category RCTBridgeProxy(Cxx) {
55-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
56-
}
57-
5854
category RCTBridgeProxy(RCTAccessibilityManager) {
5955
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
6056
}

‎scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) {
5151
public virtual RCTWebSocketModule* webSocketModule();
5252
}
5353

54-
category RCTBridgeProxy(Cxx) {
55-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
56-
}
57-
5854
category RCTBridgeProxy(RCTAccessibilityManager) {
5955
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
6056
}

‎scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@ category RCTBridge(RCTWebSocketModule) {
5151
public virtual RCTWebSocketModule* webSocketModule();
5252
}
5353

54-
category RCTBridgeProxy(Cxx) {
55-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
56-
}
57-
5854
category RCTBridgeProxy(RCTAccessibilityManager) {
5955
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
6056
}

0 commit comments

Comments
 (0)