`RCT_EXPORT_METHOD(foo:(...))` — the most common way to declare an iOS native
module method — parses as a macro-expression (an ERROR node), NOT a
`method_definition`, so the ObjC extractor never made a node for it. The iOS half
of a native module was invisible: a JS call to it couldn't resolve, and the
cross-platform pairing had nothing to pair. Only regular `- (void)foo` ObjC
methods were nodes.
The React Native bridge resolver now implements the `extract()` framework hook
for `.m`/`.mm` files: it reuses the existing `RCT_EXPORT_MODULE` /
`RCT_EXPORT_METHOD` / `RCT_REMAP_METHOD` source parser to emit a method node per
exported method, named by its JS-visible name (the selector's first keyword, or
the explicit `RCT_REMAP_METHOD` JS name) so it lines up with the Android
`@ReactMethod` method and the JS callsite. Node id is prefixed `rn-export:`.
Measured on react-native-device-info: JS→ObjC `calls` went 7 → 37, and Java↔ObjC
cross-platform pairs 22 → 29 (ObjC↔C++ 8 → 24) — the iOS bridge surface is now
visible and connected. Full suite green; node count grows only by the newly-
visible iOS methods.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The classic React Native bridge links a JS callsite to a native module method,
but only ONE platform's impl — the other (the iOS method when JS resolved to
Android, or vice versa) looked like nothing called it and editing it showed no
blast radius. Same gap fixed for Expo, now for the classic bridge.
`rnCrossPlatformEdges`: a native method (java/kotlin/objc/cpp) that HAS a JS-side
`calls` edge is a confirmed bridge method; link it to the same-named native
method in another language (the other platform's impl), both directions. Names
are normalized to the first selector keyword (`getFreeDiskStorage:` →
`getFreeDiskStorage`) so an iOS selector lines up with the bare Android name.
RN runtime-infrastructure methods (addListener / getConstants / getName / … —
present on every module) are excluded so they don't cross-link unrelated modules
in a multi-module repo.
Measured on react-native-device-info: 152 cross-platform pairs (Java↔ObjC↔C++);
the classic JS→Java/ObjC bridge itself is unchanged. Heuristic edges (provenance
`heuristic`, `synthesizedBy:'rn-cross-platform'`). Full suite green; node count
stable. (Note: iOS methods written with the `RCT_EXPORT_METHOD` macro parse as a
macro, not a method node, so only regular ObjC method impls pair today — macro
extraction is a separate follow-up.)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>