Skip to content

Commit

Permalink
TM iOS: deprecate RN_TURBO_MODULE_ENABLED compiler flag
Browse files Browse the repository at this point in the history
Summary:
It was added due to missing TM support in .xcodeproj, but since .xcodeproj has been deprecated, we don't need this flag anymore.

Relevant efforts:
#25619
#25393

Reviewed By: hramos

Differential Revision: D16231698

fbshipit-source-id: b3276d1fc64394624e5110f2ecd31acc2bb2d240
  • Loading branch information
fkgozali authored and facebook-github-bot committed Jul 13, 2019
1 parent 6e7ce9c commit 394c9a5
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 52 deletions.
17 changes: 0 additions & 17 deletions RNTester/RNTester/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -27,36 +27,25 @@
#import <React/RCTFabricSurfaceHostingProxyRootView.h>
#endif

#ifdef RN_TURBO_MODULE_ENABLED
#import <ReactCommon/RCTTurboModuleManager.h>

#import "RNTesterTurboModuleProvider.h"
#endif

#ifdef RN_TURBO_MODULE_ENABLED
@interface AppDelegate() <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate>{
#else
@interface AppDelegate() <RCTCxxBridgeDelegate>{
#endif

#ifdef RN_FABRIC_ENABLED
RCTSurfacePresenter *_surfacePresenter;
#endif

#ifdef RN_TURBO_MODULE_ENABLED
RCTTurboModuleManager *_turboModuleManager;
#endif

}
@end

@implementation AppDelegate

- (BOOL)application:(__unused UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#ifdef RN_TURBO_MODULE_ENABLED
RCTEnableTurboModule(YES);
#endif

_bridge = [[RCTBridge alloc] initWithDelegate:self
launchOptions:launchOptions];
Expand Down Expand Up @@ -120,18 +109,14 @@ - (void)loadSourceForBridge:(RCTBridge *)bridge
}
__typeof(self) strongSelf = weakSelf;
if (strongSelf) {
#ifdef RN_TURBO_MODULE_ENABLED
strongSelf->_turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:strongSelf];
[strongSelf->_turboModuleManager installJSBindingWithRuntime:&runtime];
#endif
}
});
}

#pragma mark RCTTurboModuleManagerDelegate

#ifdef RN_TURBO_MODULE_ENABLED

- (Class)getModuleClassFromName:(const char *)name
{
return facebook::react::RNTesterTurboModuleClassProvider(name);
Expand All @@ -156,8 +141,6 @@ - (Class)getModuleClassFromName:(const char *)name
return [moduleClass new];
}

#endif

# pragma mark - Push Notifications

#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
Expand Down
4 changes: 0 additions & 4 deletions RNTester/RNTester/RNTesterTurboModuleProvider.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*
*/

#ifdef RN_TURBO_MODULE_ENABLED

#import <ReactCommon/RCTTurboModule.h>

namespace facebook {
Expand All @@ -32,5 +30,3 @@ std::shared_ptr<TurboModule> RNTesterTurboModuleProvider(const std::string &name

} // namespace react
} // namespace facebook

#endif
4 changes: 0 additions & 4 deletions RNTester/RNTester/RNTesterTurboModuleProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
*
*/

#ifdef RN_TURBO_MODULE_ENABLED

#import "RNTesterTurboModuleProvider.h"

#import <React/CoreModulesPlugins.h>
Expand Down Expand Up @@ -43,5 +41,3 @@ Class RNTesterTurboModuleClassProvider(const char *name) {

} // namespace react
} // namespace facebook

#endif
1 change: 0 additions & 1 deletion ReactCommon/turbomodule/samples/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ rn_xplat_cxx_library(
platforms = (ANDROID, APPLE),
preprocessor_flags = [
"-DLOG_TAG=\"ReactNative\"",
"-DRN_TURBO_MODULE_ENABLED",
"-DWITH_FBSYSTRACE=1",
],
visibility = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,12 @@

#import <React/RCTBridgeModule.h>

#ifdef RN_TURBO_MODULE_ENABLED
#import <ReactCommon/RCTTurboModule.h>
#endif

/**
* The ObjC protocol based on the JS Flow type for SampleTurboModule.
*/
@protocol NativeSampleTurboModuleSpec <
RCTBridgeModule
#ifdef RN_TURBO_MODULE_ENABLED
,
RCTTurboModule
#endif
>
@protocol NativeSampleTurboModuleSpec <RCTBridgeModule, RCTTurboModule>

- (void)voidFunc;
- (NSNumber *)getBool:(BOOL)arg;
Expand All @@ -46,8 +38,6 @@

@end

#ifdef RN_TURBO_MODULE_ENABLED

namespace facebook {
namespace react {

Expand All @@ -61,5 +51,3 @@ class JSI_EXPORT NativeSampleTurboModuleSpecJSI : public ObjCTurboModule {

} // namespace react
} // namespace facebook

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
* LICENSE file in the root directory of this source tree.
*/

#ifdef RN_TURBO_MODULE_ENABLED

#import "RCTNativeSampleTurboModuleSpec.h"

namespace facebook {
Expand Down Expand Up @@ -79,5 +77,3 @@

} // namespace react
} // namespace facebook

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,15 @@

#import <UIKit/UIKit.h>

#ifdef RN_TURBO_MODULE_ENABLED
using namespace facebook::react;
#endif

@implementation RCTSampleTurboModule

// Backward-compatible export
RCT_EXPORT_MODULE()

@synthesize bridge = _bridge;

#ifdef RN_TURBO_MODULE_ENABLED
@synthesize turboModuleLookupDelegate = _turboModuleLookupDelegate;
#endif

// Backward-compatible queue configuration
+ (BOOL)requiresMainQueueSetup
Expand All @@ -35,15 +30,11 @@ - (dispatch_queue_t)methodQueue
return dispatch_get_main_queue();
}

#ifdef RN_TURBO_MODULE_ENABLED

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModuleWithJsInvoker:(std::shared_ptr<facebook::react::JSCallInvoker>)jsInvoker
{
return std::make_shared<NativeSampleTurboModuleSpecJSI>(self, jsInvoker);
}

#endif

// Backward compatible invalidation
- (void)invalidate
{
Expand Down

0 comments on commit 394c9a5

Please sign in to comment.