Skip to content

Commit 586efda

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Delete dead per-module RCTBridge accessors
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 Differential Revision: D127294783
1 parent f0579c0 commit 586efda

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
@@ -5,18 +5,10 @@ category NSTextStorage(FontScaling) {
55
public virtual void scaleFontSizeWithRatio:minimumFontSize:maximumFontSize:(CGFloat ratio, CGFloat minimumFontSize, CGFloat maximumFontSize);
66
}
77

8-
category RCTBridge(RCTAccessibilityManager) {
9-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
10-
}
11-
128
category RCTBridge(RCTDevMenu) {
139
public @property (assign, readonly) RCTDevMenu* devMenu;
1410
}
1511

16-
category RCTBridge(RCTDevSettings) {
17-
public @property (assign, readonly) RCTDevSettings* devSettings;
18-
}
19-
2012
category RCTBridge(RCTEventDispatcher) {
2113
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2214
}
@@ -25,22 +17,10 @@ category RCTBridge(RCTImageLoader) {
2517
public @property (assign, readonly) RCTImageLoader* imageLoader;
2618
}
2719

28-
category RCTBridge(RCTImageStoreManager) {
29-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
30-
}
31-
32-
category RCTBridge(RCTNetworking) {
33-
public @property (assign, readonly) RCTNetworking* networking;
34-
}
35-
3620
category RCTBridge(RCTUIManager) {
3721
public @property (assign, readonly) RCTUIManager* uiManager;
3822
}
3923

40-
category RCTBridge(RCTWebSocketModule) {
41-
public virtual RCTWebSocketModule* webSocketModule();
42-
}
43-
4424
category RCTBridgeProxy(Cxx) {
4525
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
4626
}

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@ category NSTextStorage(FontScaling) {
55
public virtual void scaleFontSizeWithRatio:minimumFontSize:maximumFontSize:(CGFloat ratio, CGFloat minimumFontSize, CGFloat maximumFontSize);
66
}
77

8-
category RCTBridge(RCTAccessibilityManager) {
9-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
10-
}
11-
128
category RCTBridge(RCTDevMenu) {
139
public @property (assign, readonly) RCTDevMenu* devMenu;
1410
}
1511

16-
category RCTBridge(RCTDevSettings) {
17-
public @property (assign, readonly) RCTDevSettings* devSettings;
18-
}
19-
2012
category RCTBridge(RCTEventDispatcher) {
2113
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2214
}
@@ -25,22 +17,10 @@ category RCTBridge(RCTImageLoader) {
2517
public @property (assign, readonly) RCTImageLoader* imageLoader;
2618
}
2719

28-
category RCTBridge(RCTImageStoreManager) {
29-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
30-
}
31-
32-
category RCTBridge(RCTNetworking) {
33-
public @property (assign, readonly) RCTNetworking* networking;
34-
}
35-
3620
category RCTBridge(RCTUIManager) {
3721
public @property (assign, readonly) RCTUIManager* uiManager;
3822
}
3923

40-
category RCTBridge(RCTWebSocketModule) {
41-
public virtual RCTWebSocketModule* webSocketModule();
42-
}
43-
4424
category RCTBridgeProxy(Cxx) {
4525
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
4626
}

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

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,10 @@ category NSTextStorage(FontScaling) {
55
public virtual void scaleFontSizeWithRatio:minimumFontSize:maximumFontSize:(CGFloat ratio, CGFloat minimumFontSize, CGFloat maximumFontSize);
66
}
77

8-
category RCTBridge(RCTAccessibilityManager) {
9-
public @property (assign, readonly) RCTAccessibilityManager* accessibilityManager;
10-
}
11-
128
category RCTBridge(RCTDevMenu) {
139
public @property (assign, readonly) RCTDevMenu* devMenu;
1410
}
1511

16-
category RCTBridge(RCTDevSettings) {
17-
public @property (assign, readonly) RCTDevSettings* devSettings;
18-
}
19-
2012
category RCTBridge(RCTEventDispatcher) {
2113
public virtual id<RCTEventDispatcherProtocol> eventDispatcher();
2214
}
@@ -25,22 +17,10 @@ category RCTBridge(RCTImageLoader) {
2517
public @property (assign, readonly) RCTImageLoader* imageLoader;
2618
}
2719

28-
category RCTBridge(RCTImageStoreManager) {
29-
public @property (assign, readonly) RCTImageStoreManager* imageStoreManager;
30-
}
31-
32-
category RCTBridge(RCTNetworking) {
33-
public @property (assign, readonly) RCTNetworking* networking;
34-
}
35-
3620
category RCTBridge(RCTUIManager) {
3721
public @property (assign, readonly) RCTUIManager* uiManager;
3822
}
3923

40-
category RCTBridge(RCTWebSocketModule) {
41-
public virtual RCTWebSocketModule* webSocketModule();
42-
}
43-
4424
category RCTBridgeProxy(Cxx) {
4525
public @property (assign) std::shared_ptr<facebook::react::CallInvoker> jsCallInvoker;
4626
}

0 commit comments

Comments
 (0)