Skip to content

Commit 0344a38

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Cover react/runtime with Stable API guards
Summary: 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] Differential Revision: D117690303
1 parent 8a75a4d commit 0344a38

18 files changed

Lines changed: 34 additions & 0 deletions

packages/react-native/ReactCommon/react/runtime/BindingsInstaller.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <react/runtime/ReactInstance.h>
1113

1214
namespace facebook::react {

packages/react-native/ReactCommon/react/runtime/BridgelessNativeMethodCallInvoker.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <ReactCommon/CallInvoker.h>
1113
#include <cxxreact/MessageQueueThread.h>
1214
#include <memory>

packages/react-native/ReactCommon/react/runtime/BufferedRuntimeExecutor.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <ReactCommon/RuntimeExecutor.h>
1113
#include <jsi/jsi.h>
1214
#include <atomic>

packages/react-native/ReactCommon/react/runtime/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ target_link_libraries(
3434
jsi
3535
jsitooling
3636
jsireact
37+
react_cxxstableapi
3738
react_utils
3839
jsinspector
3940
react_featureflags

packages/react-native/ReactCommon/react/runtime/PlatformTimerRegistry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <cstdint>
1113
#include <memory>
1214

packages/react-native/ReactCommon/react/runtime/ReactInstance.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <ReactCommon/RuntimeExecutor.h>
1113
#include <cxxreact/JSBigString.h>
1214
#include <cxxreact/MessageQueueThread.h>

packages/react-native/ReactCommon/react/runtime/TimerManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
#pragma once
99

10+
#include <react/cxxstableapi/FrameworksGuard.h>
11+
1012
#include <ReactCommon/RuntimeExecutor.h>
1113
#include <unordered_map>
1214
#include <vector>

packages/react-native/ReactCommon/react/runtime/platform/ios/React-RuntimeApple.podspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Pod::Spec.new do |s|
5555
s.dependency "React-jserrorhandler"
5656
s.dependency "React-jsinspector"
5757
s.dependency "React-featureflags"
58+
s.dependency "React-cxxstableapi"
5859
add_dependency(s, "React-jsitooling", :framework_name => "JSITooling")
5960
add_dependency(s, "React-RCTFBReactNativeSpec")
6061
add_dependency(s, "React-utils", :additional_framework_paths => ["react/utils/platform/ios"])

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/ObjCTimerRegistry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
#include <react/cxxstableapi/FrameworksGuard.h>
9+
810
#import <UIKit/UIKit.h>
911

1012
#import <React/RCTTiming.h>

packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTContextContainerHandling.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
#include <react/cxxstableapi/FrameworksGuard.h>
9+
810
#import <Foundation/Foundation.h>
911

1012
#import <react/utils/ContextContainer.h>

0 commit comments

Comments
 (0)