SIGN IN SIGN UP

feat(vue): Register Vue route provider (#23793)

Registers a route provider for Vue so route parameterization works
without tracing and without passing `router` to
`browserTracingIntegration`.

The provider is registered in `vueIntegration`'s `setup`, so it picks up
`app` whether it's passed to `init` or to the integration; a
`routeProvider` passed to `init` takes precedence. On Vue 3 the router
is read off `app.config.globalProperties.$router` on each call, since
`app.use(router)` may run either side of `Sentry.init()`. Vue 2 only
exposes the router on instances, so a `beforeCreate` mixin picks it up
from the root `new Vue({ router })`. Until that instance exists nothing
resolves, so the Vue 2 pageload span keeps the raw URL.

`resolve()` matches the router's own location, not the browser's, so
URLs are converted first: the path comes from the hash in hash mode, and
the router's `base` is stripped otherwise (Vue Router 3 and 4).

Returns the matched path rather than `route.name`, even under
`routeLabel: 'name'`. Callers set `url.template` from this, and a route
name is an identifier, not a template.

The factory is exported as `_INTERNAL_createVueRouteProvider` for Nuxt;
it isn't meant for users.

Part of #23556
A
Abdelrahman Awad committed
de0041583ed6d5116e2618929570a4dc876e3703
Parent: bad3325
Committed by GitHub <noreply@github.com> on 10/1/2026, 11:58:47 AM