Skip to content

Commit ea3c714

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Delete orphan RCTBridgeProxy shims
Summary: Remove proxy shims whose declarations were deleted from private headers (`parentBridge`, `bridgeDescription`, `moduleProvider`, `batchedBridge`, profiling, `callNativeModule`, `logMessage`, `_immediatelyCallTimer`, `moduleSetupComplete`, `updateModuleWithInstance:`) and never-declared ones (`runtime`, `object`, write-only `jsCallInvoker`). Shims backing deleted public API stay as runtime nets. Changelog: [Internal] Differential Revision: D127294703
1 parent 586efda commit ea3c714

9 files changed

Lines changed: 0 additions & 153 deletions

File tree

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
2626
*/
2727
- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args;
2828

29-
/**
30-
* This property is mostly used on the main thread, but may be touched from
31-
* a background thread if the RCTBridge happens to deallocate on a background
32-
* thread. Therefore, we want all writes to it to be seen atomically.
33-
*/
34-
@property (atomic, strong) RCTBridge *batchedBridge;
35-
3629
/**
3730
* An object that allows one to require NativeModules/TurboModules.
3831
* RCTModuleRegistry is implemented in bridgeless mode and bridge mode.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
* For this reason, the block should always return new module instances, and
3030
* module instances should not be shared between bridges.
3131
*/
32-
typedef NSArray<id<RCTBridgeModule>> * (^RCTBridgeModuleListProvider)(void);
3332

3433
RCT_EXTERN_C_BEGIN
3534

‎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 & 107 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;
@@ -38,7 +30,6 @@ @implementation RCTBridgeProxy {
3830
NSDictionary *_launchOptions;
3931
void (^_dispatchToJSThread)(dispatch_block_t);
4032
void (^_registerSegmentWithId)(NSNumber *, NSString *);
41-
void *_runtime;
4233
}
4334

4435
@synthesize performanceLogger = _performanceLogger;
@@ -62,7 +53,6 @@ - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
6253
_callableJSModules = callableJSModules;
6354
_dispatchToJSThread = dispatchToJSThread;
6455
_registerSegmentWithId = registerSegmentWithId;
65-
_runtime = runtime;
6656
_launchOptions = [launchOptions copy];
6757
}
6858

@@ -92,22 +82,6 @@ - (Class)executorClass
9282
return nil;
9383
}
9484

95-
/**
96-
* Used By:
97-
* - RCTBlobCollector
98-
*/
99-
- (void *)runtime
100-
{
101-
[self logWarning:@"Please migrate to C++ TurboModule or RuntimeExecutor." cmd:_cmd];
102-
return _runtime;
103-
}
104-
105-
- (std::shared_ptr<facebook::react::CallInvoker>)jsCallInvoker
106-
{
107-
[self logWarning:@"Please migrate to RuntimeExecutor" cmd:_cmd];
108-
return _jsCallInvoker;
109-
}
110-
11185
/**
11286
* RCTModuleRegistry
11387
*/
@@ -241,61 +215,16 @@ - (BOOL)isBatchActive
241215
return NO;
242216
}
243217

244-
/**
245-
* RCTBridge ()
246-
*/
247-
248-
- (NSString *)bridgeDescription
249-
{
250-
[self logWarning:@"This method is not supported. Returning \"BridgeProxy\"." cmd:_cmd];
251-
return @"BridgeProxy";
252-
}
253-
254218
- (void)enqueueCallback:(NSNumber *)cbID args:(NSArray *)args
255219
{
256220
[self logError:@"This method is not supported. No-oping." cmd:_cmd];
257221
}
258222

259-
- (RCTBridge *)batchedBridge
260-
{
261-
[self logWarning:@"This method is not supported. Returning bridge proxy." cmd:_cmd];
262-
return (RCTBridge *)self;
263-
}
264-
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-
278223
- (RCTModuleRegistry *)moduleRegistry
279224
{
280225
return _moduleRegistry;
281226
}
282227

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-
299228
- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules
300229
{
301230
[self
@@ -304,37 +233,6 @@ - (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules
304233
cmd:_cmd];
305234
}
306235

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-
338236
/**
339237
* RCTBridge (RCTUIManager)
340238
*/
@@ -343,11 +241,6 @@ - (RCTUIManager *)uiManager
343241
return (RCTUIManager *)_uiManagerProxy;
344242
}
345243

346-
- (RCTBridgeProxy *)object
347-
{
348-
return self;
349-
}
350-
351244
/**
352245
* NSProxy setup
353246
*/

‎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
@@ -15,7 +15,6 @@
1515
#import <React/RCTBridge.h>
1616
#import <React/RCTBridgeModule.h>
1717
#import <React/RCTBridgeModuleDecorator.h>
18-
#import <React/RCTBridgeProxy+Cxx.h>
1918
#import <React/RCTBridgeProxy.h>
2019
#import <React/RCTComponentViewFactory.h>
2120
#import <React/RCTConstants.h>
@@ -323,7 +322,6 @@ - (void)_start
323322
}
324323
runtime:_reactInstance->getJavaScriptContext()
325324
launchOptions:_launchOptions];
326-
bridgeProxy.jsCallInvoker = jsCallInvoker;
327325
bridgeProxy.performanceLogger = _performanceLogger;
328326
_bridgeProxy = bridgeProxy;
329327

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ category RCTBridge(RCTUIManager) {
2121
public @property (assign, readonly) RCTUIManager* uiManager;
2222
}
2323

24-
category RCTBridgeProxy(Cxx) {
25-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
26-
}
27-
2824
category RCTBridgeProxy(RCTAccessibilityManager) {
2925
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
3026
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ category RCTBridge(RCTUIManager) {
2121
public @property (assign, readonly) RCTUIManager* uiManager;
2222
}
2323

24-
category RCTBridgeProxy(Cxx) {
25-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
26-
}
27-
2824
category RCTBridgeProxy(RCTAccessibilityManager) {
2925
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
3026
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ category RCTBridge(RCTUIManager) {
2121
public @property (assign, readonly) RCTUIManager* uiManager;
2222
}
2323

24-
category RCTBridgeProxy(Cxx) {
25-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
26-
}
27-
2824
category RCTBridgeProxy(RCTAccessibilityManager) {
2925
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
3026
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ category RCTBridge(RCTUIManager) {
2121
public @property (assign, readonly) RCTUIManager* uiManager;
2222
}
2323

24-
category RCTBridgeProxy(Cxx) {
25-
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
26-
}
27-
2824
category RCTBridgeProxy(RCTAccessibilityManager) {
2925
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
3026
}

0 commit comments

Comments
 (0)