Skip to content

Commit b7d600f

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Use umbrella instead of a direct include in jsinspector-modern/tracing module (#58552)
Summary: Changelog: [Internal] Part of the C++ stable API migration to umbrella includes. Fixes a tier reachability violation in the `jsinspector-modern/tracing` module. The headers in this module are "for frameworks" tier (they include `<react/cxxstableapi/FrameworksGuard.h>`), but they reached the timing module directly through `<react/timing/primitives.h>`. That header is protected by `<react/cxxstableapi/UmbrellaGuard.h>`. Exported headers are preprocessed in the consumer's translation unit, so a consumer building with `RN_STRICT_API` would hit the guard through these transitive includes. `RN_ALLOW_FRAMEWORKS` does not suppress the guard. This change replaces `#include <react/timing/primitives.h>` with the `<React/Timing.h>` umbrella in all 12 tracing headers that used it. The umbrella scopes `RN_UMBRELLA_CONTEXT` around its include of `primitives.h`, so the guard accepts it. It re-exports the same declarations, so there is no functional change. Out of scope: the module's `.cpp` files (`EventLoopReporter.cpp`, `PerformanceTracer.cpp`, `TraceEventSerializer.cpp`) keep the fine-grained include. They are compiled only within React Native's own build and are never preprocessed by consumers, which matches the umbrella's documented guidance. Other modules are migrated in separate changes. Reviewed By: cortinico Differential Revision: D120313623
1 parent 91a174e commit b7d600f

12 files changed

Lines changed: 12 additions & 12 deletions

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/ConsoleTimeStamp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
#include <react/cxxstableapi/FrameworksGuard.h>
1111

12+
#include <React/Timing.h>
1213
#include <jsi/JSIDynamic.h>
1314
#include <jsi/jsi.h>
14-
#include <react/timing/primitives.h>
1515

1616
#include <cassert>
1717
#include <optional>

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/EventLoopReporter.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <react/cxxstableapi/FrameworksGuard.h>
1111

1212
#if defined(REACT_NATIVE_DEBUGGER_ENABLED)
13-
#include <react/timing/primitives.h>
13+
#include <React/Timing.h>
1414
#endif
1515

1616
namespace facebook::react::jsinspector_modern::tracing {

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/FrameTimingSequence.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "TraceEvent.h"
1313

14-
#include <react/timing/primitives.h>
14+
#include <React/Timing.h>
1515

1616
#include <cstdint>
1717
#include <optional>

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/HostTracingProfile.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "InstanceTracingProfile.h"
1414
#include "RuntimeSamplingProfile.h"
1515

16-
#include <react/timing/primitives.h>
16+
#include <React/Timing.h>
1717

1818
#include <vector>
1919

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/PerformanceTracer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "TraceEvent.h"
1414
#include "TraceEventProfile.h"
1515

16-
#include <react/timing/primitives.h>
16+
#include <React/Timing.h>
1717

1818
#include <folly/dynamic.h>
1919
#include <atomic>

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/RuntimeSamplingProfileTraceEventSerializer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include "RuntimeSamplingProfile.h"
1313

14-
#include <react/timing/primitives.h>
14+
#include <React/Timing.h>
1515

1616
namespace facebook::react::jsinspector_modern::tracing {
1717

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/TimeWindowedBuffer.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include <optional>
1515
#include <vector>
1616

17-
#include <react/timing/primitives.h>
17+
#include <React/Timing.h>
1818

1919
namespace facebook::react::jsinspector_modern::tracing {
2020

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/Timing.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
#include <cassert>
1313

14-
#include <react/timing/primitives.h>
14+
#include <React/Timing.h>
1515

1616
namespace facebook::react::jsinspector_modern::tracing {
1717

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEvent.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
#include <react/cxxstableapi/FrameworksGuard.h>
1111

12+
#include <React/Timing.h>
1213
#include <jsinspector-modern/tracing/TracingCategory.h>
13-
#include <react/timing/primitives.h>
1414

1515
#include <folly/dynamic.h>
1616

‎packages/react-native/ReactCommon/jsinspector-modern/tracing/TraceEventGenerator.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
#include "TraceEvent.h"
1313

14+
#include <React/Timing.h>
1415
#include <jsinspector-modern/tracing/FrameTimingSequence.h>
15-
#include <react/timing/primitives.h>
1616

1717
#include <cstdint>
1818
#include <utility>

0 commit comments

Comments
 (0)