Stop forwarding TurboModule schema to TurboModule HostObjects

Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D25915170

fbshipit-source-id: 2b390428c1f582e55cf3ffe8e691f069bf2fd295
This commit is contained in:
Ramanpreet Nara
2021-01-14 19:14:23 -08:00
committed by Facebook GitHub Bot
parent 1f017617ac
commit 8ed6659907
5 changed files with 9 additions and 26 deletions
@@ -14,7 +14,6 @@
#include <ReactCommon/TurboCxxModule.h>
#include <ReactCommon/TurboModuleBinding.h>
#include <ReactCommon/TurboModulePerfLogger.h>
#include <ReactCommon/TurboModuleSchema.h>
#include <react/jni/JMessageQueueThread.h>
#include "TurboModuleManager.h"
@@ -75,10 +74,8 @@ void TurboModuleManager::installJSIBindings() {
jsCallInvoker_ = std::weak_ptr<CallInvoker>(jsCallInvoker_),
nativeCallInvoker_ = std::weak_ptr<CallInvoker>(nativeCallInvoker_),
delegate_ = jni::make_weak(delegate_),
javaPart_ = jni::make_weak(javaPart_),
&runtime](
const std::string &name,
const jsi::Value *schema) -> std::shared_ptr<TurboModule> {
javaPart_ = jni::make_weak(javaPart_)](
const std::string &name) -> std::shared_ptr<TurboModule> {
auto turboModuleCache = turboModuleCache_.lock();
auto jsCallInvoker = jsCallInvoker_.lock();
auto nativeCallInvoker = nativeCallInvoker_.lock();
@@ -140,13 +137,6 @@ void TurboModuleManager::installJSIBindings() {
.jsInvoker = jsCallInvoker,
.nativeInvoker = nativeCallInvoker};
if (schema->isObject() && !schema->isNull()) {
auto turboModule = std::make_shared<JavaTurboModule>(
params, TurboModuleSchema::parse(runtime, name, *schema));
TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName);
return turboModule;
}
auto turboModule = delegate->cthis()->getTurboModule(name, params);
turboModuleCache->insert({name, turboModule});
TurboModulePerfLogger::moduleJSRequireEndingEnd(moduleName);