Skip to content

Commit 7778c9d

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Cover jserrorhandler with Stable API guards
Summary: Classifies `jserrorhandler:jserrorhandler` as a "for frameworks" target under the C++ stable API three-tier visibility model. Adds `#include <react/cxxstableapi/FrameworksGuard.h>` to the module's three exported headers (`ErrorUtils.h`, `JsErrorHandler.h`, `StackTraceParser.h`), and wires the guard dependency into BUCK, CMake and CocoaPods. Consumers that opt into `RN_STRICT_API` now get a warning if they include these headers directly, which they can acknowledge with `RN_ALLOW_FRAMEWORKS`; without that flag the guards are inert, so no existing build changes behaviour. Changelog: [Internal] Differential Revision: D117842041
1 parent eda9f45 commit 7778c9d

5 files changed

Lines changed: 15 additions & 0 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ target_link_libraries(jserrorhandler
2121
callinvoker
2222
folly_runtime
2323
${mapbufferjni}
24+
react_cxxstableapi
2425
react_featureflags
2526
)
2627
target_compile_reactnative_options(jserrorhandler PRIVATE)

packages/react-native/ReactCommon/jserrorhandler/ErrorUtils.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 <jsi/jsi.h>
1113

1214
namespace facebook::react {

packages/react-native/ReactCommon/jserrorhandler/JsErrorHandler.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 <jsi/jsi.h>
1113
#include <iosfwd>
1214
#include <optional>

packages/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ end
1818

1919
react_native_path = ".."
2020

21+
header_search_paths = []
22+
23+
if ENV['USE_FRAMEWORKS']
24+
header_search_paths << "\"$(PODS_TARGET_SRCROOT)/..\"" # ReactCommon, for <react/cxxstableapi/...>
25+
end
26+
2127
Pod::Spec.new do |s|
2228
s.name = "React-jserrorhandler"
2329
s.version = version
@@ -30,6 +36,7 @@ Pod::Spec.new do |s|
3036
s.header_dir = "jserrorhandler"
3137
s.source_files = podspec_sources(["ErrorUtils.{cpp,h}", "JsErrorHandler.{cpp,h}", "StackTraceParser.{cpp,h}"], ["ErrorUtils.h", "JsErrorHandler.h", "StackTraceParser.h"])
3238
s.pod_target_xcconfig = {
39+
"HEADER_SEARCH_PATHS" => header_search_paths.join(' '),
3340
"USE_HEADERMAP" => "YES",
3441
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard()
3542
}
@@ -38,6 +45,7 @@ Pod::Spec.new do |s|
3845

3946
s.dependency "React-jsi"
4047
s.dependency "React-bridging"
48+
s.dependency "React-cxxstableapi"
4149
add_dependency(s, "React-featureflags")
4250
add_dependency(s, "React-debug")
4351

packages/react-native/ReactCommon/jserrorhandler/StackTraceParser.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 <string>
1113
#include <vector>
1214
#include "JsErrorHandler.h"

0 commit comments

Comments
 (0)