Forward declare LeakChecker in UIManager.h - #58091
Open
j-piasecki wants to merge 2 commits into
Open
Conversation
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
|
@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D117188750. |
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