bugsnag / bugsnag-js-performance

Monitor the performance of your JavaScript (web and React Native) and see the results in your BugSnag dashboard.
https://docs.bugsnag.com/performance/integration-guides
MIT License
4 stars 1 forks source link

feat(react-native): support remote debugging in chrome #468

Closed yousif-bugsnag closed 4 days ago

yousif-bugsnag commented 1 week ago

Goal

Support remote debugging via Chrome for React Native apps.

Updates the React Native client to avoid making synchronous native calls if we detect that remote debugging is enabled (see #370).

Design

Currently there are only two synchronous native calls made, both during initialisation, to getDeviceInfo (to get native device metadata( and requestEntropy to (initialise the entropy source for the id generator).

If remote debugging is detected we simply don't make these calls - this means that when running in the debugger some device-related resource attributes will be missing from resource spans, and the id generator will fall back to using a JS entropy source, but the client should otherwise work as expected.

Testing

Tested manually with the remote debugger

github-actions[bot] commented 1 week ago

Browser bundle size

NPM build

Package
Before 190.22 kB
After 190.22 kB
± No change

CDN build

Unminified Minfied Minified + gzipped
Before 95.42 kB 35.80 kB 10.84 kB
After 95.42 kB 35.80 kB 10.84 kB
± No change No change No change

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/id-generator.ts 100%
(+0%)
100%
(+0%)
88.88%
(+0%)
97.22%
(+0.08%)

Total:

Lines Branches Functions Statements
87.13%(-0.13%) 78.33%(-0.76%) 88.06%(+0.02%) 83.93%(-0.15%)

Generated against b36620bdbee7ad137ad57960ef4d8d3fe4b9fbcc on 28 June 2024 at 11:16:15 UTC