Skip to content

Commit 16e6655

Browse files
author
Mariusz Pasinski
committed
feat: add stub methods for interacting with require cache
1 parent 4cd2cae commit 16e6655

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,19 @@ bool CxxNodeApiHostModule::initializeNodeModule(jsi::Runtime &rt,
308308
return true;
309309
}
310310

311+
std::pair<jsi::Value, bool>
312+
CxxNodeApiHostModule::lookupRequireCache(::jsi::Runtime &rt,
313+
const std::string_view &packageName,
314+
const std::string_view &subpath) {
315+
// TODO: Implement me
316+
return std::make_pair(jsi::Value(), false);
317+
}
318+
319+
void CxxNodeApiHostModule::updateRequireCache(jsi::Runtime &rt,
320+
const std::string_view &packageName,
321+
const std::string_view &subpath,
322+
jsi::Value &value) {
323+
// TODO: Implement me
324+
}
325+
311326
} // namespace callstack::nodeapihost

packages/react-native-node-api-modules/cpp/CxxNodeApiHostModule.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ class JSI_EXPORT CxxNodeApiHostModule : public facebook::react::TurboModule {
4040
const std::string_view &requiredPackageName,
4141
const std::string_view &requiredFrom);
4242

43+
std::pair<facebook::jsi::Value, bool>
44+
lookupRequireCache(facebook::jsi::Runtime &rt,
45+
const std::string_view &packageName,
46+
const std::string_view &subpath);
47+
void updateRequireCache(facebook::jsi::Runtime &rt,
48+
const std::string_view &packageName,
49+
const std::string_view &subpath,
50+
facebook::jsi::Value &value);
51+
4352
protected:
4453
struct NodeAddon {
4554
void *moduleHandle;

0 commit comments

Comments
 (0)