Vue Router v5.4.0
vuejs/routerBreaking changes
Summary
Vue Router v5.4.0 introduces breaking changes by normalizing query values to arrays and adds new features such as accepting prebuilt matchers in `createRouter` and enhanced scroll restoration capabilities. Additionally, there are several bug fixes and performance improvements, particularly around hash and query parameter handling.
Breaking changes in v5.4.0
- experimental: Normalize query values to arrays - by @posva in https://github.com/vuejs/router/issues/2824 (f1fbc)
Full release notes
🚨 Breaking Changes
- experimental: Normalize query values to arrays - by @posva in https://github.com/vuejs/router/issues/2824 (f1fbc)
🚀 Features
- Accept a prebuilt matcher in
createRouter- by @danielroe in https://github.com/vuejs/router/issues/2804 (9de96) - UseScrollRestoration and onRouteRendered - by @posva in https://github.com/vuejs/router/issues/2805 (e3dde)
- Diagnose experimental beforeEnter migration - by @posva (b695c)
- experimental:
- Warn about legacy optional param removal - by @posva in https://github.com/vuejs/router/issues/2818 (c2f92)
- Extract hash params with definePage - by @posva (dbf2d)
- Configure required and default hash params - by @posva (cef5c)
- Never decode the hash, protect-only encoding - by @posva in https://github.com/vuejs/router/issues/2760 (aca2c)
- Allow custom regexp for path params in definePage - by @posva in https://github.com/vuejs/router/issues/2822 (3a192)
- router:
- Restore hashes and top by default - by @posva (7c385)
🐞 Bug Fixes
- Resolve experimental guard redirects against target on history navigation - by @posva (2c5fb)
- experimental:
- Keep declared case of static prefix in MatcherPatternPathStar.build() - by @contactjawad in https://github.com/vuejs/router/issues/2798 (4dc6b)
- Make hash params optional and nullable - by @posva (d9a4c)
- Exclude defaults from required hash params - by @posva (346e2)
- Align hash parameter parsing with queries - by @posva (cf251)
- Keep last hash param instead of throwing - by @posva (d1e8a)
- Disallow required with a default for query params - by @posva (f60e9)
- Make query params with a default optional on push - by @posva (fb604)
- Do not inherit params, query, or hash on redirects - by @posva (02a92)
- history:
- Invalidate obsolete scroll positions - by @posva and @liuly0322 in https://github.com/vuejs/router/issues/2814 (071f1)
- unplugin:
- Sanitize named view in definePage import - by @giaBaoJS in https://github.com/vuejs/router/issues/2809 (0711d)
- Keep hex character codes in param segments regexp - by @kwy404 in https://github.com/vuejs/router/issues/2811 (07663)
🏎 Performance
- unplugin: Cache merged route overrides - by @posva in https://github.com/vuejs/router/issues/2821 (732b7)
