diff --git a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm index f5d7e554e67..eab9a077b92 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTReactNativeFactory.mm @@ -295,13 +295,6 @@ - (RCTRootViewFactory *)createRCTRootViewFactory [weakSelf.delegate customizeRootView:(RCTRootView *)rootView]; }; - if ([self.delegate respondsToSelector:@selector(extraModulesForBridge:)]) { - configuration.extraModulesForBridge = ^NSArray> *_Nonnull(RCTBridge *_Nonnull bridge) - { - return [weakSelf.delegate extraModulesForBridge:bridge]; - }; - } - configuration.jsRuntimeConfiguratorDelegate = self; return [[RCTRootViewFactory alloc] initWithTurboModuleDelegate:self hostDelegate:self configuration:configuration]; diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h index e7af4bb09b6..0fbabcfdea6 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.h @@ -39,7 +39,6 @@ typedef void (^RCTLoadSourceForBridgeWithProgressBlock)( RCTBridge *bridge, RCTSourceLoadProgressBlock onProgress, RCTSourceLoadBlock loadCallback); -typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBlock loadCallback); #pragma mark - RCTRootViewFactory Configuration @interface RCTRootViewFactoryConfiguration : NSObject @@ -80,7 +79,8 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * * @returns: a UIView properly configured with a bridge for React Native. */ -@property (nonatomic, nullable) RCTCreateRootViewWithBridgeBlock createRootViewWithBridge; +@property (nonatomic, nullable) RCTCreateRootViewWithBridgeBlock createRootViewWithBridge __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * Block that allows to override default behavior of creating bridge. @@ -93,7 +93,8 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * * @returns: a newly created instance of RCTBridge. */ -@property (nonatomic, nullable) RCTCreateBridgeWithDelegateBlock createBridgeWithDelegate; +@property (nonatomic, nullable) RCTCreateBridgeWithDelegateBlock createBridgeWithDelegate __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * Block that allows to customize the rootView that is passed to React Native. @@ -112,7 +113,8 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * When running from a locally bundled JS file, this should be a `file://` url * pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`. */ -@property (nonatomic, nullable) RCTSourceURLForBridgeBlock sourceURLForBridge; +@property (nonatomic, nullable) RCTSourceURLForBridgeBlock sourceURLForBridge __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * The bridge initializes any registered RCTBridgeModules automatically, however @@ -128,12 +130,14 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * not recommended in most cases - if the module methods and behavior do not * match exactly, it may lead to bugs or crashes. */ -@property (nonatomic, nullable) RCTExtraModulesForBridgeBlock extraModulesForBridge; +@property (nonatomic, nullable) RCTExtraModulesForBridgeBlock extraModulesForBridge __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * Retrieve the list of lazy-native-modules names for the given bridge. */ -@property (nonatomic, nullable) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge; +@property (nonatomic, nullable) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * The bridge will call this block when a module has been called from JS @@ -142,20 +146,17 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc * in the implementation, and the system must attempt to look for it again among registered. * If the module was not registered, return NO to prevent further searches. */ -@property (nonatomic, nullable) RCTBridgeDidNotFindModuleBlock bridgeDidNotFindModule; +@property (nonatomic, nullable) RCTBridgeDidNotFindModuleBlock bridgeDidNotFindModule __deprecated_msg( + "This API will be removed along with the legacy architecture."); /** * 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 setting this property. */ -@property (nonatomic, nullable) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress; - -/** - * Similar to loadSourceForBridgeWithProgress but without progress - * reporting. - */ -@property (nonatomic, nullable) RCTLoadSourceForBridgeBlock loadSourceForBridge; +@property (nonatomic, nullable) + RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress __deprecated_msg( + "This API will be removed along with the legacy architecture."); @end diff --git a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm index f6569b69ede..e7190c45e15 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm @@ -229,14 +229,6 @@ - (RCTHost *)createReactHost:(NSDictionary *)launchOptions reinterpret_cast(jsRuntimeFactory), &js_runtime_factory_destroy); } -- (NSArray> *)extraModulesForBridge:(RCTBridge *)bridge -{ - if (_configuration.extraModulesForBridge != nil) { - return _configuration.extraModulesForBridge(bridge); - } - return nil; -} - - (NSURL *)bundleURL { return self->_configuration.bundleURLBlock(); diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index cb68d6c58bd..fc6233330aa 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -1610,7 +1610,6 @@ interface RCTRootViewFactoryConfiguration : public NSObject { public @property (assign) RCTCustomizeRootViewBlock customizeRootView; public @property (assign) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge; public @property (assign) RCTExtraModulesForBridgeBlock extraModulesForBridge; - public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge; public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress; public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge; public @property (weak) id jsRuntimeConfiguratorDelegate; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index b05f7665f7d..c93110ed41d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -1653,7 +1653,6 @@ interface RCTRootViewFactoryConfiguration : public NSObject { public @property (assign) RCTCustomizeRootViewBlock customizeRootView; public @property (assign) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge; public @property (assign) RCTExtraModulesForBridgeBlock extraModulesForBridge; - public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge; public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress; public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge; public @property (weak) id jsRuntimeConfiguratorDelegate; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index 497a3a43a3e..52e6b28a55a 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -1609,7 +1609,6 @@ interface RCTRootViewFactoryConfiguration : public NSObject { public @property (assign) RCTCustomizeRootViewBlock customizeRootView; public @property (assign) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge; public @property (assign) RCTExtraModulesForBridgeBlock extraModulesForBridge; - public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge; public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress; public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge; public @property (weak) id jsRuntimeConfiguratorDelegate; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 4f7774be13c..fcbf60c6a52 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -1610,7 +1610,6 @@ interface RCTRootViewFactoryConfiguration : public NSObject { public @property (assign) RCTCustomizeRootViewBlock customizeRootView; public @property (assign) RCTExtraLazyModuleClassesForBridge extraLazyModuleClassesForBridge; public @property (assign) RCTExtraModulesForBridgeBlock extraModulesForBridge; - public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge; public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress; public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge; public @property (weak) id jsRuntimeConfiguratorDelegate;