]> git.ipfire.org Git - thirdparty/vuejs/router.git/commit
fix(matcher): remove unused params
authorEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Aug 2022 13:56:04 +0000 (15:56 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Tue, 16 Aug 2022 13:56:08 +0000 (15:56 +0200)
commite8875705eb8b8a0756544174b85a1a3c2de55ff6
tree0134d6cd821150e4ca7bc0337b4c5b78ef0c7c74
parent9e90d9d0c0fbf266cd42b7a3306d6380ea7f8134
fix(matcher): remove unused params

Fix #1497

NOTES: if you were relying on passing `params` that were not defined as
part of the `path`, eg: having a route defined as follows:

```js
{
  path: '/somewhere',
  name: 'somewhere'
}
```

And pushing with an _artificial_ param:

```js
router.push({ name: 'somewhere', params: { oops: 'gets removed' }})
```

This change will break your app. This behavior has worked in some
scenarios but has been **advised against** for years as it's an
antipattern in routing. You can still put the data in `query` or as an
actual param.
packages/router/__tests__/matcher/resolve.spec.ts
packages/router/src/matcher/index.ts