From f4ec9dcb538ef70e04c15ad88658f5f0238deeac Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Fri, 21 Aug 2026 05:33:00 -0700 Subject: [PATCH] Cover `react/runtime/hermes:hermes` with Stable API guards (#58050) Summary: Pull Request resolved: https://github.com/react/react-native/pull/58050 Classifies `react/runtime/hermes:hermes` as a "for frameworks" target under the three-tier C++ stable API visibility model. Consumers that opt into `RN_STRICT_API` now get a warning if they include its headers directly, which they can acknowledge with `RN_ALLOW_FRAMEWORKS`; without that flag the guard is inert, so no existing build changes behaviour. Changelog: [Internal] Reviewed By: javache Differential Revision: D116926134 fbshipit-source-id: 99d4e697d3e389314e0edddcc711eccf022a14d5 --- .../ReactCommon/react/runtime/React-RuntimeHermes.podspec | 1 + .../ReactCommon/react/runtime/hermes/CMakeLists.txt | 1 + .../ReactCommon/react/runtime/hermes/HermesInstance.h | 2 ++ 3 files changed, 4 insertions(+) diff --git a/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec b/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec index 8a0cf34d7b3..8879807588f 100644 --- a/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec +++ b/packages/react-native/ReactCommon/react/runtime/React-RuntimeHermes.podspec @@ -34,6 +34,7 @@ Pod::Spec.new do |s| resolve_use_frameworks(s, header_mappings_dir: "../../", module_name: "React_RuntimeHermes") + s.dependency "React-cxxstableapi" s.dependency "React-jsitracing" s.dependency "React-jsi" s.dependency "React-utils" diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/CMakeLists.txt b/packages/react-native/ReactCommon/react/runtime/hermes/CMakeLists.txt index 07b2a26b442..d9916606029 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/CMakeLists.txt +++ b/packages/react-native/ReactCommon/react/runtime/hermes/CMakeLists.txt @@ -25,6 +25,7 @@ target_link_libraries(bridgelesshermes jsi jsitooling jsinspector + react_cxxstableapi ${reactnative} ) diff --git a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.h b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.h index 92883314238..e6eef12139b 100644 --- a/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.h +++ b/packages/react-native/ReactCommon/react/runtime/hermes/HermesInstance.h @@ -7,6 +7,8 @@ #pragma once +#include + #include #include #include