Conversation
| // afterEach fires for the initial navigation when the app is mounted via app.use(router). | ||
| // In tests without mounting, an explicit router.push() is needed to trigger the hook. | ||
| router.afterEach((to, _from, failure) => { | ||
| if (failure && !isNavigationFailure(failure, NavigationFailureType.duplicated)) { |
There was a problem hiding this comment.
Vue Router's afterEach fires even for navigations blocked by a guard, not just successful ones. The failure parameter tells you why. We skip cancelled (preempted by another navigation) and aborted (guard explicitly blocked it). duplicated (same route you're already on) we let through - that's not really a failure, the URL just didn't change because it was already there.
87699a2 to
fd5fb81
Compare
c870b10 to
9a8f915
Compare
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
fd5fb81 to
9de709a
Compare
9a8f915 to
9a4e80e
Compare
9de709a to
95cd15e
Compare
9a4e80e to
4e0030b
Compare
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 543ef1c | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
3a8e944 to
8c710e0
Compare
95cd15e to
d87a4b9
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3ce5ece0d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
aaa50ac to
90c0728
Compare
| return this | ||
| } | ||
|
|
||
| withVueApp() { |
There was a problem hiding this comment.
Maybe we could reuse the repeated code with nextjs here?
- replace @vue/test-utils usage with manual mocks in addVueError.spec.ts to avoid Object.fromEntries incompatibility on Chrome 63 - add @vue/test-utils to swc transpilation list in karma.base.conf.js for older browser compat - add host: true to vue-router-app vite config to fix E2E ERR_CONNECTION_REFUSED
Remove strictPort from vite.config.ts and switch from a hardcoded url to wait.stdout with a named capture group, consistent with how the nextjs app is configured.
Vite wraps 'Local' in ANSI bold codes when FORCE_COLOR is set, breaking the regex. Setting NO_COLOR=1 in the webServer env disables that.
…rors Edge reports a missing /favicon.ico as a console.error, which trips the E2E teardown check. Adding an empty data: favicon prevents the request.
398eb6f to
b327ea2
Compare
… with React Also aligns computeViewName tests to cases.forEach() format and adds a catch-all route test case documenting the /:pathMatch(.*)* behavior.
Motivation
After this PR, navigating between routes in a Vue app automatically creates RUM views with parameterized names instead of raw URLs. It also improves the
component_stackin Vue error tracking to include the full parent component hierarchy rather than just the component name.Changes
Exports a wrapped
createRouterfrom@datadog/browser-rum-vue/vue-router-v4as a drop-in for the standardvue-routerimport:On each navigation,
afterEachcallsstartView()with the parameterized route name (/users/:idrather than/users/42). Failed navigations (blocked by guards, cancelled, duplicated) and query-only changes are filtered out.component_stacknow walks theComponentInternalInstanceparent chain to build the full hierarchy, matching what Vue DevTools shows.The PR includes a
vue-router-apptest app and E2E tests for both features.Requires
vuePlugin({ router: true })alongside this import. That setstrackViewsManually: trueat init so the SDK's built-in URL tracking does not race with the router integration.Test instructions
yarn test:unit --spec packages/rum-vue/src/domain/router/startVueRouterView.spec.ts yarn test:unit --spec packages/rum-vue/src/domain/router/vueRouter.spec.ts yarn test:e2e:init yarn test:e2e -g "vue plugin"Checklist