feat(vue): Add transaction source to VueRouter instrumentation#5381
Merged
feat(vue): Add transaction source to VueRouter instrumentation#5381
Conversation
15 tasks
lforst
commented
Jul 8, 2022
| const name = formatComponentName(this, false); | ||
| const shouldTrack = Array.isArray(options.trackComponents) | ||
| ? options.trackComponents.includes(name) | ||
| ? options.trackComponents.indexOf(name) > -1 |
Contributor
Author
There was a problem hiding this comment.
Couldn't get tests to work because there was a type error here. I could have messed with tsconfigs but there is an upside of doing indexOf() instead of includes() which is backwards compatibility. I think includes is ES6 only.
Lms24
approved these changes
Jul 8, 2022
packages/vue/src/router.ts
Outdated
|
|
||
| // Determine a name for the routing transaction and where that name came from | ||
| let transactionName: string = to.path; | ||
| let transactionSource: 'url' | 'custom' | 'route' = 'url'; |
Member
There was a problem hiding this comment.
Totally optional but wdyt about extracting'url' | 'custom' | 'route' to a type like in the ReactRouterV3 implementation? Just for consistency...
Contributor
Author
There was a problem hiding this comment.
Right, at the time of opening this I didn't see that we exported the TransactionSource type. Thanks!
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.
Ref: #5345
Set transaction source on the VueRouter instrumentation and update the route types (this more acts like documentation).