feat(vue): Register a route provider read off the Vue app - #23793
Draft
logaretm wants to merge 1 commit into
Draft
feat(vue): Register a route provider read off the Vue app#23793logaretm wants to merge 1 commit into
logaretm wants to merge 1 commit into
Conversation
`vue-router` sets `app.config.globalProperties.$router` when it installs, and the SDK is already given the app, so the provider needs no new option and no router passed to the tracing integration. Registered from `init()`, so route parameterization no longer depends on tracing being enabled and works for users who never pass `router` to `browserTracingIntegration`. The router is looked up per call rather than captured, because `app.use(router)` may run either side of `Sentry.init()`. 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 navigation instrumentation still names the span after the route name when the user asked for it.
Contributor
size-limit report 📦
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registers a route provider for Vue, read off the Vue app the SDK is already given.
vue-routersetsapp.config.globalProperties.$routerwhen it installs, so the provider needs no new option and no router passed to the tracing integration. That means it works for users who never passroutertobrowserTracingIntegration, and route parameterization no longer depends on tracing being enabled.The router is looked up per call rather than captured at registration, because
app.use(router)may legitimately run either side ofSentry.init().Returns the matched path rather than
route.name, even underrouteLabel: 'name'. Callers seturl.templatefrom this and a route name is an identifier, not a template. The navigation instrumentation still names the span after the route name when the user asked for it.Part of #23556