Skip to content

Keep ImageManager primitives free of private debug headers - #58792

Closed
coado wants to merge 2 commits into
react:mainfrom
coado:export-D122534446
Closed

coado wants to merge 2 commits into
react:mainfrom
coado:export-D122534446

Conversation

@coado

@coado coado commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

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

Dawid Małecki and others added 2 commits October 1, 2026 01:23
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]

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

meta-codesync Bot commented Oct 1, 2026

Copy link
Copy Markdown

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

coado added a commit to coado/react-native that referenced this pull request Oct 1, 2026
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

@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.

coado added a commit to coado/react-native that referenced this pull request Oct 1, 2026
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]

___

Reviewed By: cortinico

Differential Revision: D122534446
@meta-codesync meta-codesync Bot closed this in e69f61b Oct 2, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Oct 2, 2026
@meta-codesync

meta-codesync Bot commented Oct 2, 2026

Copy link
Copy Markdown

This pull request has been merged in e69f61b.

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