Skip to content

Remove dead include from RCTInstance.h - #58181

Open
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D117842042
Open

Remove dead include from RCTInstance.h#58181
j-piasecki wants to merge 2 commits into
react:mainfrom
j-piasecki:export-D117842042

Conversation

@j-piasecki

Copy link
Copy Markdown
Contributor

Summary:
Under the C++ Stable API RFC, jserrorhandler:jserrorhandler is a "for frameworks" module, but it was still reached from a public header:

  • The iOS and macOS RCTInstance.h included react/runtime/ReactInstance.h, which in turn includes jserrorhandler/JsErrorHandler.h. Neither RCTInstance.h names ReactInstance or JsErrorHandler; the only C++ types they use are JSRuntimeFactory and jsinspector_modern::HostTarget, both already included directly. The include is dead and is simply removed.
  • RCTInstance.mm does name both types and was relying on the include transitively, so react/runtime/ReactInstance.h and jserrorhandler/JsErrorHandler.h move to the implementation file on both platforms.

Changelog: [Internal]

Differential Revision: D117842042

Summary:
Classifies `jserrorhandler:jserrorhandler` as a "for frameworks" target under the C++ stable API three-tier visibility model. Adds `#include <react/cxxstableapi/FrameworksGuard.h>` to the module's three exported headers (`ErrorUtils.h`, `JsErrorHandler.h`, `StackTraceParser.h`), and wires the guard dependency into BUCK, CMake and CocoaPods.

Consumers that opt into `RN_STRICT_API` now get a warning if they include these 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: D117842041
Summary:
Under the C++ Stable API RFC, `jserrorhandler:jserrorhandler` is a "for frameworks" module, but it was still reached from a public header:

- The iOS and macOS `RCTInstance.h` included `react/runtime/ReactInstance.h`, which in turn includes `jserrorhandler/JsErrorHandler.h`. Neither `RCTInstance.h` names `ReactInstance` or `JsErrorHandler`; the only C++ types they use are `JSRuntimeFactory` and `jsinspector_modern::HostTarget`, both already included directly. The include is dead and is simply removed.
- `RCTInstance.mm` does name both types and was relying on the include transitively, so `react/runtime/ReactInstance.h` and `jserrorhandler/JsErrorHandler.h` move to the implementation file on both platforms.

Changelog: [Internal]

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

meta-codesync Bot commented Aug 28, 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 D117842042.

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. 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