From 8686844ba900c2a0dfdfd84b8c88d3d008afc1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ma=C5=82ecki?= Date: Thu, 1 Oct 2026 04:04:15 -0700 Subject: [PATCH] Make `StackTraceParser.h` private in jserrorhandler Summary: `StackTraceParser` is an implementation detail of `JsErrorHandler`: it is only used by `JsErrorHandler.cpp` and its own unit test, and `JsErrorHandler.h` does not include it. Mark it as a private header instead of a for-frameworks one. - Swap `FrameworksGuard.h` for `PrivateGuard.h` in `StackTraceParser.h`. - Include `JsErrorHandler.h` via its namespaced path so the header resolves when it is not exported alongside it. - Stop shipping `StackTraceParser.h` as a header for prebuilt `React-jserrorhandler` pods. Changelog: [Internal] Differential Revision: D122770464 --- .../ReactCommon/jserrorhandler/React-jserrorhandler.podspec | 2 +- .../ReactCommon/jserrorhandler/StackTraceParser.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec b/packages/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec index c0fb2e9c0d61..c29d4df2c232 100644 --- a/packages/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec +++ b/packages/react-native/ReactCommon/jserrorhandler/React-jserrorhandler.podspec @@ -34,7 +34,7 @@ Pod::Spec.new do |s| s.platforms = min_supported_versions s.source = source s.header_dir = "jserrorhandler" - s.source_files = podspec_sources(["ErrorUtils.{cpp,h}", "JsErrorHandler.{cpp,h}", "StackTraceParser.{cpp,h}"], ["ErrorUtils.h", "JsErrorHandler.h", "StackTraceParser.h"]) + s.source_files = podspec_sources(["ErrorUtils.{cpp,h}", "JsErrorHandler.{cpp,h}", "StackTraceParser.{cpp,h}"], ["ErrorUtils.h", "JsErrorHandler.h"]) s.pod_target_xcconfig = { "HEADER_SEARCH_PATHS" => header_search_paths.join(' '), "USE_HEADERMAP" => "YES", diff --git a/packages/react-native/ReactCommon/jserrorhandler/StackTraceParser.h b/packages/react-native/ReactCommon/jserrorhandler/StackTraceParser.h index d5ecce8fa03c..ea213dfc1f3f 100644 --- a/packages/react-native/ReactCommon/jserrorhandler/StackTraceParser.h +++ b/packages/react-native/ReactCommon/jserrorhandler/StackTraceParser.h @@ -7,11 +7,11 @@ #pragma once -#include +#include +#include #include #include -#include "JsErrorHandler.h" namespace facebook::react {