Remove remaining private includes from scheduler headers - #58137
Open
j-piasecki wants to merge 3 commits into
Open
Remove remaining private includes from scheduler headers#58137j-piasecki wants to merge 3 commits into
j-piasecki wants to merge 3 commits into
Conversation
Summary: Classifies `react/renderer/scheduler:scheduler` as a "for frameworks" target under the three-tier C++ stable API visibility model. Consumers that opt into `RN_STRICT_API` now get a warning if they include its headers directly, which they can acknowledge with `RN_ALLOW_FRAMEWORKS`; without that flag the guards are inert, so no existing build changes behaviour. Changelog: [Internal] Differential Revision: D116909091
Summary: Under the C++ Stable API RFC, `react/renderer/scheduler:scheduler` is a "for frameworks" module while `react/performance/cdpmetrics:cdpmetrics` and `react/renderer/viewtransition:viewtransition` are private. `Scheduler.h` is an exported header of the scheduler target and included all three private headers, so it transitively exposed them to consumers. `ViewTransitionModule.h` already carries the private-tier guard, so this was an active violation and not just a latent one. `Scheduler.h` only needs these types for data members. `viewTransitionModule_` was already a `std::shared_ptr`, so a forward declaration is sufficient. The two CDP reporters were held as `std::optional`, which requires a complete type, so they become `std::unique_ptr`. They are constructed conditionally behind feature flags and only ever handed to `PerformanceEntryReporter` as raw pointers, so ownership and lifetime are unchanged. `~Scheduler()` is already out of line, so the incomplete types are fine. `<optional>` and `<shared_mutex>` are now included explicitly, since they were previously pulled in transitively through the cdpmetrics headers. `Scheduler.h` is the only header in ReactCommon that reached either module, so both are now cleanly private. No build config change is needed: `cdpmetrics` and `viewtransition` are already non-exported deps of the scheduler target. Changelog: [Internal] Differential Revision: D116909092
Summary: Under the C++ Stable API RFC, `react/renderer/scheduler:scheduler` is a "for frameworks" module, but its exported headers still reached two private modules: - `Scheduler.h` included `react/performance/timeline/PerformanceEntryReporter.h` and `react/renderer/observers/events/EventPerformanceLogger.h`. Both are only used as `std::shared_ptr` data members, so forward declarations are sufficient and the includes move to `Scheduler.cpp`. - `SchedulerToolbox.h` included `react/renderer/leakchecker/LeakChecker.h` but never named anything from it. `leakchecker` is not even a dependency of the scheduler target, so the include is dead and is simply removed. `react/renderer/observers/events:events` had no other header-level consumer in ReactCommon, so it is now cleanly private. `react/performance/timeline:timeline` is still reached from `RuntimeScheduler.h` and `NativePerformance.h`, which are handled separately. After this, no scheduler header includes a private module directly. Changelog: [Internal] Differential Revision: D116909093
|
@j-piasecki has exported this pull request. If you are a Meta employee, you can view the originating Diff in D116909093. |
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/scheduler:scheduleris a "for frameworks" module, but its exported headers still reached two private modules:Scheduler.hincludedreact/performance/timeline/PerformanceEntryReporter.handreact/renderer/observers/events/EventPerformanceLogger.h. Both are only used asstd::shared_ptrdata members, so forward declarations are sufficient and the includes move toScheduler.cpp.SchedulerToolbox.hincludedreact/renderer/leakchecker/LeakChecker.hbut never named anything from it.leakcheckeris not even a dependency of the scheduler target, so the include is dead and is simply removed.react/renderer/observers/events:eventshad no other header-level consumer in ReactCommon, so it is now cleanly private.react/performance/timeline:timelineis still reached fromRuntimeScheduler.handNativePerformance.h, which are handled separately.After this, no scheduler header includes a private module directly.
Changelog: [Internal]
Differential Revision: D116909093