Skip to content

Forward-declare private-target types in RuntimeScheduler.h (#58271) - #58271

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

Forward-declare private-target types in RuntimeScheduler.h (#58271)#58271
j-piasecki wants to merge 1 commit into
react:mainfrom
j-piasecki:export-D117838094

Conversation

@j-piasecki

@j-piasecki j-piasecki commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary:

Replaces PerformanceEntryReporter and ShadowTreeRevisionConsistencyManager with forward declarations and removes the now redundant ShadowTreeRevisionConsistencyManager include from the forked headers.

Changelog:
[General][Changed] - RuntimeScheduler.h no longer transitively includes PerformanceEntryReporter.h or ShadowTreeRevisionConsistencyManager.h; include them directly where the complete types are needed

Differential Revision: D117838094

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

meta-codesync Bot commented Sep 1, 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 D117838094.

j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 2, 2026
Summary:

`RuntimeScheduler.h` included `PerformanceEntryReporter.h` and `ShadowTreeRevisionConsistencyManager.h` solely to name two pointer parameters. Both belong to targets classified private under the three-tier C++ stable API visibility model, and `RuntimeScheduler.h` is reachable from for-frameworks headers, so a consumer opting into `RN_STRICT_API` got a hard error out of `PrivateGuard.h` from a header they never named — one that neither `RN_ALLOW_FRAMEWORKS` nor an umbrella include can suppress.

Replace both with forward declarations, and drop the now-redundant `ShadowTreeRevisionConsistencyManager.h` include from the two scheduler forks, which take the declarations from `RuntimeScheduler.h`. Two translation units were relying on the transitive include and now include the header directly: `RuntimeScheduler_Modern.cpp` (calls `reportLongTask`) and `ReactInstance.cpp` (calls `PerformanceEntryReporter::getInstance`). No build wiring changes — both targets already depend on `react/performance/timeline` and `react/renderer/consistency` for their own sources.

Changelog:
[General][Changed] - `RuntimeScheduler.h` no longer transitively includes `PerformanceEntryReporter.h` or `ShadowTreeRevisionConsistencyManager.h`; include them directly where the complete types are needed

Differential Revision: D117838094
@meta-codesync meta-codesync Bot changed the title Forward-declare private-target types in RuntimeScheduler.h Forward-declare private-target types in RuntimeScheduler.h (#58271) Sep 2, 2026
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 4, 2026
Summary:

`RuntimeScheduler.h` included `PerformanceEntryReporter.h` and `ShadowTreeRevisionConsistencyManager.h` solely to name two pointer parameters. Both belong to targets classified private under the three-tier C++ stable API visibility model, and `RuntimeScheduler.h` is reachable from for-frameworks headers, so a consumer opting into `RN_STRICT_API` got a hard error out of `PrivateGuard.h` from a header they never named — one that neither `RN_ALLOW_FRAMEWORKS` nor an umbrella include can suppress.

Replace both with forward declarations, and drop the now-redundant `ShadowTreeRevisionConsistencyManager.h` include from the two scheduler forks, which take the declarations from `RuntimeScheduler.h`. Two translation units were relying on the transitive include and now include the header directly: `RuntimeScheduler_Modern.cpp` (calls `reportLongTask`) and `ReactInstance.cpp` (calls `PerformanceEntryReporter::getInstance`). No build wiring changes — both targets already depend on `react/performance/timeline` and `react/renderer/consistency` for their own sources.

Changelog:
[General][Changed] - `RuntimeScheduler.h` no longer transitively includes `PerformanceEntryReporter.h` or `ShadowTreeRevisionConsistencyManager.h`; include them directly where the complete types are needed

Differential Revision: D117838094
j-piasecki added a commit to j-piasecki/react-native that referenced this pull request Sep 7, 2026
Summary:

`RuntimeScheduler.h` included `PerformanceEntryReporter.h` and `ShadowTreeRevisionConsistencyManager.h` solely to name two pointer parameters. Both belong to targets classified private under the three-tier C++ stable API visibility model, and `RuntimeScheduler.h` is reachable from for-frameworks headers, so a consumer opting into `RN_STRICT_API` got a hard error out of `PrivateGuard.h` from a header they never named — one that neither `RN_ALLOW_FRAMEWORKS` nor an umbrella include can suppress.

Replace both with forward declarations, and drop the now-redundant `ShadowTreeRevisionConsistencyManager.h` include from the two scheduler forks, which take the declarations from `RuntimeScheduler.h`. Two translation units were relying on the transitive include and now include the header directly: `RuntimeScheduler_Modern.cpp` (calls `reportLongTask`) and `ReactInstance.cpp` (calls `PerformanceEntryReporter::getInstance`). No build wiring changes — both targets already depend on `react/performance/timeline` and `react/renderer/consistency` for their own sources.

Changelog:
[General][Changed] - `RuntimeScheduler.h` no longer transitively includes `PerformanceEntryReporter.h` or `ShadowTreeRevisionConsistencyManager.h`; include them directly where the complete types are needed

Differential Revision: D117838094
Summary:

Replaces `PerformanceEntryReporter` and `ShadowTreeRevisionConsistencyManager` with forward declarations and removes the now redundant `ShadowTreeRevisionConsistencyManager` include from the forked headers.

Changelog:
[General][Changed] - `RuntimeScheduler.h` no longer transitively includes `PerformanceEntryReporter.h` or `ShadowTreeRevisionConsistencyManager.h`; include them directly where the complete types are needed

Differential Revision: D117838094
@meta-codesync meta-codesync Bot closed this in 7aff51e 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 7aff51e.

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