Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not delegate automatic navigation spans to native SDK #559

Conversation

yousif-bugsnag
Copy link
Contributor

Goal

Since we can't get accurate rendering metrics for automatic navigation spans (i.e. those created by the navigation library plugins) because they can only be created after the navigation has occurred, we should not be delegating these spans to the native SDK in the first place.

This PR adds support for internally excluding certain first-class spans from the native integration, and ensures that only manual navigation spans are delegated to the native SDK.

Design

  • Moved the navigation span logic into ReactNativeSpanFactory
  • Added a new internal ReactNativeSpanOptions interface to allow callers to disable the native span functionality for individual spans.

Testing

Updated unit tests

Copy link

github-actions bot commented Jan 8, 2025

Browser bundle size

NPM build

Package
Before 212.81 kB
After 212.60 kB
± -214 bytes 🎉

CDN build

Unminified Minfied Minified + gzipped
Before 108.02 kB 40.89 kB 11.99 kB
After 107.98 kB 40.93 kB 12.00 kB
± -36 bytes 🎉 +43 bytes ⚠️ +5 bytes ⚠️

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/index.ts 0%
(+0%)
0%
(+0%)
100%
(+100%)
0%
(+0%)
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/span-factory.ts 97.56%
(-2.44%)
28.57%
(-58.38%)
68.75%
(-31.25%)
95%
(-5%)

Total:

Lines Branches Functions Statements
90.36%(+0.07%) 77.73%(-2.6%) 87.35%(-0.7%) 89.17%(+0.1%)

Generated against 27d161b on 8 January 2025 at 15:27:24 UTC

Copy link
Member

@gingerbenw gingerbenw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! 👌🏻

@yousif-bugsnag yousif-bugsnag merged commit b6035e9 into integration/rn-native-integration Jan 9, 2025
43 checks passed
@yousif-bugsnag yousif-bugsnag deleted the PLAT-13377/navigation-spans-rendering-metrics branch January 9, 2025 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants