All skills
skilld-dev avatar

/vue-router-skilld

@b9c39cb

ALWAYS use when writing code that imports "vue-router", "vue-router/vite", "vue-router/auto-routes", or "vue-router/experimental". Consult for debugging, best practices, or modifying vue-router, vue router, router, file-based routing, typed routes, data loaders.

Use this Skill: https://skilld.dev/gh/skilld-dev/vue-ecosystem-skills/vue-router-skilld

This session only. Nothing lands on disk.

referencesmigration.md

≈911 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Migration (vue-router v5.3.1)

v4 → v5

Full guide: https://router.vuejs.org/guide/migration/v4-to-v5.html

  • Install vue-router@5; drop unplugin-vue-router if present. The plugin moved into the core package (package.json:104-114):
    • unplugin-vue-router/vite → vue-router/vite
    • other bundlers → vue-router/unplugin/{webpack,rollup,esbuild,rolldown}
    • utilities (VueRouterAutoImports, EditableTreeNode, createRoutesContext, ...) → vue-router/unplugin
    • Volar plugins → vue-router/volar/sfc-typed-router, vue-router/volar/sfc-route-blocks
  • Virtual module virtual:generated-pages → vue-router/auto-routes.
  • Data loaders moved from unplugin-vue-router/data-loaders to vue-router/experimental; Pinia Colada loader to vue-router/experimental/pinia-colada.
  • IIFE build no longer bundles @vue/devtools-api v8 (no IIFE exists for it); affects CDN/script-tag setups (https://github.com/vuejs/router/releases/tag/v5.0.0).
  • Query params in typed routes are optional by default.

v3 → v4 (still relevant when porting old apps)

Full guide: https://router.vuejs.org/guide/migration/v3-to-v4.html (release notes: https://github.com/vuejs/router/releases/tag/v4.0.0)

  • new VueRouter() → createRouter({...}); history is explicit: createWebHistory / createWebHashHistory / createMemoryHistory; mode: 'history' is gone.
  • Catch-all changed: path: '*' → path: '/:pathMatch(.*)*'.
  • router.onReady() removed → router.isReady() returns a Promise.
  • router.app removed → pass the app where needed.
  • scrollBehavior returns { left, top } (was { x, y }).
  • router.currentRoute is a ref: use router.currentRoute.value.
  • next in guards became optional; v5.0.3 added a runtime deprecation warning for it — return a value instead.
  • Dynamic route matching (addRoute/removeRoute) replaced addRoutes.

Deprecations active in v5.3.1

Deprecated Replacement Evidence
vue-router/auto vue-router/auto-routes (+ vue-router/auto-resolver) vue-router-auto.d.ts:1
new NavigationResult(to) in loaders reroute(to) dist/experimental/index.js:1106-1111
next() callback in guards return values dist/index-D7ja2BKs.d.ts:362-393
selectNavigationResult (experimental) removed in v5.0.3 https://github.com/vuejs/router/releases/tag/v5.0.3

In-line changes worth knowing (5.0.3 → 5.3.1)

Cited by release URL; do not trust file copies of changelogs.

Source: SKILL.md on GitHub

No alerts9d3 checks · Risk SAFE
  • Gen Agent Trust Hub9d

    This skill is a technical documentation repository for Vue Router version 5.0.6. It provides detailed API references, migration guides from version 4, and best practices for implementing routing in Vue.js applications. No malicious code, obfuscation, or unauthorized access patterns were detected.

  • Socket9d

    No alerts

  • Snyk9d

    Risk: LOW · No issues

Signed by skilld at b9c39cb. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last week.

Activeupdated last week

README badge

README badge for skilld-dev/vue-ecosystem-skills/vue-router-skilld