Skip to content

Reach public modules through umbrellas from for-frameworks headers - #58969

Open
coado wants to merge 1 commit into
react:mainfrom
coado:export-D124320010
Open

coado wants to merge 1 commit into
react:mainfrom
coado:export-D124320010

Conversation

@coado

@coado coado commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary:
Several "for frameworks" headers included fine-grained headers of public modules directly. A framework author includes a for-frameworks header directly, outside any umbrella, so under RN_STRICT_API those includes hit the public module's UmbrellaGuard.h #error, which RN_ALLOW_FRAMEWORKS does not suppress. Switch them to the module umbrellas:

  • Image component (ImageComponentDescriptor.h, ImageEventEmitter.h, ImageProps.h, ImageShadowNode.h, ImageState.h): <React/View.h>, <React/RendererCore.h>, <React/Graphics.h>, <React/ImageManager.h>.
  • ComponentDescriptorFactory.h: <React/RendererCore.h>, <React/Utils.h>, <React/ComponentRegistry.h>.
  • react/renderer/core DynamicEventPayload.h, DynamicPointerEvent.h, DynamicPropsUtilities.h, ReactRootViewTagGenerator.h: <React/RendererCore.h>.
  • DefaultTurboModules.h: <React/NativeModuleCore.h>.
  • iOS/macOS RCTInstance.h and RCTContextContainerHandling.h: <React/CallInvoker.h>, <React/Utils.h>.

Includes of for-frameworks headers in the same module stay direct, since umbrellas do not re-export them. The react/renderer/core headers and ComponentDescriptorFactory.h now include their own module's umbrella, so the CMake react_renderer_core and react_renderer_componentregistry targets expose their umbrella directory as PUBLIC instead of INTERFACE: core's own sources (EventEmitter.cpp, Props.cpp, ShadowNode.cpp, ...) include these headers and must resolve <React/RendererCore.h> too. Each umbrella is a superset of the headers it replaces, so no declarations are lost. The guards are inert without RN_STRICT_API.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D124320010

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

meta-codesync Bot commented Oct 9, 2026

Copy link
Copy Markdown

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

Summary:
Several "for frameworks" headers included fine-grained headers of public modules directly. A framework author includes a for-frameworks header directly, outside any umbrella, so under `RN_STRICT_API` those includes hit the public module's `UmbrellaGuard.h` `#error`, which `RN_ALLOW_FRAMEWORKS` does not suppress. Switch them to the module umbrellas:

- Image component (`ImageComponentDescriptor.h`, `ImageEventEmitter.h`, `ImageProps.h`, `ImageShadowNode.h`, `ImageState.h`): `<React/View.h>`, `<React/RendererCore.h>`, `<React/Graphics.h>`, `<React/ImageManager.h>`.
- `ComponentDescriptorFactory.h`: `<React/RendererCore.h>`, `<React/Utils.h>`, `<React/ComponentRegistry.h>`.
- `react/renderer/core` `DynamicEventPayload.h`, `DynamicPointerEvent.h`, `DynamicPropsUtilities.h`, `ReactRootViewTagGenerator.h`: `<React/RendererCore.h>`.
- `DefaultTurboModules.h`: `<React/NativeModuleCore.h>`.
- iOS/macOS `RCTInstance.h` and `RCTContextContainerHandling.h`: `<React/CallInvoker.h>`, `<React/Utils.h>`.

Includes of for-frameworks headers in the same module stay direct, since umbrellas do not re-export them. The `react/renderer/core` headers and `ComponentDescriptorFactory.h` now include their own module's umbrella, so the CMake `react_renderer_core` and `react_renderer_componentregistry` targets expose their umbrella directory as `PUBLIC` instead of `INTERFACE`: core's own sources (`EventEmitter.cpp`, `Props.cpp`, `ShadowNode.cpp`, ...) include these headers and must resolve `<React/RendererCore.h>` too. Each umbrella is a superset of the headers it replaces, so no declarations are lost. The guards are inert without `RN_STRICT_API`.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D124320010
@coado
coado force-pushed the export-D124320010 branch from 85142c5 to 8a7faea Compare October 12, 2026 13:48

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