Skip to content

Commit d53f44a

Browse files
Delete dead per-module RCTBridge accessors (#59443)
Summary: Five module accessors on `RCTBridge` (`networking`, `webSocketModule`, `accessibilityManager`, `devSettings`, `imageStoreManager`) have no callers. Delete the bridge-side declarations and the last bridge-side implementation (`uiManager`, whose proxy implementation stays). Deprecate `devMenu`, which external clients still use. Changelog: [iOS][Removed] - Remove unused per-module `RCTBridge` accessors Reviewed By: cipolleschi Differential Revision: D127294783
1 parent ab2402b commit d53f44a

11 files changed

Lines changed: 2 additions & 120 deletions

File tree

‎packages/react-native/Libraries/Image/RCTImageStoreManager.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,6 @@
4040

4141
@end
4242

43-
@interface RCTBridge (RCTImageStoreManager)
44-
45-
@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager;
46-
47-
@end
48-
4943
@interface RCTBridgeProxy (RCTImageStoreManager)
5044

5145
@property (nonatomic, readonly) RCTImageStoreManager *imageStoreManager;

‎packages/react-native/Libraries/Network/RCTNetworking.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,6 @@
6161

6262
@end
6363

64-
@interface RCTBridge (RCTNetworking)
65-
66-
@property (nonatomic, readonly) RCTNetworking *networking;
67-
68-
@end
69-
7064
@interface RCTBridgeProxy (RCTNetworking)
7165

7266
@property (nonatomic, readonly) RCTNetworking *networking;

‎packages/react-native/React/CoreModules/RCTAccessibilityManager.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@ extern NSString *const RCTAccessibilityManagerDidUpdateMultiplierNotification; /
3232

3333
@end
3434

35-
@interface RCTBridge (RCTAccessibilityManager)
36-
37-
@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager;
38-
39-
@end
40-
4135
@interface RCTBridgeProxy (RCTAccessibilityManager)
4236

4337
@property (nonatomic, readonly) RCTAccessibilityManager *accessibilityManager;

‎packages/react-native/React/CoreModules/RCTDevMenu.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ typedef NSString * (^RCTDevMenuItemTitleBlock)(void);
137137
*/
138138
@interface RCTBridge (RCTDevMenu)
139139

140-
@property (nonatomic, readonly) RCTDevMenu *devMenu;
140+
@property (nonatomic, readonly) RCTDevMenu *devMenu __deprecated_msg(
141+
"Access RCTDevMenu through the bridge proxy instead; this accessor will be removed.");
141142

142143
@end
143144

‎packages/react-native/React/CoreModules/RCTDevSettings.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,6 @@ typedef void (^RCTConnectedHandler)(void);
142142

143143
@end
144144

145-
@interface RCTBridge (RCTDevSettings)
146-
147-
@property (nonatomic, readonly) RCTDevSettings *devSettings;
148-
149-
@end
150-
151145
@interface RCTBridgeProxy (RCTDevSettings)
152146

153147
@property (nonatomic, readonly) RCTDevSettings *devSettings;

‎packages/react-native/React/CoreModules/RCTWebSocketModule.h‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ RCT_EXTERN void RCTSetCustomSRWebSocketProvider(SRWebSocketProvider provider);
3333

3434
@end
3535

36-
@interface RCTBridge (RCTWebSocketModule)
37-
38-
- (RCTWebSocketModule *)webSocketModule;
39-
40-
@end
41-
4236
@interface RCTBridgeProxy (RCTWebSocketModule)
4337

4438
- (RCTWebSocketModule *)webSocketModule;

‎packages/react-native/React/Modules/RCTUIManager.mm‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,6 @@ - (void)invalidate
220220

221221
@end
222222

223-
@implementation RCTBridge (RCTUIManager)
224-
225-
- (RCTUIManager *)uiManager
226-
{
227-
return [self moduleForClass:[RCTUIManager class]];
228-
}
229-
230-
@end
231-
232223
UIView *RCTPaperViewOrCurrentView(UIView *view)
233224
{
234225
if ([view respondsToSelector:@selector(paperView)]) {

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ category RCTBridge(Inspector) {
1010
public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget;
1111
}
1212

13-
category RCTBridge(RCTAccessibilityManager) {
14-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
15-
}
16-
1713
category RCTBridge(RCTDevMenu) {
1814
public @property (assign, readonly) RCTDevMenu* devMenu;
1915
}
2016

21-
category RCTBridge(RCTDevSettings) {
22-
public @property (assign, readonly) RCTDevSettings* devSettings;
23-
}
24-
2517
category RCTBridge(RCTEventDispatcher) {
2618
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2719
}
@@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) {
3022
public @property (assign, readonly) RCTImageLoader* imageLoader;
3123
}
3224

33-
category RCTBridge(RCTImageStoreManager) {
34-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
35-
}
36-
37-
category RCTBridge(RCTNetworking) {
38-
public @property (assign, readonly) RCTNetworking* networking;
39-
}
40-
4125
category RCTBridge(RCTSurfacePresenterStub) {
4226
public virtual id<RCTSurfacePresenterStub> surfacePresenter();
4327
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
@@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) {
4731
public @property (assign, readonly) RCTUIManager* uiManager;
4832
}
4933

50-
category RCTBridge(RCTWebSocketModule) {
51-
public virtual RCTWebSocketModule* webSocketModule();
52-
}
53-
5434
category RCTBridgeProxy(Cxx) {
5535
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
5636
}

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ category RCTBridge(Inspector) {
1010
public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget;
1111
}
1212

13-
category RCTBridge(RCTAccessibilityManager) {
14-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
15-
}
16-
1713
category RCTBridge(RCTDevMenu) {
1814
public @property (assign, readonly) RCTDevMenu* devMenu;
1915
}
2016

21-
category RCTBridge(RCTDevSettings) {
22-
public @property (assign, readonly) RCTDevSettings* devSettings;
23-
}
24-
2517
category RCTBridge(RCTEventDispatcher) {
2618
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2719
}
@@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) {
3022
public @property (assign, readonly) RCTImageLoader* imageLoader;
3123
}
3224

33-
category RCTBridge(RCTImageStoreManager) {
34-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
35-
}
36-
37-
category RCTBridge(RCTNetworking) {
38-
public @property (assign, readonly) RCTNetworking* networking;
39-
}
40-
4125
category RCTBridge(RCTSurfacePresenterStub) {
4226
public virtual id<RCTSurfacePresenterStub> surfacePresenter();
4327
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
@@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) {
4731
public @property (assign, readonly) RCTUIManager* uiManager;
4832
}
4933

50-
category RCTBridge(RCTWebSocketModule) {
51-
public virtual RCTWebSocketModule* webSocketModule();
52-
}
53-
5434
category RCTBridgeProxy(Cxx) {
5535
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
5636
}

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,10 @@ category RCTBridge(Inspector) {
1010
public @property (assign, readonly) facebook::react::jsinspector_modern::HostTarget* inspectorTarget;
1111
}
1212

13-
category RCTBridge(RCTAccessibilityManager) {
14-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
15-
}
16-
1713
category RCTBridge(RCTDevMenu) {
1814
public @property (assign, readonly) RCTDevMenu* devMenu;
1915
}
2016

21-
category RCTBridge(RCTDevSettings) {
22-
public @property (assign, readonly) RCTDevSettings* devSettings;
23-
}
24-
2517
category RCTBridge(RCTEventDispatcher) {
2618
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2719
}
@@ -30,14 +22,6 @@ category RCTBridge(RCTImageLoader) {
3022
public @property (assign, readonly) RCTImageLoader* imageLoader;
3123
}
3224

33-
category RCTBridge(RCTImageStoreManager) {
34-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
35-
}
36-
37-
category RCTBridge(RCTNetworking) {
38-
public @property (assign, readonly) RCTNetworking* networking;
39-
}
40-
4125
category RCTBridge(RCTSurfacePresenterStub) {
4226
public virtual id<RCTSurfacePresenterStub> surfacePresenter();
4327
public virtual void setSurfacePresenter:(id<RCTSurfacePresenterStub> presenter);
@@ -47,10 +31,6 @@ category RCTBridge(RCTUIManager) {
4731
public @property (assign, readonly) RCTUIManager* uiManager;
4832
}
4933

50-
category RCTBridge(RCTWebSocketModule) {
51-
public virtual RCTWebSocketModule* webSocketModule();
52-
}
53-
5434
category RCTBridgeProxy(Cxx) {
5535
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
5636
}

0 commit comments

Comments
 (0)