Skip to content

Narrow nativemodule/core cxxreact dep to tracesection + module#57445

Closed
javache wants to merge 3 commits into
react:mainfrom
javache:export-D108786500
Closed

Narrow nativemodule/core cxxreact dep to tracesection + module#57445
javache wants to merge 3 commits into
react:mainfrom
javache:export-D108786500

Conversation

@javache

@javache javache commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary:
Drop the broad cxxreact:bridge dep from nativemodule/core in favor of the narrower pieces it actually needs: cxxreact:tracesection for TraceSection.h, plus the already-present cxxreact:module.

Also extracts MoveWrapper to react/utils/MoveWrapper.h (a tiny stdlib-only utility) — it was previously living in cxxreact:bridge and is the one source-level dep that prevented the narrowing. The cxxreact copy remains in place (out of scope for this diff) but JavaTurboModule.cpp now uses the new location.

Cleanup: drops dead exclude_patterns for CallbackWrapper.h / LongLivedObject.h from exported_headers (those files no longer exist) and collapses multi-line glob formatting.

Verified with buck2 uquery 'somepath(...:coreAndroid, ...:cxxreact:bridgeAndroid)' — no path; the edge is gone.

Changelog:
[Internal]

Reviewed By: zeyap

Differential Revision: D108786500

javache and others added 3 commits July 6, 2026 03:09
Summary:
Move `handleJSError` from `cxxreact/ErrorUtils.h` (header-inline) to `jserrorhandler/ErrorUtils.{h,cpp}` (declared + linked). Inverts the cyclic dep so `jserrorhandler` becomes a standalone leaf and `cxxreact:bridge` can be narrowed out of more consumers in follow-ups.

The old `<cxxreact/ErrorUtils.h>` include path continues to work via a deprecated `#warning` forwarder header that includes the new location. `cxxreact:bridge` now depends on `jserrorhandler:jserrorhandler` so existing consumers of the deprecated path still link cleanly. `jserrorhandler/BUCK` drops its `cxxreact:bridge` dep (and the matching `React-cxxreact` podspec entry).

Changelog:
[Internal]

Differential Revision: D108786498
Summary:
Narrow the runtimescheduler's cxxreact dep. Previously runtimescheduler depended on the full `cxxreact:bridge` target; it only needs `cxxreact:tracesection` (for `TraceSection.h`) plus `jserrorhandler:jserrorhandler` (for `handleJSError`, since Phase 1 moved `ErrorUtils` there) plus `jsi` directly. Also adds `jsi` to the explicit dep list — `runtimescheduler` was previously pulling it in transitively through `cxxreact:bridge`.

Verified with `buck2 uquery 'somepath(...:runtimeschedulerAndroid, ...:bridgeAndroid)'` — no path; the edge is gone.

Changelog:
[Internal]

Differential Revision: D108786501
Summary:
Drop the broad `cxxreact:bridge` dep from `nativemodule/core` in favor of the narrower pieces it actually needs: `cxxreact:tracesection` for `TraceSection.h`, plus the already-present `cxxreact:module`.

Also extracts `MoveWrapper` to `react/utils/MoveWrapper.h` (a tiny stdlib-only utility) — it was previously living in `cxxreact:bridge` and is the one source-level dep that prevented the narrowing. The cxxreact copy remains in place (out of scope for this diff) but `JavaTurboModule.cpp` now uses the new location.

Cleanup: drops dead `exclude_patterns` for `CallbackWrapper.h` / `LongLivedObject.h` from `exported_headers` (those files no longer exist) and collapses multi-line glob formatting.

Verified with `buck2 uquery 'somepath(...:coreAndroid, ...:cxxreact:bridgeAndroid)'` — no path; the edge is gone.

Changelog:
[Internal]

Reviewed By: zeyap

Differential Revision: D108786500
@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 Jul 6, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108786500.

@meta-codesync meta-codesync Bot closed this in 703e362 Jul 6, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jul 6, 2026
@meta-codesync

meta-codesync Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request has been merged in 703e362.

@javache javache deleted the export-D108786500 branch July 6, 2026 14:57
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 Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant