File tree Expand file tree Collapse file tree 3 files changed +3
-22
lines changed
ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon
ReactCommon/turbomodule/core/platform/ios Expand file tree Collapse file tree 3 files changed +3
-22
lines changed Original file line number Diff line number Diff line change @@ -56,30 +56,20 @@ void TurboModuleManager::installJSIBindings() {
5656 }
5757 TurboModuleBinding::install (*runtime_, std::make_shared<TurboModuleBinding>(
5858 [this ](const std::string &name) -> std::shared_ptr<TurboModule> {
59- auto turboModuleLookup = turboModuleCache_.find (name);
60- if (turboModuleLookup != turboModuleCache_.end ()) {
61- return turboModuleLookup->second ;
62- }
63-
6459 auto cxxModule = turboModuleManagerDelegate_->cthis ()->getTurboModule (name, jsCallInvoker_);
6560 if (cxxModule) {
66- turboModuleCache_.insert ({name, cxxModule});
6761 return cxxModule;
6862 }
6963
7064 auto legacyCxxModule = getLegacyCxxJavaModule (name);
7165 if (legacyCxxModule) {
72- auto turboModule = std::make_shared<react::TurboCxxModule>(legacyCxxModule->cthis ()->getModule (), jsCallInvoker_);
73- turboModuleCache_.insert ({name, turboModule});
74- return turboModule;
66+ return std::make_shared<react::TurboCxxModule>(legacyCxxModule->cthis ()->getModule (), jsCallInvoker_);
7567 }
7668
7769 auto moduleInstance = getJavaModule (name);
7870
7971 if (moduleInstance) {
80- auto turboModule = turboModuleManagerDelegate_->cthis ()->getTurboModule (name, moduleInstance, jsCallInvoker_);
81- turboModuleCache_.insert ({name, turboModule});
82- return turboModule;
72+ return turboModuleManagerDelegate_->cthis ()->getTurboModule (name, moduleInstance, jsCallInvoker_);
8373 }
8474
8575 return std::shared_ptr<TurboModule>(nullptr );
Original file line number Diff line number Diff line change 88#pragma once
99
1010#include < memory>
11- #include < unordered_map>
1211#include < fb/fbjni.h>
1312#include < jsi/jsi.h>
1413#include < ReactCommon/TurboModule.h>
@@ -38,14 +37,6 @@ class TurboModuleManager : public jni::HybridClass<TurboModuleManager> {
3837 std::shared_ptr<JSCallInvoker> jsCallInvoker_;
3938 jni::global_ref<TurboModuleManagerDelegate::javaobject> turboModuleManagerDelegate_;
4039
41- /* *
42- * TODO(T48018690):
43- * All modules are currently long-lived.
44- * We need to come up with a mechanism to allow modules to specify whether
45- * they want to be long-lived or short-lived.
46- */
47- std::unordered_map<std::string, std::shared_ptr<react::TurboModule>> turboModuleCache_;
48-
4940 jni::global_ref<JTurboModule> getJavaModule (std::string name);
5041 jni::global_ref<CxxModuleWrapper::javaobject> getLegacyCxxJavaModule (std::string name);
5142 void installJSIBindings ();
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ @implementation RCTTurboModuleManager {
4040 __weak id <RCTTurboModuleManagerDelegate> _delegate;
4141 __weak RCTBridge *_bridge;
4242 /* *
43- * TODO(T48018690 ):
43+ * TODO(rsnara ):
4444 * All modules are currently long-lived.
4545 * We need to come up with a mechanism to allow modules to specify whether
4646 * they want to be long-lived or short-lived.
You can’t perform that action at this time.
0 commit comments