Skip to content

Commit

Permalink
Add BUCK configuration for RNTester-iOS for NEW Arch (facebook#39825)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#39825

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D49834561

fbshipit-source-id: 1721e9f7954b40b620f6c2005fe6924589bfa245
  • Loading branch information
christophpurrer authored and facebook-github-bot committed Oct 5, 2023
1 parent e1d824f commit fdbfc4a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 8 additions & 0 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
#import "RCTLegacyInteropComponents.h"

#if RCT_NEW_ARCH_ENABLED
#if RN_DISABLE_OSS_PLUGIN_HEADER
#import <RCTTurboModulePlugin/RCTTurboModulePlugin.h>
#else
#import <React/CoreModulesPlugins.h>
#endif
#import <React/RCTBundleURLProvider.h>
#import <React/RCTComponentViewFactory.h>
#import <React/RCTComponentViewProtocol.h>
Expand Down Expand Up @@ -219,7 +223,11 @@ - (void)windowScene:(UIWindowScene *)windowScene

- (Class)getModuleClassFromName:(const char *)name
{
#if RN_DISABLE_OSS_PLUGIN_HEADER
return RCTTurboModulePluginClassProvider(name);
#else
return RCTCoreModulesClassProvider(name);
#endif
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:(const std::string &)name
Expand Down
13 changes: 6 additions & 7 deletions packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
#import <memory>

#ifndef RCT_USE_HERMES
#if __has_include(<reacthermes/HermesExecutorFactory.h>)
#if __has_include(<jsireact/HermesExecutorFactory.h>)
#import <jsireact/HermesExecutorFactory.h>
#define RCT_USE_HERMES 1
#else
#define RCT_USE_HERMES 0
#endif
#endif

#if RCT_USE_HERMES
#elif __has_include(<reacthermes/HermesExecutorFactory.h>)
#import <reacthermes/HermesExecutorFactory.h>
#define RCT_USE_HERMES 1
#else
#import <React/JSCExecutorFactory.h>
#define RCT_USE_HERMES 0
#endif
#endif

#if RCT_NEW_ARCH_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

#if RCT_NEW_ARCH_ENABLED
// Turbo Module
#import <React/CoreModulesPlugins.h>
#import <React/RCTBundleAssetImageLoader.h>
#import <React/RCTDataRequestHandler.h>
#import <React/RCTFileRequestHandler.h>
Expand Down
4 changes: 4 additions & 0 deletions packages/rn-tester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@

#if RCT_NEW_ARCH_ENABLED
#import <NativeCxxModuleExample/NativeCxxModuleExample.h>
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
#import <RNTMyNativeViewComponentView.h>
#endif
#endif

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

#if RCT_NEW_ARCH_ENABLED
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
- (nonnull NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
{
return @{@"RNTMyNativeView" : RNTMyNativeViewComponentView.class};
}
#endif

- (NSURL *)getBundleURL
{
Expand Down

0 comments on commit fdbfc4a

Please sign in to comment.