From b7963bf1319465b7509d8c207cda69d565eb5494 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 18 Nov 2025 06:49:06 -0800 Subject: [PATCH] Forward declare TurboModule in TurboModuleProvider Summary: Forward-declare so these headers can be parsed in targets which disable exceptions. Changelog: [Internal] Reviewed By: shwanton Differential Revision: D87333893 --- .../ReactCommon/react/runtime/ReactInstance.cpp | 2 +- .../react/nativemodule/TurboModuleProvider.h | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp index 8e1dfd2fa0eea0..46fa1c65f94799 100644 --- a/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp +++ b/packages/react-native/ReactCommon/react/runtime/ReactInstance.cpp @@ -95,7 +95,7 @@ ReactInstance::ReactInstance( jsErrorHandler->handleError(jsiRuntime, originalError, true); } catch (std::exception& ex) { jsi::JSError error( - jsiRuntime, std::string("Non-js exception: ") + ex.what()); + jsiRuntime, std::string("Non-JS exception: ") + ex.what()); jsErrorHandler->handleError(jsiRuntime, error, true); } }); diff --git a/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h b/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h index e5c031ab16b003..b10c248aab891e 100644 --- a/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h +++ b/packages/react-native/ReactCxxPlatform/react/nativemodule/TurboModuleProvider.h @@ -7,15 +7,16 @@ #pragma once -#include -#include - #include +#include #include #include namespace facebook::react { +class CallInvoker; +class TurboModule; + using TurboModuleProvider = std::function(const std::string &name, const std::shared_ptr &jsInvoker)>;