1/* 2 * Copyright (c) Meta Platforms, Inc. and affiliates. 3 * 4 * This source code is licensed under the MIT license found in the 5 * LICENSE file in the root directory of this source tree. 6 */ 7 8#import "ABI47_0_0RCTSourceCode.h" 9 10#import <ABI47_0_0FBReactNativeSpec/ABI47_0_0FBReactNativeSpec.h> 11 12#import <ABI47_0_0React/ABI47_0_0RCTBridge.h> 13 14#import "ABI47_0_0CoreModulesPlugins.h" 15 16using namespace ABI47_0_0facebook::ABI47_0_0React; 17 18@interface ABI47_0_0RCTSourceCode () <ABI47_0_0NativeSourceCodeSpec> 19@end 20 21@implementation ABI47_0_0RCTSourceCode 22 23ABI47_0_0RCT_EXPORT_MODULE() 24 25@synthesize bridge = _bridge; 26@synthesize bundleManager = _bundleManager; 27 28+ (BOOL)requiresMainQueueSetup 29{ 30 return NO; 31} 32 33- (NSDictionary<NSString *, id> *)constantsToExport 34{ 35 return [self getConstants]; 36} 37 38- (NSDictionary<NSString *, id> *)getConstants 39{ 40 return @{ 41 @"scriptURL" : self.bundleManager.bundleURL.absoluteString ?: @"", 42 }; 43} 44 45- (std::shared_ptr<TurboModule>)getTurboModule:(const ObjCTurboModule::InitParams &)params 46{ 47 return std::make_shared<NativeSourceCodeSpecJSI>(params); 48} 49 50@end 51 52Class ABI47_0_0RCTSourceCodeCls(void) 53{ 54 return ABI47_0_0RCTSourceCode.class; 55} 56