Skip to content

Make ModalHostViewUtils header private (#58957) - #58957

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

coado wants to merge 4 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]

Reviewed By: cortinico

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.

@meta-codesync meta-codesync Bot changed the title Make ModalHostViewUtils header private Make ModalHostViewUtils header private (#58957) Oct 9, 2026
@coado
coado force-pushed the export-D124105062 branch from 3d24206 to 62017ad Compare October 9, 2026 09:53
coado added a commit to coado/react-native that referenced this pull request Oct 9, 2026
Summary:
Pull Request resolved: react#58957

`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

@cortinico cortinico left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

Dawid Małecki and others added 3 commits October 12, 2026 06:05
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.

The headers stay published, because React Native's own core component registries outside this module include them. Because they now include their own module's umbrella, and `YogaLayoutableShadowNode.cpp` includes `LayoutConformanceShadowNode.h`, the CMake `rrc_view` target exposes its umbrella directory as `PUBLIC` instead of `INTERFACE`, so the module's own sources can resolve `<React/View.h>` as well as its dependents.

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.

Remove `JSBundleType.h` from the `<React/JSBigString.h>` umbrella: a public umbrella that includes it would keep its symbols public regardless of its guard. Frameworks include `<cxxreact/JSBundleType.h>` directly.

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
coado added a commit to coado/react-native that referenced this pull request Oct 12, 2026
Summary:
Pull Request resolved: react#58957

`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]

Reviewed By: cortinico

Differential Revision: D124105062
@coado
coado force-pushed the export-D124105062 branch from 62017ad to a9dfeb2 Compare October 12, 2026 13:39
Summary:
Pull Request resolved: react#58957

`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]

Reviewed By: cortinico

Differential Revision: D124105062
@coado
coado force-pushed the export-D124105062 branch from a9dfeb2 to 7686eea Compare October 12, 2026 14:28
@meta-codesync meta-codesync Bot closed this in 277e57e Oct 13, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 13, 2026
@meta-codesync

meta-codesync Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request has been merged in 277e57e.

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. Merged This PR has been merged. 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.

2 participants