Skip to content

Clean up Image public header dependencies - #58760

Open
coado wants to merge 4 commits into
react:mainfrom
coado:export-D122534476
Open

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

Conversation

@coado

@coado coado commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Summary:
Keep the Image component's exported headers self-contained and free of implementation-only dependencies.

  • Move the ImageSource and ImageResizeMode fromRawValue/toString implementations from conversions.h into a new conversions.cpp. The header now only declares them, so it no longer exports glog/logging.h and react_native_expect.h. Every consumer of conversions.h (Image props, text input props, and generated component props) already links the Image library in Buck, CocoaPods, and CMake.
  • Drop the unused Android-only MapBuffer.h and MapBufferBuilder.h includes from ImageState.h; nothing in the Image module uses MapBuffer.
  • Declare standard-library dependencies directly in the Image headers (<memory>, <utility>, <optional>, <string>, <cstdint>).

Changelog: [Internal]

Differential Revision: D122534476

Summary:

Migrate React-Fabric mounting headers to consume the RendererCore, Graphics, and Utils stable umbrellas instead of guarded leaf headers. Add the coreUmbrella dependency to the mounting subspec so dynamic-framework consumers receive the owning header.

Avoid RendererDebug.h because its eager utility-template exports change downstream overload lookup; RendererCore already provides the debug flags and declaration types used by mounting.

Drop the `#ifdef ANDROID` include of `configurePlatformColorCacheInvalidationHook.h` from the Graphics umbrella. The Android `PlatformColorParser.h` already includes it, and the explicit include broke Android builds that use the cxx graphics platform headers, where that header does not exist.

Changelog: [Internal]

Differential Revision: D121790104
Summary:

Migrate React-Fabric attributedstring headers to consume stable Debug, FeatureFlags, CSS, Graphics, MapBuffer, RendererCore, Utils, and View umbrellas instead of guarded leaf headers. Add the direct Buck and CocoaPods dependencies required by those public imports.

Avoid RendererDebug.h because its current utility-template export changes downstream overload lookup; RendererCore already provides the debug declaration types used by attributedstring.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D121793359
Summary:
The public `react/renderer/imagemanager/primitives.h` header included the private `react/renderer/debug/debugStringConvertibleUtils.h` for the inline body of `ImageSource::getDebugProps()`. Because the include was unconditional, any strict consumer of `<React/ImageManager.h>` or `<React/Image.h>` (which reaches `primitives.h` through the Image event emitter) hit the private header guard and failed to compile.

Include the public `DebugStringConvertible.h` and `flags.h` headers instead, which provide `SharedDebugStringConvertibleList` and `RN_DEBUG_STRING_CONVERTIBLE`, and keep only the `getDebugProps()` declaration in the header under the existing `RN_DEBUG_STRING_CONVERTIBLE` guard. Move its unchanged implementation into a new `primitives.cpp`, the only place that needs the private debug helpers. Buck, CMake, and CocoaPods already compile every `imagemanager/*.cpp`, so no build-file changes are needed.

Changelog: [Internal]

Differential Revision: D122534446
Summary:
Keep the Image component's exported headers self-contained and free of implementation-only dependencies.

- Move the `ImageSource` and `ImageResizeMode` `fromRawValue`/`toString` implementations from `conversions.h` into a new `conversions.cpp`. The header now only declares them, so it no longer exports `glog/logging.h` and `react_native_expect.h`. Every consumer of `conversions.h` (Image props, text input props, and generated component props) already links the Image library in Buck, CocoaPods, and CMake.
- Drop the unused Android-only `MapBuffer.h` and `MapBufferBuilder.h` includes from `ImageState.h`; nothing in the Image module uses MapBuffer.
- Declare standard-library dependencies directly in the Image headers (`<memory>`, `<utility>`, `<optional>`, `<string>`, `<cstdint>`).

Changelog: [Internal]

Differential Revision: D122534476
@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 Sep 30, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner labels Sep 30, 2026
@meta-codesync

meta-codesync Bot commented Sep 30, 2026

Copy link
Copy Markdown

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

@facebook-github-tools facebook-github-tools Bot added the p: Facebook Partner: Facebook label Sep 30, 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