mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
feat: introduce RCTArchConfiguratorProtocol (#47306)
Summary: This PR introduces `RCTArchConfiguratorProtocol` for better separation of concerns inside of RCTAppDelegate. It's also a prerequisite for https://github.com/facebook/react-native/issues/46298 Discussed with cipolleschi ## Changelog: [IOS] [ADDED] - introduce RCTArchConfiguratorProtocol Pull Request resolved: https://github.com/facebook/react-native/pull/47306 Test Plan: - CI Green - Test if methods can be overriden Reviewed By: realsoelynn Differential Revision: D65212703 Pulled By: cipolleschi fbshipit-source-id: 9850fec31c421f0c6230e7e23d7a208d823d828f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
50e38cc9f1
commit
ec0dbb729d
@@ -8,6 +8,7 @@
|
||||
#import <React/RCTBridgeDelegate.h>
|
||||
#import <React/RCTConvert.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "RCTArchConfiguratorProtocol.h"
|
||||
#import "RCTRootViewFactory.h"
|
||||
#import "RCTUIConfiguratorProtocol.h"
|
||||
|
||||
@@ -56,8 +57,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
(const facebook::react::ObjCTurboModule::InitParams &)params
|
||||
* - (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
|
||||
*/
|
||||
@interface RCTAppDelegate
|
||||
: UIResponder <UIApplicationDelegate, UISceneDelegate, RCTBridgeDelegate, RCTUIConfiguratorProtocol>
|
||||
@interface RCTAppDelegate : UIResponder <
|
||||
UIApplicationDelegate,
|
||||
UISceneDelegate,
|
||||
RCTBridgeDelegate,
|
||||
RCTUIConfiguratorProtocol,
|
||||
RCTArchConfiguratorProtocol>
|
||||
|
||||
/// The window object, used to render the UViewControllers
|
||||
@property (nonatomic, strong, nonnull) UIWindow *window;
|
||||
@@ -107,27 +112,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/// @return a dictionary that associate a component for the new renderer with his descriptor.
|
||||
- (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents;
|
||||
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
|
||||
///
|
||||
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
|
||||
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
///
|
||||
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native's new initialization layer is enabled.
|
||||
///
|
||||
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native uses new Architecture.
|
||||
///
|
||||
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
|
||||
- (BOOL)newArchEnabled;
|
||||
|
||||
/// Return the bundle URL for the main bundle.
|
||||
- (NSURL *__nullable)bundleURL;
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 <React/RCTConvert.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@protocol RCTArchConfiguratorProtocol
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off.
|
||||
///
|
||||
/// @note: This is required to be rendering on Fabric (i.e. on the New Architecture).
|
||||
/// @return: `true` if the Turbo Native Module are enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)turboModuleEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
///
|
||||
/// @return: `true` if the Fabric Renderer is enabled. Otherwise, it returns `false`.
|
||||
- (BOOL)fabricEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native's new initialization layer is enabled.
|
||||
///
|
||||
/// @return: `true` if the new initialization layer is enabled. Otherwise returns `false`.
|
||||
- (BOOL)bridgelessEnabled __attribute__((deprecated("Use newArchEnabled instead")));
|
||||
|
||||
/// This method controls whether React Native uses new Architecture.
|
||||
///
|
||||
/// @return: `true` if the new architecture is enabled. Otherwise returns `false`.
|
||||
- (BOOL)newArchEnabled;
|
||||
@end
|
||||
Reference in New Issue
Block a user