Skip to content

Make ModalHostViewUtils header private - #58957

Open
coado wants to merge 10 commits into
react:mainfrom
coado:export-D124105062
Open

coado wants to merge 10 commits into
react:mainfrom
coado:export-D124105062

Conversation

@coado

@coado coado commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Summary:
react/renderer/components/modal/ModalHostViewUtils.h declares ModalHostViewScreenSize(), a per-platform helper that is only used to compute the default screen size of ModalHostViewState. Lower it from "for frameworks" to private.

It was reachable from the "for frameworks" API only because ModalHostViewState.h called it from an inline default constructor. Move that constructor out of line into ModalHostViewState.cpp, so ModalHostViewState.h no longer includes the utils header.

While here, ModalHostViewState.h now gets Float/Size from the <React/Graphics.h> umbrella instead of including the public react/renderer/graphics/Float.h directly (Size previously only arrived transitively through the utils header).

The C++ API snapshots are regenerated: ModalHostViewScreenSize() is removed from the Frameworks snapshots.

Changelog: [Internal]

Differential Revision: D124105062

Dawid Małecki and others added 10 commits October 8, 2026 06:22
Summary:
Lower the following `react/renderer/components/textinput` headers from "for frameworks" to private:

Platform component descriptors:
- Android `androidtextinput/AndroidTextInputComponentDescriptor.h`
- iOS and macOS `iostextinput/TextInputComponentDescriptor.h`

All three classes are `final`, so they cannot be extended, and they are registered only by React Native's own platform glue (the Android core components registry and the iOS TextInput component view). The Android descriptor is additionally coupled to React Native's Java `FabricUIManager` (it reads theme padding over JNI in `getInitialState`).

Prop conversion helpers:
- `baseConversions.h` (conversions for the shared text input enums)
- iOS and macOS `iostextinput/propsConversions.h` (iOS/macOS text input trait parsers)

These are only included by the module's own props sources (`BaseTextInputProps.cpp` and the platform `TextInputProps.cpp` / `AndroidTextInputProps.cpp`).

No header includes any of them. The TextInput shadow nodes, props, state and event emitters stay "for frameworks", since third-party text input libraries build on them directly. The iOS/macOS `conversions.h` also stays "for frameworks", as the iOS/macOS `TextInputProps.h` includes it.

Changelog: [Internal]

Differential Revision: D123643375
Summary:
Mark the following `jsinspector-modern` headers as private instead of for-frameworks. All of them are implementation details of the inspector, and no for-frameworks header includes them:

- `ConsoleTask`, `ConsoleTaskContext` and `ConsoleTaskOrchestrator` implement `console.createTask()`: the task object, the context that captures the stack trace when a task is created, and the singleton that tracks which task is currently running. They are only used by the inspector's console sources, a console test, and `PerformanceEntryReporter.cpp`, which reads the current task from the orchestrator.
- `EmulationAgent` handles the CDP `Emulation` domain. It is only used by `EmulationAgent.cpp` and `HostAgent.cpp`.
- `FallbackRuntimeAgentDelegate` answers CDP requests for a JavaScript runtime that does not support debugging. It is only used by `FallbackRuntimeAgentDelegate.cpp` and `FallbackRuntimeTargetDelegate.cpp`. `FallbackRuntimeTargetDelegate.h`, which creates it, stays for-frameworks.
- `InspectorPackagerConnectionImpl.h` defines `InspectorPackagerConnection::Impl`, the hidden implementation of the inspector-proxy protocol. `InspectorPackagerConnection.h` only forward-declares it, and it is only used by `InspectorPackagerConnection.cpp`. `InspectorPackagerConnection.h` and `WebSocketInterfaces.h` stay for-frameworks, because each platform implements `InspectorPackagerConnectionDelegate`.
- `RuntimeTargetGlobalStateObserver` installs a JavaScript global that reports a boolean state, such as whether a debugger session is active, and notifies its subscribers when the state changes. `RuntimeTargetTracingStateObserver` uses it to report whether tracing is active. Both are only used by the `RuntimeTarget` sources and their own sources.
- `Utf8.h` provides `truncateToValidUTF8`, which trims a byte buffer so it does not end in the middle of a UTF-8 code point when `IO.read` slices a network resource. It is only used by `NetworkIOAgent.cpp` and its own unit test.
- `ExecutionContextManager` allocates execution context IDs. It is only created by `HostTarget.cpp` and used by `InstanceTarget.cpp`. `HostTarget.h` and `InstanceTarget.h` only hold it through `std::shared_ptr`, so they now forward-declare it instead of including the header, and the two sources include it directly.

React Native's own targets define `RN_BUILDING`, so the private guard does not affect them.

Changelog: [Internal]

Differential Revision: D123009197
Summary:
Mark the following tracing headers as private instead of for-frameworks. All of them are implementation details of React Native's tracing infrastructure, and no for-frameworks header includes them:

- `EventLoopReporter` is an RAII helper the runtime scheduler uses to report event loop task and microtask phases to the performance tracer. It is only used by `EventLoopReporter.cpp` and `RuntimeScheduler_Modern.cpp`.
- `RuntimeSamplingProfileTraceEventSerializer` turns a runtime sampling profile into trace events. It is only used by tracing sources, `TracingAgent.cpp` and its own unit test.
- `TraceEventSerializer` serializes trace events to `folly::dynamic`. It is only used by tracing sources and `TracingAgent.cpp`.
- `TraceEventGenerator` builds trace events for the performance tracer and the host profile serializer. It is only used by tracing sources and was already not exported in Buck.
- `ProfileTreeNode` is an auxiliary tree used to build the profile and deduplicate identical frames. It is only used by `RuntimeSamplingProfileTraceEventSerializer.cpp` and its own unit test.
- `Timing.h` defines the tracing clock origin and the conversions from `HighResTimeStamp` and `HighResDuration` to trace event microseconds. It is only used by tracing sources and a tracing unit test.

`TracingAgent.h` included `Timing.h` without using it; that include is removed.

React Native's own targets define `RN_BUILDING`, so the private guard does not affect them.

Changelog: [Internal]

Differential Revision: D122780825
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
Summary:
Mark the following headers as private instead of for-frameworks. All of them are implementation details of the host target and how it records and serializes a trace, and no for-frameworks header includes them:

- `HostTracingProfileSerializer` transforms a `HostTracingProfile` into serialized trace events. It is only used by its own source and `HostTargetTracing.h`.
- `HostTargetTracing.h` provides `emitNotificationsForTracingProfile`, which uses the serializer to send a captured profile to frontend channels as `Tracing.dataCollected` events followed by `Tracing.tracingComplete`. It is only used by `HostTarget.cpp` and `TracingAgent.cpp`, and was already not exported in Buck.
- `HostTargetTraceRecording` holds the state of an in-progress host trace recording. `HostTarget.h` only forward-declares it, and it is only used by `HostTarget.cpp`, `HostTargetTraceRecording.cpp` and `HostTargetTracing.cpp`.
- `TimeWindowedBuffer` is a generic buffer that keeps only elements inside a time window. It is only used by `HostTargetTraceRecording` and its own unit test.
- `TracingAgent` handles the CDP `Tracing.start` and `Tracing.stop` requests for the host agent. It is only used by `HostAgent.cpp` and `TracingAgent.cpp`, and was already not exported in Buck.
- `HostAgent` handles CDP requests for a host target. `HostTarget.h` only forward-declares it, and it is only used by `HostAgent.cpp`, `HostTarget.cpp` and `HostTargetTraceRecording.h`.
- `InstanceAgent` handles CDP requests for an instance target. `InstanceTarget.h` only forward-declares it, and it is only used by `HostAgent.h`, `HostAgent.cpp`, `InstanceAgent.cpp` and `InstanceTarget.cpp`.
- `InspectorUtilities.h` provides connection adapters for `InspectorInterfaces`: `CallbackLocalConnection`, `CallbackRemoteConnection`, `RAIIRemoteConnection` and `NullRemoteConnection`. It is only used by `HostTarget.cpp` and `InspectorUtilities.cpp`, and was already not exported in Buck.

Headers that include one another change together: `HostTargetTracing.h` includes `HostTracingProfileSerializer.h`, `HostTargetTraceRecording.h` stores a `TimeWindowedBuffer` by value and includes `HostAgent.h`, and `HostAgent.h` includes `InstanceAgent.h`, so keeping any of these includers for-frameworks would expose a private header. `HostTracingProfile.h`, `FrameTimingSequence.h`, `TraceRecordingState.h` and `TracingCategory.h` stay for-frameworks because other for-frameworks headers include them.

React Native's own targets define `RN_BUILDING`, so the private guard does not affect them.

Changelog: [Internal]

Differential Revision: D122791607
Summary:
Move `ViewPropsInterpolation.h` from the public tier of the C++ stable API to the private tier, and remove it from the `<React/View.h>` umbrella.

The header defines `interpolateViewProps`, an inline helper that interpolates opacity and transform between two `ViewProps` during a layout animation. It is an implementation detail of React Native's layout animation system, the only code that calls it, and it is not part of the API for component authors. No public or for-frameworks header includes it.

React Native's own targets define `RN_BUILDING`, so the private guard does not affect them. The header stays published by every build system, consistent with other private headers.

Changelog: [Internal]

Differential Revision: D123651988
Summary:
Move `LayoutConformanceComponentDescriptor.h`, `LayoutConformanceProps.h` and `LayoutConformanceShadowNode.h` from the public tier of the C++ stable API to the for-frameworks tier, and remove them from the `<React/View.h>` umbrella.

These headers implement the experimental `LayoutConformance` core component. Native component authors do not use them, but a platform that registers React Native's core components does: `YogaLayoutableShadowNode::resolveErrata` checks for `LayoutConformanceShadowNode` with a `dynamic_cast` to choose the Yoga errata, so a platform has to register React Native's own descriptor for the component to have any effect. That makes them framework-author API rather than private headers. The `LayoutConformance` enum and its conversions stay public in `primitives.h` and `conversions.h`.

A for-frameworks header has to reach public headers through their umbrella, so the three headers now include `<React/View.h>` and `<React/RendererCore.h>` instead of fine-grained paths, and compile when included directly under strict API enforcement. `LayoutConformanceProps.h` was the only umbrella member that included the public `conversions.h`, so `conversions.h` is added to `<React/View.h>` directly to keep it available through the umbrella.

No build files change: the headers stay published, because React Native's own core component registries outside this module include them.

Changelog: [Internal]

Differential Revision: D123895702
Summary:
Move the following `react/nativemodule/core` headers from the public tier to the for-frameworks tier:

- `TurboModuleBinding.h` - not called by native module authors,
- `JavaInteropTurboModule.h` (Android) and `RCTInteropTurboModule.h` (iOS) - legacy

The C++ API snapshots are regenerated: these symbols are removed from the Debug, Release and Newarch snapshots and stay in the Frameworks snapshots.

Changelog: [Internal]

Differential Revision: D124104733
Summary:
`JSBundleType.h` exposes bundle-format detection internals (`BundleHeader`, `ScriptTag`, `parseTypeFromHeader`, `isHermesBytecodeBundle`). Within React Native it is only used by the bundle loaders, but out-of-tree platforms read `BundleHeader` directly, so it is classified as "for frameworks" rather than private.

The C++ API snapshots are regenerated: these symbols are removed from the Debug, Release and Newarch snapshots and stay in the Frameworks snapshots.

Changelog: [Internal]

Differential Revision: D124104985
Summary:
`react/renderer/components/modal/ModalHostViewUtils.h` declares `ModalHostViewScreenSize()`, a per-platform helper that is only used to compute the default screen size of `ModalHostViewState`. Lower it from "for frameworks" to private.

It was reachable from the "for frameworks" API only because `ModalHostViewState.h` called it from an inline default constructor. Move that constructor out of line into `ModalHostViewState.cpp`, so `ModalHostViewState.h` no longer includes the utils header.

While here, `ModalHostViewState.h` now gets `Float`/`Size` from the `<React/Graphics.h>` umbrella instead of including the public `react/renderer/graphics/Float.h` directly (`Size` previously only arrived transitively through the utils header).

The C++ API snapshots are regenerated: `ModalHostViewScreenSize()` is removed from the Frameworks snapshots.

Changelog: [Internal]

Differential Revision: D124105062
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 8, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Oct 8, 2026
@meta-codesync

meta-codesync Bot commented Oct 8, 2026

Copy link
Copy Markdown

@coado has exported this pull request. If you are a Meta employee, you can view the originating Diff in D124105062.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook p: Software Mansion Partner: Software Mansion Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant