Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/router
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.4.4
Choose a base ref
...
head repository: vuejs/router
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Sep 13, 2024

  1. Copy the full SHA
    a8df616 View commit details
  2. Copy the full SHA
    c7dd2a1 View commit details
  3. fix: fix mods in aliases

    posva committed Sep 13, 2024
    Copy the full SHA
    5e20afb View commit details
  4. release: vue-router@4.4.5

    posva committed Sep 13, 2024
    Copy the full SHA
    14219b0 View commit details

Commits on Oct 2, 2024

  1. ci: adjust codecov options

    posva committed Oct 2, 2024
    Copy the full SHA
    a24d55b View commit details

Commits on Oct 17, 2024

  1. fix: custom directive doesn't work when custom=true (#2377)

    Co-authored-by: Eduardo San Martin Morote <posva13@gmail.com>
    decademoon and posva authored Oct 17, 2024
    Copy the full SHA
    0d8d997 View commit details

Commits on Oct 19, 2024

  1. Copy the full SHA
    894fb56 View commit details

Commits on Oct 20, 2024

  1. ci: continous release

    posva committed Oct 20, 2024
    Copy the full SHA
    e2272bb View commit details

Commits on Oct 25, 2024

  1. Copy the full SHA
    0126eae View commit details

Commits on Oct 29, 2024

  1. Copy the full SHA
    ab62098 View commit details
  2. feat: throw if parent and child routes have the same name (#2267)

    Co-authored-by: Eduardo San Martin Morote <posva@users.noreply.github.com>
    skirtles-code and posva authored Oct 29, 2024
    Copy the full SHA
    8c73877 View commit details

Commits on Nov 13, 2024

  1. build: add vue-router.esm-browser.prod.js (#2242)

    Co-authored-by: kianfang <kianfang@163.com>
    Co-authored-by: Kian <16569491+kianfang@users.noreply.github.com>
    3 people authored Nov 13, 2024
    Copy the full SHA
    846e287 View commit details
  2. Copy the full SHA
    d992bb2 View commit details
  3. Copy the full SHA
    e978eb8 View commit details

Commits on Nov 14, 2024

  1. docs: Translate 'Omitting parent components' into Chinese (#2400)

    * docs: Translate 'Omitting parent components' into Chinese
    
    * Apply suggestions from code review
    
    ---------
    
    Co-authored-by: Jinjiang <zhaojinjiang@me.com>
    jeff-fe and Jinjiang authored Nov 14, 2024
    Copy the full SHA
    38cd752 View commit details

Commits on Nov 15, 2024

  1. chore: up chromedriver

    posva committed Nov 15, 2024
    Copy the full SHA
    0eaaeb9 View commit details

Commits on Nov 25, 2024

  1. chore: up deps

    posva committed Nov 25, 2024
    Copy the full SHA
    84dd1a1 View commit details
  2. chore: up ts and docs

    posva committed Nov 25, 2024
    Copy the full SHA
    c73e83f View commit details
  3. release: vue-router@4.5.0

    posva committed Nov 25, 2024
    Copy the full SHA
    2d0a79d View commit details
  4. docs: remove generated md files

    posva committed Nov 25, 2024
    Copy the full SHA
    fe6a019 View commit details
  5. Copy the full SHA
    2370820 View commit details

Commits on Dec 5, 2024

  1. Copy the full SHA
    aad0d48 View commit details

Commits on Dec 10, 2024

  1. Copy the full SHA
    e06b5d7 View commit details

Commits on Dec 26, 2024

  1. docs: fixed a translation issue (#2426)

    hash character should be translated as 井号 instead of 哈希符号.
    Henrize authored Dec 26, 2024
    Copy the full SHA
    9b44fce View commit details

Commits on Jan 3, 2025

  1. Copy the full SHA
    bd37fd4 View commit details

Commits on Jan 7, 2025

  1. chore: issues template

    posva committed Jan 7, 2025
    Copy the full SHA
    6e60e79 View commit details
  2. chore: typo

    posva committed Jan 7, 2025
    Copy the full SHA
    3d189f4 View commit details

Commits on Jan 17, 2025

  1. Copy the full SHA
    7deea23 View commit details

Commits on Feb 1, 2025

  1. Copy the full SHA
    baf881f View commit details

Commits on Feb 13, 2025

  1. 📃 docs(zh): Updated active-links.md (#2459)

    * 📃 docs(zh): Updated active-links.md
    
    * 📃 docs(zh): Updated active-links.md
    
    * Update active-links.md
    
    ---------
    
    Co-authored-by: Jinjiang <zhaojinjiang@me.com>
    HuangKaiSong and Jinjiang authored Feb 13, 2025
    Copy the full SHA
    42453b4 View commit details

Commits on Feb 15, 2025

  1. Copy the full SHA
    1ad847e View commit details

Commits on Feb 27, 2025

  1. Copy the full SHA
    b2e0835 View commit details
  2. Copy the full SHA
    3753ede View commit details

Commits on Mar 1, 2025

  1. docs: mad vue (#2468)

    * feat: add madvue banner
    
    * chore: action text
    
    * docs: fix banner
    
    * docs: fix
    
    * chore: order
    
    ---------
    
    Co-authored-by: Israel Ortuño <ai.ortuno@gmail.com>
    posva and IsraelOrtuno authored Mar 1, 2025
    Copy the full SHA
    165a4b2 View commit details

Commits on Mar 4, 2025

  1. Copy the full SHA
    149aefa View commit details
Showing with 2,302 additions and 8,337 deletions.
  1. +8 −2 .github/ISSUE_TEMPLATE/config.yml
  2. +5 −5 .github/contributing.md
  3. +44 −0 .github/workflows/pkg.pr.new.yml
  4. +3 −0 codecov.yml
  5. +14 −9 package.json
  6. +292 −0 packages/docs/.vitepress/theme/components/MadVueBanner.vue
  7. +26 −25 packages/docs/.vitepress/theme/components/VueMasteryBanner.vue
  8. +2 −0 packages/docs/.vitepress/theme/index.ts
  9. +0 −40 packages/docs/api/enums/ErrorTypes.md
  10. +0 −37 packages/docs/api/enums/NavigationFailureType.md
  11. +0 −1,004 packages/docs/api/index.md
  12. +0 −13 packages/docs/api/interfaces/HistoryState.md
  13. +0 −33 packages/docs/api/interfaces/LocationAsRelativeRaw.md
  14. +0 −51 packages/docs/api/interfaces/MatcherLocation.md
  15. +0 −19 packages/docs/api/interfaces/MatcherLocationAsPath.md
  16. +0 −79 packages/docs/api/interfaces/NavigationFailure.md
  17. +0 −27 packages/docs/api/interfaces/NavigationGuard.md
  18. +0 −75 packages/docs/api/interfaces/NavigationGuardNext.md
  19. +0 −38 packages/docs/api/interfaces/NavigationGuardWithThis.md
  20. +0 −27 packages/docs/api/interfaces/NavigationHookAfter.md
  21. +0 −79 packages/docs/api/interfaces/NavigationRedirectError.md
  22. +0 −55 packages/docs/api/interfaces/PathParserOptions.md
  23. +0 −87 packages/docs/api/interfaces/RouteLocationAsPathGeneric.md
  24. +0 −94 packages/docs/api/interfaces/RouteLocationAsPathTyped.md
  25. +0 −99 packages/docs/api/interfaces/RouteLocationAsRelativeGeneric.md
  26. +0 −114 packages/docs/api/interfaces/RouteLocationAsRelativeTyped.md
  27. +0 −101 packages/docs/api/interfaces/RouteLocationBase.md
  28. +0 −127 packages/docs/api/interfaces/RouteLocationGeneric.md
  29. +0 −183 packages/docs/api/interfaces/RouteLocationMatched.md
  30. +0 −111 packages/docs/api/interfaces/RouteLocationNamedRaw.md
  31. +0 −125 packages/docs/api/interfaces/RouteLocationNormalizedGeneric.md
  32. +0 −130 packages/docs/api/interfaces/RouteLocationNormalizedLoadedGeneric.md
  33. +0 −135 packages/docs/api/interfaces/RouteLocationNormalizedLoadedTyped.md
  34. +0 −132 packages/docs/api/interfaces/RouteLocationNormalizedTyped.md
  35. +0 −49 packages/docs/api/interfaces/RouteLocationOptions.md
  36. +0 −89 packages/docs/api/interfaces/RouteLocationPathRaw.md
  37. +0 −135 packages/docs/api/interfaces/RouteLocationResolvedGeneric.md
  38. +0 −142 packages/docs/api/interfaces/RouteLocationResolvedTyped.md
  39. +0 −136 packages/docs/api/interfaces/RouteLocationTyped.md
  40. +0 −28 packages/docs/api/interfaces/RouteMeta.md
  41. +0 −31 packages/docs/api/interfaces/RouteQueryAndHash.md
  42. +0 −149 packages/docs/api/interfaces/RouteRecordBase.md
  43. +0 −53 packages/docs/api/interfaces/RouteRecordInfo.md
  44. +0 −187 packages/docs/api/interfaces/RouteRecordMultipleViews.md
  45. +0 −187 packages/docs/api/interfaces/RouteRecordMultipleViewsWithChildren.md
  46. +0 −131 packages/docs/api/interfaces/RouteRecordNormalized.md
  47. +0 −184 packages/docs/api/interfaces/RouteRecordRedirect.md
  48. +0 −185 packages/docs/api/interfaces/RouteRecordSingleView.md
  49. +0 −185 packages/docs/api/interfaces/RouteRecordSingleViewWithChildren.md
  50. +0 −428 packages/docs/api/interfaces/Router.md
  51. +0 −161 packages/docs/api/interfaces/RouterHistory.md
  52. +0 −56 packages/docs/api/interfaces/RouterLinkI.md
  53. +0 −74 packages/docs/api/interfaces/RouterLinkProps.md
  54. +0 −145 packages/docs/api/interfaces/RouterMatcher.md
  55. +0 −208 packages/docs/api/interfaces/RouterOptions.md
  56. +0 −27 packages/docs/api/interfaces/RouterScrollBehavior.md
  57. +0 −19 packages/docs/api/interfaces/RouterViewProps.md
  58. +0 −17 packages/docs/api/interfaces/TypesConfig.md
  59. +0 −27 packages/docs/api/interfaces/UseLinkOptions.md
  60. +0 −55 packages/docs/api/interfaces/UseLinkReturn.md
  61. +1 −1 packages/docs/guide/advanced/dynamic-routing.md
  62. +0 −4 packages/docs/guide/advanced/typed-routes.md
  63. +14 −14 packages/docs/guide/essentials/history-mode.md
  64. +12 −9 packages/docs/guide/essentials/named-views.md
  65. +2 −2 packages/docs/package.json
  66. +1 −2 packages/docs/run-typedoc.mjs
  67. +3 −4 packages/docs/typedoc-markdown.mjs
  68. +2 −2 packages/docs/zh/about-translation.md
  69. +1 −1 packages/docs/zh/api/index.md
  70. +1 −1 packages/docs/zh/api/interfaces/NavigationGuardNext.md
  71. +1 −1 packages/docs/zh/api/interfaces/RouteLocation.md
  72. +1 −1 packages/docs/zh/api/interfaces/RouteLocationNormalizedLoaded.md
  73. +4 −4 packages/docs/zh/api/interfaces/Router.md
  74. +1 −1 packages/docs/zh/api/interfaces/RouterLinkProps.md
  75. +1 −1 packages/docs/zh/guide/advanced/dynamic-routing.md
  76. +1 −1 packages/docs/zh/guide/advanced/navigation-guards.md
  77. +1 −1 packages/docs/zh/guide/advanced/router-view-slot.md
  78. +20 −22 packages/docs/zh/guide/essentials/active-links.md
  79. +1 −1 packages/docs/zh/guide/essentials/history-mode.md
  80. +4 −5 packages/docs/zh/guide/essentials/nested-routes.md
  81. +1 −1 packages/docs/zh/guide/index.md
  82. +1 −1 packages/playground/index.html
  83. +7 −8 packages/playground/package.json
  84. +19 −0 packages/router/CHANGELOG.md
  85. +38 −39 packages/router/__tests__/RouterLink.spec.ts
  86. +1 −4 packages/router/__tests__/guards/beforeRouteEnter.spec.ts
  87. +81 −54 packages/router/__tests__/guards/guardsContext.spec.ts
  88. +1 −1 packages/router/__tests__/lazyLoading.spec.ts
  89. +46 −0 packages/router/__tests__/matcher/addingRemoving.spec.ts
  90. +70 −2 packages/router/__tests__/matcher/pathParser.spec.ts
  91. +1 −1 packages/router/e2e/encoding/index.html
  92. +1 −1 packages/router/e2e/guards-instances/index.html
  93. +1 −1 packages/router/e2e/hash/index.html
  94. +1 −1 packages/router/e2e/index.html
  95. +1 −1 packages/router/e2e/keep-alive/index.html
  96. +1 −1 packages/router/e2e/modal/index.html
  97. +1 −1 packages/router/e2e/multi-app/index.html
  98. +1 −1 packages/router/e2e/scroll-behavior/index.html
  99. +1 −1 packages/router/e2e/suspense/index.html
  100. +1 −1 packages/router/e2e/transitions/index.html
  101. +14 −18 packages/router/package.json
  102. +6 −2 packages/router/rollup.config.mjs
  103. +27 −4 packages/router/src/RouterLink.ts
  104. +2 −2 packages/router/src/RouterView.ts
  105. +2 −2 packages/router/src/location.ts
  106. +53 −22 packages/router/src/matcher/index.ts
  107. +1 −1 packages/router/src/matcher/pathParserRanker.ts
  108. +33 −28 packages/router/src/navigationGuards.ts
  109. +2 −2 packages/router/src/query.ts
  110. +4 −2 packages/router/src/router.ts
  111. +1 −1 packages/router/src/typed-routes/params.ts
  112. +19 −19 packages/router/src/typed-routes/route-location.ts
  113. +5 −7 packages/router/src/typed-routes/route-map.ts
  114. +0 −3 packages/router/vitest.workspace.js
  115. +1,377 −1,880 pnpm-lock.yaml
  116. +4 −2 scripts/verifyCommit.mjs
  117. +11 −0 vitest.workspace.js
10 changes: 8 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
blank_issues_enabled: false
contact_links:
- name: Help and Question
- name: 👨‍💻 Support
url: https://cal.com/posva/consultancy
about: Get direct help from the author of Vue Router with your project
- name: ❓ Help & Questions
url: https://github.com/vuejs/router/discussions/new?category=help-and-questions
about: Ask a question or discuss about Vue Router
- name: GitHub Sponsors
- name: 💡 Ideas
url: https://github.com/vuejs/router/discussions/new?category=ideas
about: Start a discussion to improve Vue Router
- name: 🌟 GitHub Sponsors
url: https://github.com/sponsors/posva
about: Like this project? Please consider supporting the author.
- name: Open Collective
10 changes: 5 additions & 5 deletions .github/contributing.md
Original file line number Diff line number Diff line change
@@ -34,9 +34,9 @@ Hi! I'm really excited that you are interested in contributing to Vue Router. Be

- Make sure tests pass!

- Commit messages must follow the [commit message convention](./commit-convention.md) so that the changelog can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [yorkie](https://github.com/yyx990803/yorkie)).
- Commit messages must follow the [commit message convention](./commit-convention.md) so that the changelog can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)).

- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [yorkie](https://github.com/yyx990803/yorkie)).
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)).

## Development Setup

@@ -52,7 +52,7 @@ A high-level overview of tools used:

- [TypeScript](https://www.typescriptlang.org/) as the development language
- [Rollup](https://rollupjs.org) for bundling
- [Jest](https://jestjs.io/) for unit testing
- [Vitest](https://vitest.dev/) for unit testing
- [Prettier](https://prettier.io/) for code formatting

## Scripts
@@ -83,7 +83,7 @@ The `pnpm test` script runs all checks:
$ pnpm test

# run unit tests in watch mode
$ pnpm jest --watch
$ pnpm test:unit --watch
```

## Project Structure
@@ -102,7 +102,7 @@ Vue Router source code can be found in the `src` directory:

## Contributing Tests

Unit tests are located inside `__tests__`. Consult the [Jest docs](https://jestjs.io/docs/en/using-matchers) and existing test cases for how to write new test specs. Here are some additional guidelines:
Unit tests are located inside `__tests__`. Consult the [Vitest docs](https://vitest.dev/guide/) and existing test cases for how to write new test specs. Here are some additional guidelines:

- Use the minimal API needed for a test case. For example, if a test can be written without involving the reactivity system or a component, it should be written so. This limits the test's exposure to changes in unrelated parts and makes it more stable.
- Use the minimal API needed for a test case. For example, if a test concerns the `router-link` component, don't create a router instance, mock the required properties instead.
44 changes: 44 additions & 0 deletions .github/workflows/pkg.pr.new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Publish Any Commit

on:
pull_request:
branches: main
paths-ignore:
- 'packages/docs/**'
- 'packages/playground/**'

push:
branches:
- '**'
tags:
- '!**'
paths-ignore:
- 'packages/docs/**'
- 'packages/playground/**'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm

- name: Install
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm -C packages/router build

- name: Build DTS
run: pnpm -C packages/router build:dts

- name: Release
run: pnpm dlx pkg-pr-new publish --compact --pnpm './packages/*'
3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
coverage:
status:
patch: off
project:
default:
threshold: 2%
23 changes: 14 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
"name": "@vue/router-root",
"private": true,
"packageManager": "pnpm@9.10.0",
"type": "module",
"engines": {
"node": ">=20.9.0"
},
@@ -26,26 +27,30 @@
"lint:script": "prettier -c --parser typescript \"packages/*/{src,__tests__,e2e}/**/*.[jt]s?(x)\"",
"lint:html": "prettier -c --parser html \"packages/**/*.html\"",
"lint:fix": "pnpm run lint:script --write && pnpm run lint:html --write",
"test": "pnpm run -r test"
"test": "pnpm run -r test",
"postinstall": "simple-git-hooks"
},
"devDependencies": {
"@vitest/coverage-v8": "^2.1.5",
"@vitest/ui": "^2.1.5",
"brotli": "^1.3.3",
"chalk": "^5.3.0",
"enquirer": "^2.4.1",
"execa": "^9.3.1",
"execa": "^9.5.1",
"globby": "^14.0.2",
"lint-staged": "^15.2.10",
"minimist": "^1.2.8",
"p-series": "^3.0.0",
"prettier": "^2.8.8",
"prettier": "^3.5.2",
"semver": "^7.6.3",
"typedoc": "^0.25.8",
"typedoc-plugin-markdown": "^3.17.1",
"typescript": "~5.3.3",
"yorkie": "^2.0.0"
"simple-git-hooks": "^2.11.1",
"typedoc": "^0.26.11",
"typedoc-plugin-markdown": "^4.2.10",
"typescript": "~5.6.3",
"vitest": "^2.1.5"
},
"gitHooks": {
"pre-commit": "lint-staged",
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged",
"commit-msg": "node scripts/verifyCommit.mjs"
},
"lint-staged": {
Loading