-
Notifications
You must be signed in to change notification settings - Fork 6
Add svelte kit routing provider #632
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
Conversation
Browser bundle sizeNPM build
CDN build
Code coverage
Total:
Generated against c0284d3 on 10 June 2025 at 16:40:15 UTC |
731a1af
to
829181d
Compare
829181d
to
6ea8820
Compare
a345983
to
ee74c31
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a new SvelteKit routing provider for Bugsnag performance to instrument route-change spans in SvelteKit apps, along with fixtures and tests.
- Introduces
@bugsnag/svelte-kit-performance
package andSvelteKitRoutingProvider
implementation - Adds unit tests for the routing provider and browser fixtures for end-to-end scenarios
- Updates build configs, TypeScript settings, and project metadata (package.json, CHANGELOG)
Reviewed Changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
test/browser/features/fixtures/packages/svelte-kit/src/routes/contact/+page.svelte | Add contact page fixture |
test/browser/features/fixtures/packages/svelte-kit/src/routes/+page.svelte | Add home page fixture |
test/browser/features/fixtures/packages/svelte-kit/src/routes/+layout.svelte | Add layout that initializes BugsnagPerformance |
test/browser/features/fixtures/packages/svelte-kit/src/routes/+layout.js | Add prerender setting and load function |
test/browser/features/fixtures/packages/svelte-kit/src/lib/index.js | Placeholder lib folder |
test/browser/features/fixtures/packages/svelte-kit/src/app.html | SvelteKit app HTML template |
test/browser/features/fixtures/packages/svelte-kit/src/200.html | Static 200.html fallback page |
test/browser/features/fixtures/packages/svelte-kit/package.json | SvelteKit fixture package metadata |
test/browser/features/fixtures/packages/svelte-kit/jsconfig.json | JS config for SvelteKit |
test/browser/features/fixtures/packages/svelte-kit/.npmrc | Enforce engine-strict |
test/browser/features/fixtures/packages/svelte-kit/.gitignore | Git ignore for SvelteKit fixture |
packages/svelte-kit/tsconfig.json | TS config for the routing provider package |
packages/svelte-kit/tests/svelte-kit-routing-provider.test.ts | Unit tests for SvelteKitRoutingProvider |
packages/svelte-kit/rollup.config.mjs | Rollup build configuration |
packages/svelte-kit/package.json | @bugsnag/svelte-kit-performance package metadata |
packages/svelte-kit/lib/svelte-kit-routing-provider.ts | Implementation of the routing provider |
packages/svelte-kit/lib/index.ts | Exports the routing provider |
packages/svelte-kit/README.md | Documentation and usage example |
packages/svelte-kit/.gitignore | Git ignore for the routing provider package |
CHANGELOG.md | Changelog entry for the new routing provider |
Sorry @yousif-bugsnag - last one, I promise! |
Goal
Support instrumentation of route change spans when using SvelteKit
Design
By using the available hooks from SvelteKit for
beforeNavigate
andafterNavigate
we can directly read the/[route]
instead of an absolute URL, meaning theresolveRoute
method simply needs to convert it to a string. As users never interact withresolveRoute
this implementation should work for this case.Changeset
Added a new
svelte-kit-performance
library which exports aSvelteKitRoutingProvider
Testing
Added unit tests
Added end to end tests matching coverage with vue-router, etc