Skip to content

Commit 7ec9af0

Browse files
RSNarafacebook-github-bot
authored andcommitted
Temporarily add logs in TM initialization
Summary: Marketplace eagerly initializes a few NativeModules. These NativeModules are TurboModule compatible, and the device/user is in the TurboModule test. So these NativeModuels should be returned from the TurboModule system. However, for some reason, we end up doing a lookup on the `NativeModuleRegistry` for these NativeModules. This means that either: 1. The TurboModuleManager isn't attached to the CatalystInstance 2. The TurboModuleManager returned null from getModule. These logs will help us get to the bottom of what's going on. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D20260150 fbshipit-source-id: bb554ead412ad3b0fa7502b77f575365608ebc98
1 parent 3a9fc7c commit 7ec9af0

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,14 +1239,33 @@ private ReactApplicationContext createReactContext(
12391239

12401240
reactContext.initializeWithInstance(catalystInstance);
12411241

1242+
// TODO(T46487253): Remove after task is closed
1243+
FLog.e(
1244+
ReactConstants.TAG,
1245+
"ReactInstanceManager.createReactContext: mJSIModulePackage "
1246+
+ (mJSIModulePackage != null ? "not null" : "null"));
1247+
12421248
if (mJSIModulePackage != null) {
12431249
catalystInstance.addJSIModules(
12441250
mJSIModulePackage.getJSIModules(
12451251
reactContext, catalystInstance.getJavaScriptContextHolder()));
12461252

1253+
// TODO(T46487253): Remove after task is closed
1254+
FLog.e(
1255+
ReactConstants.TAG,
1256+
"ReactInstanceManager.createReactContext: ReactFeatureFlags.useTurboModules == "
1257+
+ (ReactFeatureFlags.useTurboModules == false ? "false" : "true"));
1258+
12471259
if (ReactFeatureFlags.useTurboModules) {
12481260
JSIModule turboModuleManager =
12491261
catalystInstance.getJSIModule(JSIModuleType.TurboModuleManager);
1262+
1263+
// TODO(T46487253): Remove after task is closed
1264+
FLog.e(
1265+
ReactConstants.TAG,
1266+
"ReactInstanceManager.createReactContext: TurboModuleManager "
1267+
+ (turboModuleManager == null ? "not created" : "created"));
1268+
12501269
catalystInstance.setTurboModuleManager(turboModuleManager);
12511270

12521271
TurboModuleRegistry registry = (TurboModuleRegistry) turboModuleManager;

ReactAndroid/src/main/java/com/facebook/react/bridge/CatalystInstanceImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ public NativeModule getNativeModule(String moduleName) {
581581
if (getTurboModuleRegistry() != null) {
582582
TurboModule turboModule = getTurboModuleRegistry().getModule(moduleName);
583583

584+
// TODO(T46487253): Remove after task is closed
585+
FLog.e(
586+
ReactConstants.TAG,
587+
"CatalystInstanceImpl.getNativeModule: TurboModule "
588+
+ moduleName
589+
+ (turboModule == null ? " not" : "")
590+
+ " found");
584591
if (turboModule != null) {
585592
return (NativeModule) turboModule;
586593
}

0 commit comments

Comments
 (0)