Skip to content

Commit

Permalink
pass down sync void config to jsi module
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal]

actually pass down the config value -_-

Reviewed By: christophpurrer

Differential Revision: D51279435
  • Loading branch information
philIip authored and facebook-github-bot committed Nov 13, 2023
1 parent ad0f064 commit ffe9837
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ TurboModuleProviderFunctionType TurboModuleManager::createTurboModuleProvider(
nativeMethodCallInvoker_ =
std::weak_ptr<NativeMethodCallInvoker>(nativeMethodCallInvoker_),
delegate_ = jni::make_weak(delegate_),
javaPart_ = jni::make_weak(javaPart_)](
javaPart_ = jni::make_weak(javaPart_),
enableSyncVoidMethods](
const std::string& name) -> std::shared_ptr<TurboModule> {
auto turboModuleCache = turboModuleCache_.lock();
auto jsCallInvoker = jsCallInvoker_.lock();
Expand Down Expand Up @@ -197,7 +198,7 @@ TurboModuleProviderFunctionType TurboModuleManager::createTurboModuleProvider(
.instance = moduleInstance,
.jsInvoker = jsCallInvoker,
.nativeMethodCallInvoker = nativeMethodCallInvoker,
.shouldVoidMethodsExecuteSync = false};
.shouldVoidMethodsExecuteSync = enableSyncVoidMethods};

auto turboModule = delegate->cthis()->getTurboModule(name, params);
turboModuleCache->insert({name, turboModule});
Expand All @@ -209,8 +210,8 @@ TurboModuleProviderFunctionType TurboModuleManager::createTurboModuleProvider(
};
}

TurboModuleProviderFunctionType TurboModuleManager::createLegacyModuleProvider(
bool enableSyncVoidMethods) {
TurboModuleProviderFunctionType
TurboModuleManager::createLegacyModuleProvider() {
return [legacyModuleCache_ = std::weak_ptr<ModuleCache>(legacyModuleCache_),
jsCallInvoker_ = std::weak_ptr<CallInvoker>(jsCallInvoker_),
nativeMethodCallInvoker_ =
Expand Down Expand Up @@ -322,7 +323,7 @@ void TurboModuleManager::installJSIBindings(
TurboModuleBinding::install(
runtime,
createTurboModuleProvider(enableSyncVoidMethods),
createLegacyModuleProvider(enableSyncVoidMethods));
createLegacyModuleProvider());
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class TurboModuleManager : public jni::HybridClass<TurboModuleManager> {

TurboModuleProviderFunctionType createTurboModuleProvider(
bool enableSyncVoidMethods);
TurboModuleProviderFunctionType createLegacyModuleProvider(
bool enableSyncVoidMethods);
TurboModuleProviderFunctionType createLegacyModuleProvider();
};

} // namespace facebook::react

0 comments on commit ffe9837

Please sign in to comment.