@@ -13,12 +13,16 @@ - (instancetype)initWithViewRegistry:(RCTViewRegistry *)viewRegistry
1313 moduleRegistry : (RCTModuleRegistry *)moduleRegistry
1414 bundleManager : (RCTBundleManager *)bundleManager
1515 callableJSModules : (RCTCallableJSModules *)callableJSModules
16+ launchOptions : (NSDictionary *)launchOptions
17+ performanceLogger : (RCTPerformanceLogger *)performanceLogger
1618{
1719 if (self = [super init ]) {
1820 _viewRegistry_DEPRECATED = viewRegistry;
1921 _moduleRegistry = moduleRegistry;
2022 _bundleManager = bundleManager;
2123 _callableJSModules = callableJSModules;
24+ _launchOptions = [launchOptions copy ];
25+ _performanceLogger = performanceLogger;
2226 }
2327 return self;
2428}
@@ -68,6 +72,28 @@ - (void)attachInteropAPIsToModule:(id<RCTBridgeModule>)bridgeModule
6872 if ([bridgeModule respondsToSelector: @selector (setModuleRegistry: )]) {
6973 bridgeModule.moduleRegistry = _moduleRegistry;
7074 }
75+
76+ /* *
77+ * Attach the launch options to this TurboModule, which allows this TurboModule
78+ * to read the launch-time configuration of the React instance.
79+ *
80+ * Usage: In the TurboModule @implementation, include:
81+ * `@synthesize launchOptions = _launchOptions`
82+ */
83+ if ([bridgeModule respondsToSelector: @selector (setLaunchOptions: )]) {
84+ bridgeModule.launchOptions = _launchOptions;
85+ }
86+
87+ /* *
88+ * Attach the RCTPerformanceLogger to this TurboModule, which allows this
89+ * TurboModule to read React Native perf events.
90+ *
91+ * Usage: In the TurboModule @implementation, include:
92+ * `@synthesize performanceLogger = _performanceLogger`
93+ */
94+ if ([bridgeModule respondsToSelector: @selector (setPerformanceLogger: )]) {
95+ bridgeModule.performanceLogger = _performanceLogger;
96+ }
7197}
7298
7399@end
0 commit comments