mirror of
https://github.com/react/react-native.git
synced 2026-09-28 13:23:09 +08:00
Remove bridgelessEnabled from RCTRootViewFactoryConfiguration (#58416)
Summary: Pull Request resolved: https://github.com/react/react-native/pull/58416 Follow-up to the Android change in the previous diff, applying the same cleanup to iOS. Bridgeless is the only supported mode, so the `bridgelessEnabled` surface on `RCTRootViewFactoryConfiguration` was already deprecated and hardcoded: the property was assigned `YES` in every initializer, the two deprecated initializers ignored the argument entirely, and `RCTDefaultReactNativeFactoryDelegate` returned `YES` unconditionally. Nothing read the value. Changes: - Removed the `bridgelessEnabled` property from `RCTRootViewFactoryConfiguration`. - Removed the two deprecated initializers `initWithBundleURLBlock:newArchEnabled:turboModuleEnabled:bridgelessEnabled:` and `initWithBundleURL:newArchEnabled:turboModuleEnabled:bridgelessEnabled:`. Both were marked `__deprecated` and discarded all arguments except the bundle URL, delegating to the designated initializer. - Removed the `bridgelessEnabled` method from `RCTDefaultReactNativeFactoryDelegate`. It was not declared in any header or protocol. - Updated the one caller in `RCTReactNativeFactory` to use `initWithBundleURLBlock:newArchEnabled:`. Behavior is unchanged: bridgeless remains unconditionally enabled. Callers of the designated `initWithBundleURLBlock:newArchEnabled:` and `initWithBundleURL:newArchEnabled:` initializers are unaffected. Changelog: [iOS][Breaking] - Remove the deprecated `bridgelessEnabled` property and the deprecated `initWithBundleURLBlock:newArchEnabled:turboModuleEnabled:bridgelessEnabled:` / `initWithBundleURL:newArchEnabled:turboModuleEnabled:bridgelessEnabled:` initializers from `RCTRootViewFactoryConfiguration`; bridgeless is always enabled Reviewed By: rubennorte Differential Revision: D116318829 fbshipit-source-id: 9a8c232f22a9435934f848a7a80401841c2e29a2
This commit is contained in:
committed by
meta-codesync[bot]
parent
0e01003f53
commit
2a9eca81b8
@@ -116,11 +116,6 @@
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)bridgelessEnabled
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (BOOL)fabricEnabled
|
||||
{
|
||||
return YES;
|
||||
|
||||
@@ -289,10 +289,7 @@ static NSDictionary *RCTConvertConnectionOptionsToLaunchOptions(UISceneConnectio
|
||||
};
|
||||
|
||||
RCTRootViewFactoryConfiguration *configuration =
|
||||
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock
|
||||
newArchEnabled:YES
|
||||
turboModuleEnabled:YES
|
||||
bridgelessEnabled:YES];
|
||||
[[RCTRootViewFactoryConfiguration alloc] initWithBundleURLBlock:bundleUrlBlock newArchEnabled:YES];
|
||||
|
||||
configuration.customizeRootView = ^(UIView *_Nonnull rootView) {
|
||||
[weakSelf.delegate customizeRootView:(RCTRootView *)rootView];
|
||||
|
||||
@@ -46,9 +46,6 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
|
||||
/// This property controls whether the App will use the Fabric renderer of the New Architecture or not.
|
||||
@property (nonatomic, assign, readonly) BOOL fabricEnabled;
|
||||
|
||||
/// This property controls whether React Native's new initialization layer is enabled.
|
||||
@property (nonatomic, assign, readonly) BOOL bridgelessEnabled;
|
||||
|
||||
/// This method controls whether the `turboModules` feature of the New Architecture is turned on or off
|
||||
@property (nonatomic, assign, readonly) BOOL turboModuleEnabled;
|
||||
|
||||
@@ -64,16 +61,6 @@ typedef void (^RCTLoadSourceForBridgeBlock)(RCTBridge *bridge, RCTSourceLoadBloc
|
||||
* pointing to a path inside the app resources, e.g. `file://.../main.jsbundle`.
|
||||
*
|
||||
*/
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
newArchEnabled:(BOOL)newArchEnabled NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
|
||||
@@ -42,37 +42,12 @@
|
||||
return [self initWithBundleURLBlock:bundleURLBlock];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURL:(NSURL *)bundleURL
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled
|
||||
{
|
||||
return [self initWithBundleURLBlock:^{
|
||||
return bundleURL;
|
||||
}];
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
newArchEnabled:(BOOL)newArchEnabled
|
||||
turboModuleEnabled:(BOOL)turboModuleEnabled
|
||||
bridgelessEnabled:(BOOL)bridgelessEnabled
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_bundleURLBlock = bundleURLBlock;
|
||||
_fabricEnabled = YES;
|
||||
_turboModuleEnabled = YES;
|
||||
_bridgelessEnabled = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
|
||||
{
|
||||
if (self = [super init]) {
|
||||
_bundleURLBlock = bundleURLBlock;
|
||||
_fabricEnabled = YES;
|
||||
_turboModuleEnabled = YES;
|
||||
_bridgelessEnabled = YES;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@@ -1696,14 +1696,11 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
|
||||
public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge;
|
||||
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
|
||||
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
|
||||
public @property (assign, readonly) BOOL bridgelessEnabled;
|
||||
public @property (assign, readonly) BOOL fabricEnabled;
|
||||
public @property (assign, readonly) BOOL turboModuleEnabled;
|
||||
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(NSURL* bundleURL, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
}
|
||||
|
||||
interface RCTSafeAreaViewComponentView : public RCTViewComponentView {
|
||||
|
||||
@@ -1695,14 +1695,11 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
|
||||
public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge;
|
||||
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
|
||||
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
|
||||
public @property (assign, readonly) BOOL bridgelessEnabled;
|
||||
public @property (assign, readonly) BOOL fabricEnabled;
|
||||
public @property (assign, readonly) BOOL turboModuleEnabled;
|
||||
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(NSURL* bundleURL, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
}
|
||||
|
||||
interface RCTSafeAreaViewComponentView : public RCTViewComponentView {
|
||||
|
||||
@@ -1696,14 +1696,11 @@ interface RCTRootViewFactoryConfiguration : public NSObject {
|
||||
public @property (assign) RCTLoadSourceForBridgeBlock loadSourceForBridge;
|
||||
public @property (assign) RCTLoadSourceForBridgeWithProgressBlock loadSourceForBridgeWithProgress;
|
||||
public @property (assign) RCTSourceURLForBridgeBlock sourceURLForBridge;
|
||||
public @property (assign, readonly) BOOL bridgelessEnabled;
|
||||
public @property (assign, readonly) BOOL fabricEnabled;
|
||||
public @property (assign, readonly) BOOL turboModuleEnabled;
|
||||
public @property (weak) id<RCTJSRuntimeConfiguratorProtocol> jsRuntimeConfiguratorDelegate;
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:(NSURL* bundleURL, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURL:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(NSURL* bundleURL, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled);
|
||||
public virtual instancetype initWithBundleURLBlock:newArchEnabled:turboModuleEnabled:bridgelessEnabled:(RCTBundleURLBlock bundleURLBlock, BOOL newArchEnabled, BOOL turboModuleEnabled, BOOL bridgelessEnabled);
|
||||
}
|
||||
|
||||
interface RCTSafeAreaViewComponentView : public RCTViewComponentView {
|
||||
|
||||
Reference in New Issue
Block a user