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

[PLAT-11455] First input delay #401

Closed gingerbenw closed 5 months ago

gingerbenw commented 5 months ago

Goal

Prevent throwing an error in edge cases when performance.getEntriesByType() returns undefined

Changeset

Add additional guard when getting entries for web vitals

Testing

Add unit test to ensure error is not thrown when getEntriesByType returns undefined

github-actions[bot] commented 5 months ago

Browser bundle size

NPM build

Package
Before 179.86 kB
After 180.09 kB
± +232 bytes ⚠️

CDN build

Unminified Minfied Minified + gzipped
Before 86.78 kB 32.63 kB 10.00 kB
After 87.01 kB 32.72 kB 10.01 kB
± +232 bytes ⚠️ +88 bytes ⚠️ +13 bytes ⚠️

Code coverage

Ok File (✨=New File) Lines Branches Functions Statements
🔴 /home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/browser/lib/id-generator.ts 88.88%
(-11.12%)
0%
(-100%)
100%
(+0%)
88.88%
(-11.12%)
/home/runner/work/bugsnag-js-performance/bugsnag-js-performance/packages/platforms/browser/lib/web-vitals.ts 98.3%
(+0.09%)
94.11%
(+1.26%)
100%
(+0%)
98.3%
(+0.09%)

Total:

Lines Branches Functions Statements
91.3%(-0.04%) 80.74%(+0.1%) 92.66%(+0%) 88.8%(-0.03%)

Generated against 8953ee04c957dec76bafadd9b61895faab03325d on 5 February 2024 at 16:51:31 UTC