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.
Goal
- Two paths, pick the one that gives us cleaner UX:
- 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.
- 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.
TurboModulePerfLoggeronly fires for TurboModules. Apps on the old architecture still talk to native throughNativeModules.*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.Goal
BridgeNativeModulePerfLogger(analogous toTurboModulePerfLogger, available on old arch) and install a Sentry logger fromRNSentryPackage/RNSentry.mmthe same way Issue 1 does.NativeModulesat runtime by replacing theNativeModules[name]getter with aProxythat records call start/end. Cheaper to ship but adds a JS-side hot-path cost on every native call.turbo_module.arch: "new" | "legacy"so analyses can split them.isTurboModuleEnabled()/isFabricEnabled()detection frompackages/core/src/js/utils/environment.tsto choose the right code path automatically.