Cover react/runtime with Stable API guards (#58167)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/58167

Classifies `react/runtime:runtime` and `react/runtime:runtime-platform` as "for frameworks" targets under the three-tier C++ stable API visibility model. Consumers that opt into `RN_STRICT_API` now get a warning if they include their headers directly, which they can acknowledge with `RN_ALLOW_FRAMEWORKS`; without that flag the guards are inert, so no existing build changes behaviour.

The Apple platform layer is covered alongside the core runtime, so `RCTHost.h` and `RCTInstance.h` are in scope. `React-RuntimeCore` already depended on `React-cxxstableapi` from an earlier migration in the same pod; `React-RuntimeApple` gains the dependency here.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D117690303

fbshipit-source-id: 5e80284eefe6be4b556aacf4415c8c8ba228471e
This commit is contained in:
Jakub Piasecki authored and meta-codesync[bot] committed 2026-09-04 04:51:25 -07:00
1 parent 9be9186da1
commit 1b30a1f5a2
18 files changed
+34

No files matched your search

@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <react/runtime/ReactInstance.h>
namespace facebook::react {
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <ReactCommon/CallInvoker.h>
#include <cxxreact/MessageQueueThread.h>
#include <memory>
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <ReactCommon/RuntimeExecutor.h>
#include <jsi/jsi.h>
#include <atomic>
@@ -34,6 +34,7 @@ target_link_libraries(
jsi
jsitooling
jsireact
react_cxxstableapi
react_utils
jsinspector
react_featureflags
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <cstdint>
#include <memory>
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <ReactCommon/RuntimeExecutor.h>
#include <cxxreact/JSBigString.h>
#include <cxxreact/MessageQueueThread.h>
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#include <ReactCommon/RuntimeExecutor.h>
#include <unordered_map>
#include <vector>
@@ -55,6 +55,7 @@ Pod::Spec.new do |s|
s.dependency "React-jserrorhandler"
s.dependency "React-jsinspector"
s.dependency "React-featureflags"
s.dependency "React-cxxstableapi"
add_dependency(s, "React-jsitooling", :framework_name => "JSITooling")
add_dependency(s, "React-RCTFBReactNativeSpec")
add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"])
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <UIKit/UIKit.h>
#import <React/RCTTiming.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <Foundation/Foundation.h>
#import <react/utils/ContextContainer.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <hermes/Public/CrashManager.h>
#import <jsi/jsi.h>
#import <react/runtime/JSRuntimeFactory.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import "RCTHost.h"
#import "RCTContextContainerHandling.h"
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <Foundation/Foundation.h>
#import <React/RCTDefines.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <UIKit/UIKit.h>
#import <React/RCTDefines.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <Foundation/Foundation.h>
#import <React/RCTMessageThread.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <cxxreact/MessageQueueThread.h>
#import <jsi/jsi.h>
#import <react/runtime/JSRuntimeFactory.h>
@@ -7,6 +7,8 @@
#pragma once
#include <react/cxxstableapi/FrameworksGuard.h>
#ifndef RCT_REMOVE_LEGACY_COMPONENT_INTEROP
#include <jsi/jsi.h>
@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <react/cxxstableapi/FrameworksGuard.h>
#import <Foundation/Foundation.h>
@class RCTPerformanceLogger;