Skip to content

Forward declare LeakChecker in UIManager.h (#58091) - #58091

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

Forward declare LeakChecker in UIManager.h (#58091)#58091
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D117188750

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Aug 24, 2026

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

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

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-codesync meta-codesync Bot changed the title Forward declare LeakChecker in UIManager.h Forward declare LeakChecker in UIManager.h (#58091) Sep 7, 2026
@meta-codesync meta-codesync Bot closed this in ff3ea5e Sep 9, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 9, 2026
@meta-codesync

meta-codesync Bot commented Sep 9, 2026

Copy link
Copy Markdown

This pull request has been merged in ff3ea5e.

shashikant-panchal pushed a commit to shashikant-panchal/react-native that referenced this pull request Sep 10, 2026
Summary:
Pull Request resolved: react#58091

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]

Reviewed By: christophpurrer

Differential Revision: D117188750

fbshipit-source-id: c607a8c3a9d8208bbffa66ecf13dcf44102cbce4
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.

1 participant