Skip to content

Remove remaining private includes from scheduler headers (#58137) - #58137

Closed
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D116909093
Closed

Remove remaining private includes from scheduler headers (#58137)#58137
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D116909093

Conversation

@j-piasecki

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

Copy link
Copy Markdown
Contributor

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

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

meta-codesync Bot commented Aug 25, 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 D116909093.

…react#58136)

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
@meta-codesync meta-codesync Bot changed the title Remove remaining private includes from scheduler headers Remove remaining private includes from scheduler headers (#58137) Sep 7, 2026
@meta-codesync meta-codesync Bot closed this in 9b2a54e Sep 8, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Sep 8, 2026
@meta-codesync

meta-codesync Bot commented Sep 8, 2026

Copy link
Copy Markdown

This pull request has been merged in 9b2a54e.

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

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]

Reviewed By: javache

Differential Revision: D116909093

fbshipit-source-id: 84ecaf003d983034f2a1fa724a034c7050343443
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