Skip to content

Commit 30c84e9

Browse files
christophpurrermeta-codesync[bot]
authored andcommitted
Delete dead sourceURLForBridge delegate chain
Summary: `sourceURLForBridge:` has no callers: the factory reads `bundleURL` directly, and the default delegate's implementations only threw or forwarded to each other. Delete the protocol method with those implementations and the factory's dead configuration assignment. The `RCTJavaScriptLoader.h` import stays: removing it breaks every `RCTBridge.h` importer that uses the loader types. Changelog: [iOS][Removed] - Remove deprecated `RCTBridgeDelegate` `sourceURLForBridge:` Differential Revision: D127294778
1 parent 46ee5a5 commit 30c84e9

8 files changed

Lines changed: 1 addition & 40 deletions

File tree

‎packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm‎

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

88
#import "RCTDefaultReactNativeFactoryDelegate.h"
9-
#import <React/RCTBridge.h>
10-
#import <React/RCTJavaScriptLoader.h>
119
#import <React/RCTRootView.h>
1210
#import <ReactCommon/RCTHost.h>
1311
#import "RCTAppSetupUtils.h"
@@ -29,13 +27,6 @@ @implementation RCTDefaultReactNativeFactoryDelegate {
2927

3028
@synthesize dependencyProvider;
3129

32-
- (NSURL *_Nullable)sourceURLForBridge:(nonnull RCTBridge *)bridge
33-
{
34-
[NSException raise:@"RCTBridgeDelegate::sourceURLForBridge not implemented"
35-
format:@"Subclasses must implement a valid sourceURLForBridge method"];
36-
return nil;
37-
}
38-
3930
- (UIViewController *)createRootViewController
4031
{
4132
return [UIViewController new];
@@ -132,11 +123,4 @@ - (Class)getModuleClassFromName:(const char *)name
132123
return nullptr;
133124
}
134125

135-
- (void)loadSourceForBridge:(RCTBridge *)bridge
136-
onProgress:(RCTSourceLoadProgressBlock)onProgress
137-
onComplete:(RCTSourceLoadBlock)loadCallback
138-
{
139-
[RCTJavaScriptLoader loadBundleAtURL:[self sourceURLForBridge:bridge] onProgress:onProgress onComplete:loadCallback];
140-
}
141-
142126
@end

‎packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,6 @@ - (RCTRootViewFactory *)createRCTRootViewFactory
295295
[weakSelf.delegate customizeRootView:(RCTRootView *)rootView];
296296
};
297297

298-
configuration.sourceURLForBridge = ^NSURL *_Nullable(RCTBridge *_Nonnull bridge)
299-
{
300-
return [weakSelf.delegate bundleURL];
301-
};
302-
303298
if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) {
304299
configuration.extraModulesForBridge = ^NSArray<id<RCTBridgeModule>> *_Nonnull(RCTBridge *_Nonnull bridge)
305300
{

‎packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#import <React/RCTBridge.h>
9+
#import <React/RCTJavaScriptLoader.h>
910
#import <React/RCTRootView.h>
1011
#import <React/RCTUtils.h>
1112
#import "RCTJSRuntimeConfiguratorProtocol.h"

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

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,6 @@
1313
NS_ASSUME_NONNULL_BEGIN
1414

1515
@protocol RCTBridgeDelegate <NSObject>
16-
#ifndef RCT_REMOVE_LEGACY_ARCH
17-
18-
/**
19-
* The location of the JavaScript source file. When running from the packager
20-
* this should be an absolute URL, e.g. `http://localhost:8081/index.ios.bundle`.
21-
* When running from a locally bundled JS file, this should be a `file://` url
22-
* pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`.
23-
*/
24-
- (NSURL *__nullable)sourceURLForBridge:(RCTBridge *)bridge
25-
__deprecated_msg("This API will be removed along with the legacy architecture.");
26-
#endif
2716
@end
2817

2918
NS_ASSUME_NONNULL_END

‎packages/rn-tester/RNTester/SceneDelegate.mm‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ - (void)scene:(UIScene *)scene continueUserActivity:(NSUserActivity *)userActivi
8989
[RCTLinkingManager scene:scene continueUserActivity:userActivity];
9090
}
9191

92-
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
93-
{
94-
return [self bundleURL];
95-
}
96-
9792
- (NSURL *)bundleURL
9893
{
9994
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:kBundlePath];

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,6 @@ protocol RCTBackedTextInputViewProtocol : public UITextInput {
25032503
}
25042504

25052505
protocol RCTBridgeDelegate : public NSObject {
2506-
public virtual NSURL* _Nullable sourceURLForBridge:(RCTBridge* bridge);
25072506
}
25082507

25092508
protocol RCTBridgeMethod : public NSObject {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2561,7 +2561,6 @@ protocol RCTBackedTextInputViewProtocol : public UITextInput {
25612561
}
25622562

25632563
protocol RCTBridgeDelegate : public NSObject {
2564-
public virtual NSURL* _Nullable sourceURLForBridge:(RCTBridge* bridge);
25652564
}
25662565

25672566
protocol RCTBridgeMethod : public NSObject {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,6 @@ protocol RCTBackedTextInputViewProtocol : public UITextInput {
25032503
}
25042504

25052505
protocol RCTBridgeDelegate : public NSObject {
2506-
public virtual NSURL* _Nullable sourceURLForBridge:(RCTBridge* bridge);
25072506
}
25082507

25092508
protocol RCTBridgeMethod : public NSObject {

0 commit comments

Comments
 (0)