diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index f5e39bda6b1b19..2c56734cbf4264 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -291,22 +291,6 @@ - (RCTRootViewFactory *)createRCTRootViewFactory }; } - if ([self respondsToSelector:@selector(loadSourceForBridge:withBlock:)]) { - configuration.loadSourceForBridgeBlock = - ^void(RCTBridge *_Nonnull bridge, RCTSourceLoadBlock _Nonnull loadCallback) { - [weakSelf loadSourceForBridge:bridge withBlock:loadCallback]; - }; - } - - if ([self respondsToSelector:@selector(loadSourceForBridge:onProgress:onComplete:)]) { - configuration.loadSourceForBridgeProgressBlock = - ^(RCTBridge *_Nonnull bridge, - RCTSourceLoadProgressBlock _Nonnull onProgress, - RCTSourceLoadBlock _Nonnull loadCallback) { - [weakSelf loadSourceForBridge:bridge onProgress:onProgress onComplete:loadCallback]; - }; - } - return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self]; } diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h index d642ab2b8978ed..85c99421287184 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h @@ -27,11 +27,6 @@ typedef NSURL *_Nullable (^RCTSourceURLForBridgeBlock)(RCTBridge *bridge); typedef NSArray> *_Nonnull (^RCTExtraModulesForBridgeBlock)(RCTBridge *bridge); typedef NSDictionary *_Nonnull (^RCTExtraLazyModuleClassesForBridge)(RCTBridge *bridge); typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *moduleName); -typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBlock loadCallback); -typedef void (^RCTLoadSourceForBridgeProgressBlock)( - RCTBridge *bridge, - RCTSourceLoadProgressBlock onProgress, - RCTSourceLoadBlock loadCallback); #pragma mark - RCTRootViewFactory Configuration @interface RCTRootViewFactoryConfiguration : NSObject @@ -89,6 +84,9 @@ typedef void (^RCTLoadSourceForBridgeProgressBlock)( * @returns: a newly created instance of RCTBridge. */ @property (nonatomic, nullable) RCTCreateBridgeWithDelegateBlock createBridgeWithDelegate; + +#pragma mark - RCTBridgeDelegate blocks + /** * Block that returns the location of the JavaScript source file. When running from the packager * this should be an absolute URL, e.g. `http://localhost:8081/index.ios.bundle`. @@ -127,19 +125,6 @@ typedef void (^RCTLoadSourceForBridgeProgressBlock)( */ @property (nonatomic, nullable) RCTBridgeDidNotFindModuleBlock bridgeDidNotFindModule; -/** - * The bridge will automatically attempt to load the JS source code from the - * location specified by the `sourceURLForBridge:` method, however, if you want - * to handle loading the JS yourself, you can do so by implementing this method. - */ -@property (nonatomic, nullable) RCTLoadSourceForBridgeProgressBlock loadSourceForBridgeProgressBlock; - -/** - * Similar to loadSourceForBridge:onProgress:onComplete: but without progress - * reporting. - */ -@property (nonatomic, nullable) RCTLoadSourceForBridgeBlock loadSourceForBridgeBlock; - @end #pragma mark - RCTRootViewFactory diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index cede47e1761d91..30aa86f91c0ba3 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -273,22 +273,6 @@ - (BOOL)bridge:(RCTBridge *)bridge didNotFindModule:(NSString *)moduleName return NO; } -- (void)loadSourceForBridge:(RCTBridge *)bridge withBlock:(RCTSourceLoadBlock)loadCallback -{ - if (_configuration.loadSourceForBridgeBlock != nil) { - _configuration.loadSourceForBridgeBlock(bridge, loadCallback); - } -} - -- (void)loadSourceForBridge:(RCTBridge *)bridge - onProgress:(RCTSourceLoadProgressBlock)onProgress - onComplete:(RCTSourceLoadBlock)loadCallback -{ - if (_configuration.loadSourceForBridgeProgressBlock != nil) { - _configuration.loadSourceForBridgeProgressBlock(bridge, onProgress, loadCallback); - } -} - - (NSURL *)bundleURL { return self->_configuration.bundleURL;