Skip to content

Commit

Permalink
feat: deprecate passing separate new arch flags to RCTRootViewFactory (
Browse files Browse the repository at this point in the history
…#46652)

Summary:
This PR follows up with the deprecation introduced here: #46228

The idea is to have new architecture depend on one flag, namely `newArchEnabled`. It exposes additional initializers for RCTRootViewFactory.

## Changelog:

[IOS] [CHANGED] - Use `newArchEnabled` flag in RCTAppDelegate and RCTRootViewFactory

Pull Request resolved: #46652

Test Plan: CI Green

Reviewed By: javache

Differential Revision: D64173015

Pulled By: cipolleschi

fbshipit-source-id: 49474baf5415a2527e481a5d68ec94ae874185e6
  • Loading branch information
okwasniewski authored and facebook-github-bot committed Oct 10, 2024
1 parent 865f302 commit 7e1674f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,17 @@ typedef BOOL (^RCTBridgeDidNotFindModuleBlock)(RCTBridge *bridge, NSString *modu
- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock
newArchEnabled:(BOOL)newArchEnabled
turboModuleEnabled:(BOOL)turboModuleEnabled
bridgelessEnabled:(BOOL)bridgelessEnabled NS_DESIGNATED_INITIALIZER;
bridgelessEnabled:(BOOL)bridgelessEnabled NS_DESIGNATED_INITIALIZER __deprecated;

- (instancetype)initWithBundleURL:(NSURL *)bundleURL
newArchEnabled:(BOOL)newArchEnabled
turboModuleEnabled:(BOOL)turboModuleEnabled
bridgelessEnabled:(BOOL)bridgelessEnabled __deprecated;

- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock newArchEnabled:(BOOL)newArchEnabled;

- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled;

/**
* Block that allows to override logic of creating root view instance.
* It creates a `UIView` starting from a bridge, a module name and a set of initial properties.
Expand Down
16 changes: 16 additions & 0 deletions packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@

@implementation RCTRootViewFactoryConfiguration

- (instancetype)initWithBundleURL:(NSURL *)bundleURL newArchEnabled:(BOOL)newArchEnabled
{
return [self initWithBundleURL:bundleURL
newArchEnabled:newArchEnabled
turboModuleEnabled:newArchEnabled
bridgelessEnabled:newArchEnabled];
}

- (instancetype)initWithBundleURLBlock:(RCTBundleURLBlock)bundleURLBlock newArchEnabled:(BOOL)newArchEnabled
{
return [self initWithBundleURLBlock:bundleURLBlock
newArchEnabled:newArchEnabled
turboModuleEnabled:newArchEnabled
bridgelessEnabled:newArchEnabled];
}

- (instancetype)initWithBundleURL:(NSURL *)bundleURL
newArchEnabled:(BOOL)newArchEnabled
turboModuleEnabled:(BOOL)turboModuleEnabled
Expand Down

0 comments on commit 7e1674f

Please sign in to comment.