Skip to content

Commit fdbfc4a

Browse files
Add BUCK configuration for RNTester-iOS for NEW Arch (#39825)
Summary: Pull Request resolved: #39825 Changelog: [Internal] Reviewed By: fkgozali Differential Revision: D49834561 fbshipit-source-id: 1721e9f7954b40b620f6c2005fe6924589bfa245
1 parent e1d824f commit fdbfc4a

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm

+8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
#import "RCTLegacyInteropComponents.h"
1515

1616
#if RCT_NEW_ARCH_ENABLED
17+
#if RN_DISABLE_OSS_PLUGIN_HEADER
18+
#import <RCTTurboModulePlugin/RCTTurboModulePlugin.h>
19+
#else
1720
#import <React/CoreModulesPlugins.h>
21+
#endif
1822
#import <React/RCTBundleURLProvider.h>
1923
#import <React/RCTComponentViewFactory.h>
2024
#import <React/RCTComponentViewProtocol.h>
@@ -219,7 +223,11 @@ - (void)windowScene:(UIWindowScene *)windowScene
219223

220224
- (Class)getModuleClassFromName:(const char *)name
221225
{
226+
#if RN_DISABLE_OSS_PLUGIN_HEADER
227+
return RCTTurboModulePluginClassProvider(name);
228+
#else
222229
return RCTCoreModulesClassProvider(name);
230+
#endif
223231
}
224232

225233
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name

packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@
1414
#import <memory>
1515

1616
#ifndef RCT_USE_HERMES
17-
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
17+
#if __has_include(<jsireact/HermesExecutorFactory.h>)
18+
#import <jsireact/HermesExecutorFactory.h>
1819
#define RCT_USE_HERMES 1
19-
#else
20-
#define RCT_USE_HERMES 0
21-
#endif
22-
#endif
23-
24-
#if RCT_USE_HERMES
20+
#elif __has_include(<reacthermes/HermesExecutorFactory.h>)
2521
#import <reacthermes/HermesExecutorFactory.h>
22+
#define RCT_USE_HERMES 1
2623
#else
2724
#import <React/JSCExecutorFactory.h>
25+
#define RCT_USE_HERMES 0
26+
#endif
2827
#endif
2928

3029
#if RCT_NEW_ARCH_ENABLED

packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.mm

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
#if RCT_NEW_ARCH_ENABLED
1515
// Turbo Module
16-
#import <React/CoreModulesPlugins.h>
1716
#import <React/RCTBundleAssetImageLoader.h>
1817
#import <React/RCTDataRequestHandler.h>
1918
#import <React/RCTFileRequestHandler.h>

packages/rn-tester/RNTester/AppDelegate.mm

+4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@
1818

1919
#if RCT_NEW_ARCH_ENABLED
2020
#import <NativeCxxModuleExample/NativeCxxModuleExample.h>
21+
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
2122
#import <RNTMyNativeViewComponentView.h>
2223
#endif
24+
#endif
2325

2426
#if BUNDLE_PATH
2527
NSString *kBundlePath = @"xplat/js/RKJSModules/EntryPoints/RNTesterTestBundle.js";
@@ -125,10 +127,12 @@ - (void)application:(__unused UIApplication *)application
125127
#pragma mark - RCTComponentViewFactoryComponentProvider
126128

127129
#if RCT_NEW_ARCH_ENABLED
130+
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
128131
- (nonnull NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
129132
{
130133
return @{@"RNTMyNativeView" : RNTMyNativeViewComponentView.class};
131134
}
135+
#endif
132136

133137
- (NSURL *)getBundleURL
134138
{

0 commit comments

Comments
 (0)