Skip to content

Forward declare LeakChecker in UIManager.h - #58091

Open
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D117188750
Open

Forward declare LeakChecker in UIManager.h#58091
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D117188750

Conversation

@j-piasecki

Copy link
Copy Markdown
Contributor

Summary:
Under the C++ Stable API RFC, react/renderer/uimanager:uimanager is a public target while react/renderer/leakchecker:leakchecker is private. UIManager.h is an exported header of the uimanager target and is re-exported from the module umbrella React/UIManager.h, so it transitively exposed the private module through the blessed public entry point. The private guard is suppressed only by RN_BUILDING, not by RN_UMBRELLA_CONTEXT, so a consumer including <React/UIManager.h> under RN_STRICT_API would get a hard error from a header they never named and cannot acknowledge.

UIManager.h only needs the type for the std::unique_ptr<LeakChecker> leakChecker_ data member. ~UIManager() is already out of line, so a forward declaration is sufficient and the include moves to UIManager.cpp, which already constructs the object. No build config change is needed: leakchecker is already a non-exported dep of the uimanager target in both BUCK and CMake.

UIManager.h is the only public or for-frameworks header in ReactCommon that still reached leakchecker, so the module is now cleanly private.

Changelog: [Internal]

Differential Revision: D117188750

Summary:
Classifies `react/renderer/leakchecker:leakchecker` as a private target under the three-tier C++ stable API visibility model. Consumers that opt into `RN_STRICT_API` now get an error if they include its headers; without that flag the guards are inert, so no existing build changes behaviour. The pod that ships the module, `React-Fabric`, already depends on `React-cxxstableapi` and is already marked as a React Native build, so no podspec change is needed.

Changelog: [Internal]

Differential Revision: D117188751
Summary:
Under the C++ Stable API RFC, `react/renderer/uimanager:uimanager` is a public target while `react/renderer/leakchecker:leakchecker` is private. `UIManager.h` is an exported header of the uimanager target and is re-exported from the module umbrella `React/UIManager.h`, so it transitively exposed the private module through the blessed public entry point. The private guard is suppressed only by `RN_BUILDING`, not by `RN_UMBRELLA_CONTEXT`, so a consumer including `<React/UIManager.h>` under `RN_STRICT_API` would get a hard error from a header they never named and cannot acknowledge.

`UIManager.h` only needs the type for the `std::unique_ptr<LeakChecker> leakChecker_` data member. `~UIManager()` is already out of line, so a forward declaration is sufficient and the include moves to `UIManager.cpp`, which already constructs the object. No build config change is needed: `leakchecker` is already a non-exported dep of the uimanager target in both BUCK and CMake.

`UIManager.h` is the only public or for-frameworks header in ReactCommon that still reached `leakchecker`, so the module is now cleanly private.

Changelog: [Internal]

Differential Revision: D117188750
@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 Aug 24, 2026
@facebook-github-tools facebook-github-tools Bot added p: Software Mansion Partner: Software Mansion Partner p: Facebook Partner: Facebook labels Aug 24, 2026
@meta-codesync

meta-codesync Bot commented Aug 24, 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 D117188750.

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