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

Add ReactNativeSpanFactory class #551

Conversation

yousif-bugsnag
Copy link
Contributor

Goal

Allow platforms to provide their own span factory class that extends the core SpanFactory class in client options.

Adds the outline for a specialised ReactNativeSpanFactory class to support the native integration.

Design

ReactNativeSpanFactory doesn't do anything yet - this PR just puts in place the basic structure for extending the core span factory and will be built upon in subsequent PRs

Testing

Updated some broken unit tests and relied on CI

Copy link

Browser bundle size

NPM build

Package
Before 210.63 kB
After 211.89 kB
± +1,260 bytes ⚠️

CDN build

Unminified Minfied Minified + gzipped
Before 107.59 kB 40.60 kB 11.89 kB
After 107.84 kB 40.67 kB 11.93 kB
± +249 bytes ⚠️ +74 bytes ⚠️ +35 bytes ⚠️

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
/home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/core/lib/core.ts 100%
(+0%)
94.44%
(+0.69%)
92.85%
(+0%)
98.48%
(+0.02%)
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/index.ts 0%
(+0%)
0%
(-100%)
0%
(+0%)
0%
(+0%)
🔴 ✨ /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/react-native/lib/span-factory.ts 66.66%
(+66.66%)
100%
(+100%)
50%
(+50%)
83.33%
(+83.33%)

Total:

Lines Branches Functions Statements
90.14%(-0.07%) 80.14%(-0.54%) 87.77%(-0.12%) 88.91%(-0.05%)

Generated against 591174c on 18 December 2024 at 17:35:20 UTC

Comment on lines 69 to +70
configure (configuration: ReactNativeConfiguration, spanFactory: SpanFactory<ReactNativeConfiguration>) {
this.spanFactory = spanFactory
this.spanFactory = spanFactory as ReactNativeSpanFactory
Copy link
Member

Choose a reason for hiding this comment

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

I'm sure we could update the configure method here so the second parameter can be ReactNativeSpanFactory but totally happy for that to come later

@yousif-bugsnag yousif-bugsnag merged commit 2bdf2b7 into integration/rn-native-integration Dec 19, 2024
43 checks passed
@yousif-bugsnag yousif-bugsnag deleted the PLAT-12942/react-native-span-factory branch December 19, 2024 14:18
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