Last 12 weeks · 60 commits
3 of 6 standards met
Group duplicated route nodes by node identity instead of , so two distinct nodes resolving to the same URL (e.g. a override in ) are no longer reported as conflicting files. Fix #2791 Summary by CodeRabbit Bug Fixes** Improved duplicate-route detection to avoid incorrectly reporting intentional same-URL overlays as conflicts. Correctly identifies conflicts between standard and grouped routes. Preserves valid routes with explicit path overrides while continuing to flag genuine convention-based collisions. Route precedence is now determined more reliably, reducing false positives during routing validation.
Reproduction https://github.com/enpitsuLin/vue-router-conflict-repro Minimal Vite + Vue 3 + vue-router@5 project. Two route records share the same URL — a full-page form and an overlay-dialog form (the latter using named views) — created via the documented override in . Steps to reproduce the bug 1. , open 2. Click "Open settings (full page)" → renders the full-page settings form 3. Go back, click "Open settings (overlay dialog)" → renders the overlay dialog (underlying Home screen + floating white dialog card), the URL stays 4. Check the browser console → on every load it prints 5. Production builds contain the warning too: Expected behavior 1. No conflict warning at all — same-URL multi-record routes via the documented override are intentional usage (the classic API fully supports multiple records with the same ); 2. At minimum, the diagnostic must not ship in production bundles (dev-only output, or a build-time terminal warning), ideally with an opt-out option (e.g. ). Actual behavior Printed on every page load, in dev and production builds. Additional information Why this is a false positive: the detection key is (), and the two records produce identical keys. The marker in only appears when has properties other than /// (e.g. , ) — remove from either side and the marker diverges, the key differs, and the warning disappears, with the routes unchanged. Adding named views to one record (introducing a marker) also silences it. So whether the warning fires depends on an irrelevant detail (does the file happen to carry /named views?), not on an actual route conflict. Production impact: the is compiled into the generated module and ships in the production bundle, executing on every page load. vue-router: 5.2.0 · vite: 8.2.1 (rolldown) · vue: 3.5.41
Summary This PR improves the translation quality of the Chinese docs under and (22 files), syncs them with the current English docs, and updates the translation checkpoint accordingly. Changes Translation quality improvements Fixed mistranslations, e.g. "Using the Options API" was translated as "可用的配置 API"; it is now "使用选项式 API". Unified terminology with cn.vuejs.org conventions: 选项式 API, 组合式 API, 导航守卫, 导航失效, 路由元信息, 路由记录, etc. Fixed broken in-page anchors pointing to English headings (e.g. → , → ). Content sync with English docs (checkpoint d842b6f → main) Translated missing sections: "Avoiding slow regex" (route-matching-syntax), Azure Static Web Apps and the standalone nginx server config (history-mode), relationships to functional/async components (lazy-loading), "Initial navigation and transitions" (transitions), "Avoiding scroll computation" (scroll-behavior), exmaples of updating document page title (#2779), plus example renames and Vue Playground links (named-views, dynamic-matching, nested-routes). Mirrored the English sidebar in (Data Loaders, experimental entries, reworked Migration section). Entries without Chinese sources are routed to English ones; the zh-specific "关于中文翻译" entry is preserved. Other Fixed broken API anchors pointing to the legacy zh directory (e.g. → ). Applied zhlint formatting to the changed files only. Updated the translation checkpoint via . Added (same as vuejs-translations/docs-zh-cn). Out of scope The legacy zh directory, , , , , and are not synced in this PR. Testing passes locally with no dead links. Summary by CodeRabbit Documentation Expanded Chinese documentation navigation with experimental router, parameter resolver, data loader, and v5 migration guides. Improved guidance on navigation guards, data fetching, lazy loading, typed routes, history modes, route matching, transitions, and server fallback configuration. Added clearer examples, API references, playground links, and troubleshooting guidance. Corrected terminology, links, punctuation, translation status, and migration labels. Chores Reformatted documentation linting configuration without changing its settings.
This fixes #1638 Encoding of the parameters is now done by the matcher and is dependend on the matcher keys: every key has a keepSlash property that reflects if it should encode the slash character or not. The keepSlash currently applies to all custom regex that either match a slash or contain one in their literal part, excluding lookaheads, lookbehinds and negative ranges. This is very simplistic but should be enough to cover both catch-all (e.g. "(.\)" routes) and explicit path regexes (e.g. "(deep/path/[a-z]\/)" ) I have also added a few tests to ensure everyting is working properly. The Router > 'can redirect to a star route when encoding the param' test is currently failing as it sets a parameter with an urlencoded slash (%2F) and expects to find it as it is in the route. However, since this PR allows literal slashes in star routes, the actual url contains the sequence as a literal (%252F) rather than keeping the escaped slash. I could edit the test, but I am unsure if this is behaivour that is being relied upon. In case it is, more work is needed to distinguish user-set urlencoded path segments from the normal usecase. To test this PR I have updated the sandbox from #1638 here: codesandbox.io
I discovered this problem while migrating from . Problem When overriding route via `definePage()/path:id?:id+:id:id(.)params.path` parser overrides to inferred params. 3. Treat absolute override paths as inheritance boundaries: stop inheriting ancestor params/query above that node. 4. Keep relative override paths inheriting parent params/query as-is. Summary by CodeRabbit Bug Fixes Absolute path overrides now correctly exclude parent parameters, while relative overrides continue to inherit them. Improved handling of multiple, optional, repeatable, query, and splat parameters in route paths. Route matching now correctly identifies trailing splat segments, including nested routes. Added a build-time warning when the same parameter parser is declared in both the filename and route configuration. Tests Expanded coverage for path overrides, parameter inheritance, parser metadata, and splat behavior.
Version 4.0.15 Reproduction link codesandbox.io Steps to reproduce 1. Open the minimal reproduction in firefox. 2. Click the header1. 3. Click the header2. 4. Click the header1 agin. 5. Click the header2 agin. It also happened in chrome, if you scroll page to the end before click anchor link in step5. What is expected? Jump to the correct header. What is actually happening? Jump to . It meets code logic, but does not meet the expectations of use. Notice: I have used CSS scroll-behavior in .
Repository: vuejs/router. Description: 🚦 The official router for Vue.js Stars: 4671, Forks: 1295. Primary language: TypeScript. Languages: TypeScript (92.9%), Vue (5.6%), JavaScript (0.7%), HTML (0.6%), CSS (0.2%). License: MIT. Homepage: https://router.vuejs.org/ Topics: vue, vue-router. Latest release: v5.2.0 (1mo ago). Open PRs: 18, open issues: 31. Last activity: 2d ago. Community health: 75%. Top contributors: posva, dependabot-preview[bot], skirtles-code, nicodevs, pikax, Jinjiang, dependabot[bot], yyx990803, PeterAlfredLee, btea and others.