Skip to content

Legacy NativeModules wrapper for the old architecture #6166

Closed
1 of 1 issue completed
Closed

Description

@alwx

TurboModulePerfLogger only fires for TurboModules. Apps on the old architecture still talk to native through NativeModules.* over the bridge. To keep the feature useful for the long tail of un-migrated apps, mirror the same instrumentation surface on top of the legacy bridge.

#6477

  • Two paths, pick the one that gives us cleaner UX:
    1. Native: use React Native's BridgeNativeModulePerfLogger (analogous to TurboModulePerfLogger, available on old arch) and install a Sentry logger from RNSentryPackage / RNSentry.mm the same way Issue 1 does.
    2. JS proxy: wrap NativeModules at runtime by replacing the NativeModules[name] getter with a Proxy that records call start/end. Cheaper to ship but adds a JS-side hot-path cost on every native call.
  • Default to path (1); fall back to (2) only on RN versions where the bridge logger isn't accessible.
  • Feed the same aggregator + crash-context surface from Issues 2 & 3 — the consumer side should not care whether the data came from a TurboModule or a legacy NativeModule. Add turbo_module.arch: "new" | "legacy" so analyses can split them.
  • Respect isTurboModuleEnabled() / isFabricEnabled() detection from packages/core/src/js/utils/environment.ts to choose the right code path automatically.

Sub-issues

Sub-issues

1 of 1 Issues completed
Loading 1 sub-issues

Activity

  1. linear-code commented on May 18, 2026

    @linear-code
  2. added 3 commits that reference this issue on Jul 23, 2026
    e8e56a6
    ffb6280
    67ec600
  3. added a commit that references this issue on Jul 30, 2026
    aa4c920
  4. github-actions commented on Aug 6, 2026

    @github-actions
    Contributor

    A PR closing this issue has just been released 🚀

    This issue was referenced by PR #6504, which was included in the 8.22.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions