From d31ffe6bbdcc9982fc687595575338b80a1b64bb Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Sun, 17 Nov 2024 11:00:44 -0800 Subject: [PATCH] Add `RCTDependencyProvider` protocol Summary: React Native has a last temporal dependency on Codegen in the React-RCTAppDelegate pod. The RCTAppDelegate has the responsibility to provide various dependencies to react native, like third party components and various modules. ReactCodegen is generated when the user create the project, while React-RCTAppDelegate eists in React Native itself. This dependency means that we cannot prepare prebuilt for iOS for React Native because when we would have to create prebuilds, we would need the React Codegen, but we can't create a React codegen package that will fit all the apps, because React Codegen can contains App Specific modules and components and apps might have different dependencies. This change introduces the RCTDependencyProvider protocol to invert this dependency. ## Changelog: [iOS][Added] - Add RCTDependencyProvider protocol Differential Revision: D66074409 --- .../AppDelegate/RCTDependencyProvider.h | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 packages/react-native/Libraries/AppDelegate/RCTDependencyProvider.h diff --git a/packages/react-native/Libraries/AppDelegate/RCTDependencyProvider.h b/packages/react-native/Libraries/AppDelegate/RCTDependencyProvider.h new file mode 100644 index 00000000000000..32b8415e7e4b21 --- /dev/null +++ b/packages/react-native/Libraries/AppDelegate/RCTDependencyProvider.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +#import + +@protocol RCTComponentViewProtocol; + +NS_ASSUME_NONNULL_BEGIN + +@protocol RCTDependencyProvider + +- (NSArray *)imageURLLoaderClassNames; + +- (NSArray *)imageDataDecoderClassNames; + +- (NSArray *)URLRequestHandlerClassNames; + +- (NSDictionary> *)thirdPartyFabricComponents; + +@end + +NS_ASSUME_NONNULL_END