Skip to content

Reach public ReactCommon modules through umbrellas from Android platform headers - #58886

Open
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D123610673
Open

j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D123610673

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
Android headers exported through prefab (react/fabric/*, JReadableMapBuffer.h, and DefaultComponentsRegistry.h, which app OnLoad.cpp files include) included fine-grained headers of public ReactCommon modules, which trip the modules' public guard under RN_STRICT_API in any app or library including them. Switch them to the module umbrellas (<React/RendererCore.h>, <React/ComponentRegistry.h>, <React/Debug.h>, <React/MapBuffer.h>).

"For frameworks" includes stay direct, since umbrellas do not re-export them: ComponentFactory.h keeps <react/renderer/componentregistry/ComponentDescriptorFactory.h> for ComponentRegistryFactory. To keep that framework-tier header out of app code, DefaultComponentsRegistry.h now forward-declares ComponentFactory (it only takes it by pointer) and DefaultComponentsRegistry.cpp includes it. The guards are inert without RN_STRICT_API.

Changelog: [Internal]

Differential Revision: D123610673

@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 6, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Oct 6, 2026
@meta-codesync

meta-codesync Bot commented Oct 6, 2026

Copy link
Copy Markdown

@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123610673.

@j-piasecki
j-piasecki force-pushed the export-D123610673 branch 2 times, most recently from 2d5bf15 to 438d33d Compare October 6, 2026 12:47
@meta-codesync meta-codesync Bot changed the title Reach public ReactCommon modules through umbrellas from Android platform headers Reach public ReactCommon modules through umbrellas from Android platform headers (#58886) Oct 7, 2026
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Oct 7, 2026
…orm headers (react#58886)

Summary:

Android headers exported through prefab (`react/fabric/AndroidEventBeat.h`, `EventEmitterWrapper.h`, `FabricMountingManager.h`, `StateWrapperImpl.h`, `ComponentFactory.h`, `CoreComponentsRegistry.h`, `react/common/mapbuffer/JReadableMapBuffer.h`, and `DefaultComponentsRegistry.h`, which app `OnLoad.cpp` files include) included fine-grained headers of public ReactCommon modules. Under `RN_STRICT_API` those hit the modules' public guard in any app or library that includes them, so they now include `<React/RendererCore.h>`, `<React/ComponentRegistry.h>`, `<React/Debug.h>` and `<React/MapBuffer.h>` instead. Includes of "for frameworks" headers are unchanged. The guards are inert without that flag.

Changelog: [Internal]

Differential Revision: D123610673
…orm headers

Summary:
Android headers exported through prefab (`react/fabric/*`, `JReadableMapBuffer.h`, and `DefaultComponentsRegistry.h`, which app `OnLoad.cpp` files include) included fine-grained headers of public ReactCommon modules, which trip the modules' public guard under `RN_STRICT_API` in any app or library including them. Switch them to the module umbrellas (`<React/RendererCore.h>`, `<React/ComponentRegistry.h>`, `<React/Debug.h>`, `<React/MapBuffer.h>`).

"For frameworks" includes stay direct, since umbrellas do not re-export them: `ComponentFactory.h` keeps `<react/renderer/componentregistry/ComponentDescriptorFactory.h>` for `ComponentRegistryFactory`. To keep that framework-tier header out of app code, `DefaultComponentsRegistry.h` now forward-declares `ComponentFactory` (it only takes it by pointer) and `DefaultComponentsRegistry.cpp` includes it. The guards are inert without `RN_STRICT_API`.

Changelog: [Internal]

Differential Revision: D123610673
@meta-codesync meta-codesync Bot changed the title Reach public ReactCommon modules through umbrellas from Android platform headers (#58886) Reach public ReactCommon modules through umbrellas from Android platform headers Oct 7, 2026

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