Skip to content

Commit 1ca5679

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Prune dead RCTBridge private declarations (#59319)
Summary: Pull Request resolved: #59319 Remove bridge declarations with zero callers: profiler flow state, test-only setup, module data lookup, profiling toggles, and the unimplemented TurboModule category. The proxy keeps its shims, so runtime behavior is unchanged. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D126592134 fbshipit-source-id: 08d97f2da54fb1e70ff3782514a20c2da962e171
1 parent f9996a8 commit 1ca5679

6 files changed

Lines changed: 0 additions & 102 deletions

File tree

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

Lines changed: 0 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#import <React/RCTBridge.h>
99

1010
@class RCTModuleRegistry;
11-
@class RCTModuleData;
1211
@protocol RCTJavaScriptExecutor;
1312

1413
#if !defined(RCT_REMOVE_LEGACY_MODULE_INTEROP) || !defined(RCT_REMOVE_LEGACY_COMPONENT_INTEROP)
@@ -18,23 +17,9 @@ RCT_EXTERN void RCTRegisterModule(Class);
1817

1918
@interface RCTBridge ()
2019

21-
// Used for the profiler flow events between JS and native
22-
@property (nonatomic, assign) int64_t flowID;
23-
@property (nonatomic, assign) CFMutableDictionaryRef flowIDMap;
24-
@property (nonatomic, strong) NSLock *flowIDMapLock;
25-
26-
// Used by RCTDevMenu
27-
@property (nonatomic, copy) NSString *bridgeDescription;
28-
2920
+ (instancetype)currentBridge;
3021
+ (void)setCurrentBridge:(RCTBridge *)bridge;
3122

32-
/**
33-
* Bridge setup code - creates an instance of RCTBachedBridge. Exposed for
34-
* test only
35-
*/
36-
- (void)setUp;
37-
3823
/**
3924
* This method is used to invoke a callback that was registered in the
4025
* JavaScript application context. Safe to call from any thread.
@@ -48,17 +33,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
4833
*/
4934
@property (atomic, strong) RCTBridge *batchedBridge;
5035

51-
/**
52-
* The block that creates the modules' instances to be added to the bridge.
53-
* Exposed for RCTCxxBridge
54-
*/
55-
@property (nonatomic, copy, readonly) RCTBridgeModuleListProvider moduleProvider;
56-
57-
/**
58-
* Used by RCTDevMenu to override the `hot` param of the current bundleURL.
59-
*/
60-
@property (nonatomic, strong, readwrite) NSURL *bundleURL;
61-
6236
/**
6337
* An object that allows one to require NativeModules/TurboModules.
6438
* RCTModuleRegistry is implemented in bridgeless mode and bridge mode.
@@ -70,17 +44,6 @@ RCT_EXTERN void RCTRegisterModule(Class);
7044

7145
@interface RCTBridge (RCTCxxBridge)
7246

73-
/**
74-
* Used by RCTModuleData
75-
*/
76-
77-
@property (nonatomic, weak, readonly) RCTBridge *parentBridge;
78-
79-
/**
80-
* Used by RCTModuleData
81-
*/
82-
@property (nonatomic, assign, readonly) BOOL moduleSetupComplete;
83-
8447
/**
8548
* Called on the child bridge to run the executor and start loading.
8649
*/
@@ -92,41 +55,9 @@ RCT_EXTERN void RCTRegisterModule(Class);
9255
*/
9356
- (void)dispatchBlock:(dispatch_block_t)block queue:(dispatch_queue_t)queue;
9457

95-
/**
96-
* Get the module data for a given module name. Used by UIManager to implement
97-
* the `dispatchViewManagerCommand` method.
98-
*/
99-
- (RCTModuleData *)moduleDataForName:(NSString *)moduleName;
100-
10158
/**
10259
* Registers additional classes with the ModuleRegistry.
10360
*/
10461
- (void)registerAdditionalModuleClasses:(NSArray<Class> *)newModules;
10562

106-
/**
107-
* Updates the ModuleRegistry with a pre-initialized instance.
108-
*/
109-
- (void)updateModuleWithInstance:(id<RCTBridgeModule>)instance;
110-
111-
/**
112-
* Systrace profiler toggling methods exposed for the RCTDevMenu
113-
*/
114-
- (void)startProfiling;
115-
- (void)stopProfiling:(void (^)(NSData *))callback;
116-
117-
/**
118-
* Synchronously call a specific native module's method and return the result
119-
*/
120-
- (id)callNativeModule:(NSUInteger)moduleID method:(NSUInteger)methodID params:(NSArray *)params;
121-
122-
/**
123-
* Hook exposed for RCTLog to send logs to JavaScript when not running in JSC
124-
*/
125-
- (void)logMessage:(NSString *)message level:(NSString *)level;
126-
127-
/**
128-
* Allow super fast, one time, timers to skip the queue and be directly executed
129-
*/
130-
- (void)_immediatelyCallTimer:(NSNumber *)timer;
131-
13263
@end

‎packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,3 @@ class JSI_EXPORT ObjCTurboModule : public TurboModule {
200200
@optional
201201
- (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper;
202202
@end
203-
204-
/**
205-
* These methods are all implemented by RCTCxxBridge, which subclasses RCTBridge. Hence, they must only be used in
206-
* contexts where the concrete class of an RCTBridge instance is RCTCxxBridge. This happens, for example, when
207-
* [RCTCxxBridgeDelegate jsExecutorFactoryForBridge:(RCTBridge *)] is invoked by RCTCxxBridge.
208-
*
209-
* TODO: Consolidate this extension with the one in RCTSurfacePresenter.
210-
*/
211-
@interface RCTBridge (RCTTurboModule)
212-
- (std::shared_ptr<facebook::react::CallInvoker>)jsCallInvoker;
213-
- (std::shared_ptr<facebook::react::NativeMethodCallInvoker>)decorateNativeMethodCallInvoker:
214-
(std::shared_ptr<facebook::react::NativeMethodCallInvoker>)nativeMethodCallInvoker;
215-
@end

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ category RCTBridge(RCTSurfacePresenterStub) {
4343
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
4444
}
4545

46-
category RCTBridge(RCTTurboModule) {
47-
public virtual std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker();
48-
public virtual std::shared_ptr<facebook::react::NativeMethodCallInvoker> decorateNativeMethodCallInvoker:(std::shared_ptr<facebook::react::NativeMethodCallInvoker> nativeMethodCallInvoker);
49-
}
50-
5146
category RCTBridge(RCTUIManager) {
5247
public @property (assign, readonly) RCTUIManager* uiManager;
5348
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ category RCTBridge(RCTSurfacePresenterStub) {
4343
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
4444
}
4545

46-
category RCTBridge(RCTTurboModule) {
47-
public virtual std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker();
48-
public virtual std::shared_ptr<facebook::react::NativeMethodCallInvoker> decorateNativeMethodCallInvoker:(std::shared_ptr<facebook::react::NativeMethodCallInvoker> nativeMethodCallInvoker);
49-
}
50-
5146
category RCTBridge(RCTUIManager) {
5247
public @property (assign, readonly) RCTUIManager* uiManager;
5348
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ category RCTBridge(RCTSurfacePresenterStub) {
4343
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
4444
}
4545

46-
category RCTBridge(RCTTurboModule) {
47-
public virtual std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker();
48-
public virtual std::shared_ptr<facebook::react::NativeMethodCallInvoker> decorateNativeMethodCallInvoker:(std::shared_ptr<facebook::react::NativeMethodCallInvoker> nativeMethodCallInvoker);
49-
}
50-
5146
category RCTBridge(RCTUIManager) {
5247
public @property (assign, readonly) RCTUIManager* uiManager;
5348
}

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ category RCTBridge(RCTSurfacePresenterStub) {
4343
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
4444
}
4545

46-
category RCTBridge(RCTTurboModule) {
47-
public virtual std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker();
48-
public virtual std::shared_ptr<facebook::react::NativeMethodCallInvoker> decorateNativeMethodCallInvoker:(std::shared_ptr<facebook::react::NativeMethodCallInvoker> nativeMethodCallInvoker);
49-
}
50-
5146
category RCTBridge(RCTUIManager) {
5247
public @property (assign, readonly) RCTUIManager* uiManager;
5348
}

0 commit comments

Comments
 (0)