Forward declare LeakChecker in UIManager.h (#58091) - #58091
Closed
j-piasecki wants to merge 1 commit into
Closed
Conversation
|
@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
j-piasecki
force-pushed
the
export-D117188750
branch
from
September 7, 2026 10:35
07de741 to
8980c88
Compare
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Under the C++ Stable API RFC,
react/renderer/uimanager:uimanageris a public target whilereact/renderer/leakchecker:leakcheckeris private.UIManager.his an exported header of the uimanager target and is re-exported from the module umbrellaReact/UIManager.h, so it transitively exposed the private module through the blessed public entry point. The private guard is suppressed only byRN_BUILDING, not byRN_UMBRELLA_CONTEXT, so a consumer including<React/UIManager.h>underRN_STRICT_APIwould get a hard error from a header they never named and cannot acknowledge.UIManager.honly needs the type for thestd::unique_ptr<LeakChecker> leakChecker_data member.~UIManager()is already out of line, so a forward declaration is sufficient and the include moves toUIManager.cpp, which already constructs the object. No build config change is needed:leakcheckeris already a non-exported dep of the uimanager target in both BUCK and CMake.UIManager.his the only public or for-frameworks header in ReactCommon that still reachedleakchecker, so the module is now cleanly private.Changelog: [Internal]
Differential Revision: D117188750