Skip to content

Commit aca96a5

Browse files
committed
Merge branch 'main' into static-path-perf
# Conflicts: # packages/router/src/matcher/index.ts
2 parents 987ea09 + 2f48746 commit aca96a5

File tree

207 files changed

+12546
-7375
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+12546
-7375
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ body:
99
id: reproduction
1010
attributes:
1111
label: Reproduction
12-
description: "If possible, provide a boiled down editable reproduction using a service like [JSFiddle](https://jsfiddle.net/posva/3yq6ojLv), Codepen, [CodeSandbox](https://codesandbox.io/s/vue-router-4-reproduction-s1sqc), or a GitHub repository. A failing unit test is even better! Otherwise provide as much information as possible to reproduce the problem. If we can't reproduce the problem, we won't be able to give it a look **and the issue will be converted into a question and moved to discussions**."
12+
description: "If possible, provide a boiled down editable reproduction with the [Vue.js Playground](https://play.vuejs.org/#eNqlVG1P2zAQ/iu3bFKLRuNSEB+yUMEQGpv2gti0L8s+pInbGhLbsp1SVPW/72znrVD4MlVp7Lvn7p67x/EmKFPGwzsdRAErpVAGNpApmhp6ISVsYa5ECYNVRQcJbwFKVIaq1hsSb+ggNrbxpVKGPj7hbeYhPgcJBwgrTYc+3O9LUXEzHLzFsMFBcBjU4cgvNrSUBcZPLTBeHk2vaVEIW+xNTHDrzNK9cKGNEnwxvayUotx4ziBTs4xiUvtgs4F3zhHOq6K4QSdsty4N8Xlinq6ahLeO5VfG78GIsyQgSTD9JHAN16KkMen8L0akM7S0YRd29ywuJk3N2Gqzm+s3ow9Aalztjkk7GJyXn2Vo9ij6jZZCPV4zbfB1WBt93r7So1bNVk/boCvdiNoYamUb2W1DO7jW0h4BunbQTHBdi6LgbIfLcGPbW3qa0T7uw4NDC3HROoI/fkQbry4MyACbE0iJo/BRR37rovpAp8cuuuvBw//i/xaPJo6237Q9jzpTTBrQ1FQSipQvUGKjUV6riXfiEjdPDu5k2mTCYzt5puDOzP6vTptqbyGv2qhMJV4AgmMpN/mkdmCFCJzF2rqDYc1JsDRG6oiQisv7RYgDJB3i/CQ8DsckR7V61pDqcjRT4kHj+g6z13IkwTmCSE5XRohCj1LJXirxDHh+Gp6GR6RgM4LZCeM5XbvcNjV+yVts02g8bHO2eNKk1ZwVVP2QhuFh3Gk2xXvl4YuzGVXRlmi2pNn9HvudXnvKN4pidyvaa86kakHxo7fuq5/f6RrXrbMUeVUg+hXnLdWiqCxHD/tY8Rxp93CO7WenGeOLX/pqbSjXTVOWqJuGwzshL19pvaN7HJ70pqjNY0F1mGl7seANdQj2+vFxM6FyqiKYyDUgWZbD2/F4/MG6SkzH+GgmjBFlBEdjuXZ2meY5km0tWCXhmBamkMJ7fFziOrqgc/wy+8jlpF+5S98RyLKsRyCCMf4mdYZg+w+goli8), or an **editable** and **up to date** [CodeSandbox](https://codesandbox.io/s/vue-router-4-reproduction-s1sqc), Stackblitz, or a GitHub repository. A failing unit test is even better! Otherwise provide as much information as possible to reproduce the problem. If we can't reproduce the problem, we won't be able to give it a look **and the issue will be converted into a question and moved to discussions**."
1313
placeholder: Reproduction
1414
validations:
1515
required: true

.github/workflows/test.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: test
22

33
on:
44
push:
5+
branches:
6+
- main
57
paths-ignore:
68
- 'packages/docs/**'
79
- 'packages/playground/**'
810
pull_request:
11+
branches:
12+
- main
913
paths-ignore:
1014
- 'packages/docs/**'
1115
- 'packages/playground/**'
@@ -15,14 +19,12 @@ jobs:
1519
runs-on: ubuntu-latest
1620

1721
steps:
18-
- uses: actions/checkout@v3
19-
- uses: pnpm/action-setup@v2
22+
- uses: actions/checkout@v4
23+
- uses: pnpm/action-setup@v4
24+
- uses: actions/setup-node@v4
2025
with:
21-
version: 8.5.0
22-
- uses: actions/setup-node@v3
23-
with:
24-
node-version: '18'
25-
cache: 'pnpm'
26+
node-version: 'lts/*'
27+
cache: pnpm
2628
- name: 'BrowserStack Env Setup'
2729
uses: 'browserstack/github-actions/setup-env@master'
2830
# forks do not have access to secrets so just skip this
@@ -33,16 +35,17 @@ jobs:
3335

3436
- run: pnpm install
3537
- run: pnpm run lint
36-
- run: pnpm run -r test:types
37-
- run: pnpm run -r test:unit
3838
- run: pnpm run -r build
3939
- run: pnpm run -r build:dts
40-
- run: pnpm run -r test:dts
40+
- run: pnpm run -r test:types
41+
- run: pnpm run -r test:unit
4142

4243
# e2e tests that that run locally
4344
- run: pnpm run -r test:e2e:ci
4445

45-
- uses: codecov/codecov-action@v2
46+
- uses: codecov/codecov-action@v4
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
4649

4750
# - name: 'Start BrowserStackLocal Tunnel'
4851
# uses: 'browserstack/github-actions/setup-local@master'

README.md

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# vue-router [![release candidate](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router) [![test](https://github.com/vuejs/router/actions/workflows/test.yml/badge.svg)](https://github.com/vuejs/router/actions/workflows/test.yml)
1+
# vue-router [![release candidate](https://img.shields.io/npm/v/vue-router.svg)](https://www.npmjs.com/package/vue-router) [![test](https://github.com/vuejs/router/actions/workflows/test.yml/badge.svg)](https://github.com/vuejs/router/actions/workflows/test.yml) [![codecov](https://codecov.io/gh/vuejs/router/graph/badge.svg?token=azNM3FI0d1)](https://codecov.io/gh/vuejs/router)
22

33
> - This is the repository for Vue Router 4 (for Vue 3)
44
> - For Vue Router 3 (for Vue 2) see [vuejs/vue-router](https://github.com/vuejs/vue-router).
@@ -14,10 +14,10 @@ Vue Router is part of the Vue Ecosystem and is an MIT-licensed open source proje
1414

1515
<h4 align="center">Silver Sponsors</h4>
1616
<p align="center">
17-
<a href="https://www.vuemastery.com/" target="_blank" rel="noopener noreferrer">
17+
<a href="https://route4me.com" target="_blank" rel="noopener noreferrer">
1818
<picture>
19-
<source srcset="https://posva-sponsors.pages.dev/logos/vuemastery-dark.png" media="(prefers-color-scheme: dark)" height="42px" alt="VueMastery" />
20-
<img src="https://posva-sponsors.pages.dev/logos/vuemastery-light.svg" height="42px" alt="VueMastery" />
19+
<source srcset="https://posva-sponsors.pages.dev/logos/route4me.png" media="(prefers-color-scheme: dark)" height="42px" alt="Route Optimizer and Route Planner Software" />
20+
<img src="https://posva-sponsors.pages.dev/logos/route4me.png" height="42px" alt="Route Optimizer and Route Planner Software" />
2121
</picture>
2222
</a>
2323
<a href="https://www.prefect.io/" target="_blank" rel="noopener noreferrer">
@@ -26,32 +26,38 @@ Vue Router is part of the Vue Ecosystem and is an MIT-licensed open source proje
2626
<img src="https://posva-sponsors.pages.dev/logos/prefectlogo-light.svg" height="42px" alt="Prefect" />
2727
</picture>
2828
</a>
29+
<a href="https://www.vuemastery.com/" target="_blank" rel="noopener noreferrer">
30+
<picture>
31+
<source srcset="https://posva-sponsors.pages.dev/logos/vuemastery-dark.png" media="(prefers-color-scheme: dark)" height="42px" alt="VueMastery" />
32+
<img src="https://posva-sponsors.pages.dev/logos/vuemastery-light.svg" height="42px" alt="VueMastery" />
33+
</picture>
34+
</a>
2935
</p>
3036

3137
<h4 align="center">Bronze Sponsors</h4>
3238
<p align="center">
33-
<a href="https://stormier.ninja" target="_blank" rel="noopener noreferrer">
39+
<a href="https://storyblok.com" target="_blank" rel="noopener noreferrer">
3440
<picture>
35-
<source srcset="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Stanislas Ormières" />
36-
<img src="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" height="26px" alt="Stanislas Ormières" />
41+
<source srcset="https://posva-sponsors.pages.dev/logos/storyblok.png" media="(prefers-color-scheme: dark)" height="26px" alt="Storyblok" />
42+
<img src="https://posva-sponsors.pages.dev/logos/storyblok.png" height="26px" alt="Storyblok" />
3743
</picture>
3844
</a>
39-
<a href="https://www.vuejs.de" target="_blank" rel="noopener noreferrer">
45+
<a href="https://ui.nuxt.com/pro" target="_blank" rel="noopener noreferrer">
4046
<picture>
41-
<source srcset="https://avatars.githubusercontent.com/u/4183726?u=6b50a8ea16de29d2982f43c5640b1db9299ebcd1&v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Antony Konstantinidis" />
42-
<img src="https://avatars.githubusercontent.com/u/4183726?u=6b50a8ea16de29d2982f43c5640b1db9299ebcd1&v=4" height="26px" alt="Antony Konstantinidis" />
47+
<source srcset="https://posva-sponsors.pages.dev/logos/nuxt-dark.svg" media="(prefers-color-scheme: dark)" height="26px" alt="Nuxt UI Pro Templates" />
48+
<img src="https://posva-sponsors.pages.dev/logos/nuxt-light.svg" height="26px" alt="Nuxt UI Pro Templates" />
4349
</picture>
4450
</a>
45-
<a href="https://storyblok.com" target="_blank" rel="noopener noreferrer">
51+
<a href="https://www.vuejs.de" target="_blank" rel="noopener noreferrer">
4652
<picture>
47-
<source srcset="https://posva-sponsors.pages.dev/logos/storyblok.png" media="(prefers-color-scheme: dark)" height="26px" alt="Storyblok" />
48-
<img src="https://posva-sponsors.pages.dev/logos/storyblok.png" height="26px" alt="Storyblok" />
53+
<source srcset="https://avatars.githubusercontent.com/u/4183726?u=6b50a8ea16de29d2982f43c5640b1db9299ebcd1&v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Antony Konstantinidis" />
54+
<img src="https://avatars.githubusercontent.com/u/4183726?u=6b50a8ea16de29d2982f43c5640b1db9299ebcd1&v=4" height="26px" alt="Antony Konstantinidis" />
4955
</picture>
5056
</a>
51-
<a href="https://ui.nuxt.com/pro" target="_blank" rel="noopener noreferrer">
57+
<a href="https://stormier.ninja" target="_blank" rel="noopener noreferrer">
5258
<picture>
53-
<source srcset="https://avatars.githubusercontent.com/u/81570812?v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Nuxt UI Pro Templates" />
54-
<img src="https://avatars.githubusercontent.com/u/81570812?v=4" height="26px" alt="Nuxt UI Pro Templates" />
59+
<source srcset="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" media="(prefers-color-scheme: dark)" height="26px" alt="Stanislas Ormières" />
60+
<img src="https://avatars.githubusercontent.com/u/2486424?u=7b0c73ae5d090ce53bf59473094e9606fe082c59&v=4" height="26px" alt="Stanislas Ormières" />
5561
</picture>
5662
</a>
5763
</p>

SECURITY.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Reporting a Vulnerability
2+
3+
To report a vulnerability, please email [email protected].
4+
5+
While the discovery of new vulnerabilities is rare, we also recommend always using the latest versions of Vue and its official companion libraries to ensure your application remains as secure as possible.

codecov.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
coverage:
2+
status:
3+
patch: off

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@vue/router-root",
33
"private": true,
4-
"packageManager": "pnpm@8.10.2",
4+
"packageManager": "pnpm@9.4.0",
55
"engines": {
6-
"node": ">=18.14.0"
6+
"node": ">=20.9.0"
77
},
88
"workspaces": [
99
"packages/*"
@@ -32,14 +32,14 @@
3232
"brotli": "^1.3.3",
3333
"chalk": "^5.3.0",
3434
"enquirer": "^2.4.1",
35-
"execa": "^8.0.1",
36-
"globby": "^14.0.0",
37-
"lint-staged": "^15.2.0",
35+
"execa": "^9.2.0",
36+
"globby": "^14.0.1",
37+
"lint-staged": "^15.2.7",
3838
"minimist": "^1.2.8",
3939
"p-series": "^3.0.0",
4040
"prettier": "^2.8.8",
41-
"semver": "^7.5.4",
42-
"typedoc": "^0.25.3",
41+
"semver": "^7.6.2",
42+
"typedoc": "^0.25.8",
4343
"typedoc-plugin-markdown": "^3.17.1",
4444
"typescript": "~5.3.3",
4545
"yorkie": "^2.0.0"
@@ -66,6 +66,6 @@
6666
}
6767
},
6868
"volta": {
69-
"node": "18.16.0"
69+
"node": "20.11.1"
7070
}
7171
}

packages/docs/.vitepress/config/en.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
4646
},
4747
{
4848
text: 'Vue.js Certification',
49-
link: 'https://certification.vuejs.org/?friend=VUEROUTER',
49+
link: 'https://certificates.dev/vuejs/?friend=VUEROUTER&utm_source=router_vuejs&utm_medium=link&utm_campaign=router_vuejs_links&utm_content=navbar',
5050
},
5151
],
5252
},
@@ -70,7 +70,6 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
7070
},
7171
{
7272
text: 'Essentials',
73-
collapsible: false,
7473
items: [
7574
{
7675
text: 'Getting Started',
@@ -84,6 +83,10 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
8483
text: "Routes' Matching Syntax",
8584
link: '/guide/essentials/route-matching-syntax.html',
8685
},
86+
{
87+
text: 'Named Routes',
88+
link: '/guide/essentials/named-routes.html',
89+
},
8790
{
8891
text: 'Nested Routes',
8992
link: '/guide/essentials/nested-routes.html',
@@ -92,10 +95,6 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
9295
text: 'Programmatic Navigation',
9396
link: '/guide/essentials/navigation.html',
9497
},
95-
{
96-
text: 'Named Routes',
97-
link: '/guide/essentials/named-routes.html',
98-
},
9998
{
10099
text: 'Named Views',
101100
link: '/guide/essentials/named-views.html',
@@ -108,6 +107,10 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
108107
text: 'Passing Props to Route Components',
109108
link: '/guide/essentials/passing-props.html',
110109
},
110+
{
111+
text: 'Active links',
112+
link: '/guide/essentials/active-links.html',
113+
},
111114
{
112115
text: 'Different History modes',
113116
link: '/guide/essentials/history-mode.html',
@@ -116,7 +119,6 @@ export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
116119
},
117120
{
118121
text: 'Advanced',
119-
collapsible: false,
120122
items: [
121123
{
122124
text: 'Navigation guards',

packages/docs/.vitepress/config/zh.ts

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,16 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
5050
},
5151
{
5252
text: 'Vue.js 认证',
53-
link: 'https://certification.vuejs.org/?friend=VUEROUTER',
53+
link: 'https://certificates.dev/vuejs/?friend=VUEROUTER&utm_source=router_vuejs&utm_medium=link&utm_campaign=router_vuejs_links&utm_content=navbar',
5454
},
5555
],
5656
},
5757
],
5858

5959
sidebar: {
60-
'/zh/api/': [
61-
{
62-
text: 'packages',
63-
items: [{ text: 'vue-router', link: '/zh/api/' }],
64-
},
65-
],
66-
6760
'/zh/': [
6861
{
62+
text: '设置',
6963
items: [
7064
{
7165
text: '介绍',
@@ -79,7 +73,6 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
7973
},
8074
{
8175
text: '基础',
82-
collapsible: false,
8376
items: [
8477
{
8578
text: '入门',
@@ -97,14 +90,14 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
9790
text: '嵌套路由',
9891
link: '/zh/guide/essentials/nested-routes.html',
9992
},
100-
{
101-
text: '编程式导航',
102-
link: '/zh/guide/essentials/navigation.html',
103-
},
10493
{
10594
text: '命名路由',
10695
link: '/zh/guide/essentials/named-routes.html',
10796
},
97+
{
98+
text: '编程式导航',
99+
link: '/zh/guide/essentials/navigation.html',
100+
},
108101
{
109102
text: '命名视图',
110103
link: '/zh/guide/essentials/named-views.html',
@@ -117,6 +110,10 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
117110
text: '路由组件传参',
118111
link: '/zh/guide/essentials/passing-props.html',
119112
},
113+
{
114+
text: '匹配当前路由的链接',
115+
link: '/zh/guide/essentials/active-links.html',
116+
},
120117
{
121118
text: '不同的历史记录模式',
122119
link: '/zh/guide/essentials/history-mode.html',
@@ -125,7 +122,6 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
125122
},
126123
{
127124
text: '进阶',
128-
collapsible: false,
129125
items: [
130126
{
131127
text: '导航守卫',
@@ -190,6 +186,13 @@ export const zhConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
190186
],
191187
},
192188
],
189+
190+
'/zh/api/': [
191+
{
192+
text: 'packages',
193+
items: [{ text: 'vue-router', link: '/zh/api/' }],
194+
},
195+
],
193196
},
194197
},
195198
}

0 commit comments

Comments
 (0)