Closed podarok closed 2 years ago
In v4.1 we were initially planning to introduce types to automatically detect the params from a path
property, creating autocomplete and type safety in router.push()
and <RouterLink>
's to
prop. It was implemented but also turned out to be extremely slow after ~50 routes due to the nature of the types relying on nesting and complex unions. Instead, we are introducing a build plugin to generate the types of the routes for you based your file structure. This is similar to Nuxt and Vite Plugin Pages but with full type support (similar to nuxt-typed-router) while allowing you to keep using the exact same API, just with Autocompletion and typing hints
Check out the plugin GitHub repository for installation instructions and documentation.
Here are some other examples of how much this plugin can improves your developer experience:
We now expose a few extra entry points for Node but kept the old ones as well to prevent any disruption to the existing users. You can find more information about this in the corresponding pull request.
Please refer to CHANGELOG.md for details.
</li>
<li>
<b>4.1.0-c113369</b> - 2022-05-16
</li>
<li>
<b>4.1.0-beta.2</b> - 2022-07-01
</li>
<li>
<b>4.1.0-beta.1</b> - 2022-06-29
</li>
<li>
<b>4.1.0-beta.0</b> - 2022-06-29
</li>
<li>
<b>4.1.0-aabe509</b> - 2022-05-09
</li>
<li>
<b>4.1.0-9e62c00</b> - 2022-06-10
</li>
<li>
<b>4.1.0-730eb15</b> - 2022-06-14
</li>
<li>
<b>4.1.0-51021cc</b> - 2022-06-15
</li>
<li>
<b>4.1.0-4da5e55</b> - 2022-05-16
</li>
<li>
<b>4.0.16</b> - <a href="https://snyk.io/redirect/github/vuejs/router/releases/tag/v4.0.16">2022-06-09</a></br><p>Please refer to <a href="https://snyk.io/redirect/github/vuejs/router/blob/main/CHANGELOG.md">CHANGELOG.md</a> for details.</p>
</li>
<li>
<b>4.0.15</b> - <a href="https://snyk.io/redirect/github/vuejs/router/releases/tag/v4.0.15">2022-05-04</a></br><p>Please refer to <a href="https://snyk.io/redirect/github/vuejs/router/blob/main/CHANGELOG.md">CHANGELOG.md</a> for details.</p>
</li>
<li>
<b>4.0.14</b> - <a href="https://snyk.io/redirect/github/vuejs/router/releases/tag/v4.0.14">2022-03-10</a></br><p>Please refer to <a href="https://snyk.io/redirect/github/vuejs/router/blob/main/CHANGELOG.md">CHANGELOG.md</a> for details.</p>
</li>
<li>
<b>4.0.13</b> - <a href="https://snyk.io/redirect/github/vuejs/router/releases/tag/v4.0.13">2022-02-28</a></br><p>Please refer to <a href="https://snyk.io/redirect/github/vuejs/router/blob/main/CHANGELOG.md">CHANGELOG.md</a> for details.</p>
</li>
<li>
<b>4.0.12</b> - 2021-10-14
</li>
<li>
<b>4.0.11</b> - 2021-08-09
</li>
<li>
<b>4.0.10</b> - 2021-06-21
</li>
<li>
<b>4.0.9</b> - 2021-06-16
</li>
<li>
<b>4.0.8</b> - 2021-05-13
</li>
<li>
<b>4.0.7</b> - 2021-05-13
</li>
<li>
<b>4.0.6</b> - 2021-04-06
</li>
<li>
<b>4.0.5</b> - 2021-03-11
</li>
<li>
<b>4.0.4</b> - 2021-02-19
</li>
<li>
<b>4.0.3</b> - 2021-01-11
</li>
<li>
<b>4.0.2</b> - 2020-12-27
</li>
<li>
<b>4.0.1</b> - 2020-12-07
</li>
<li>
<b>4.0.0</b> - 2020-12-07
</li>
<li>
<b>4.0.0-rc.6</b> - 2020-11-30
</li>
<li>
<b>4.0.0-rc.5</b> - 2020-11-21
</li>
<li>
<b>4.0.0-rc.4</b> - 2020-11-20
</li>
<li>
<b>4.0.0-rc.3</b> - 2020-11-14
</li>
<li>
<b>4.0.0-rc.2</b> - 2020-11-05
</li>
<li>
<b>4.0.0-rc.1</b> - 2020-10-23
</li>
<li>
<b>4.0.0-beta.13</b> - 2020-10-02
</li>
<li>
<b>4.0.0-beta.12</b> - 2020-09-25
</li>
<li>
<b>4.0.0-beta.11</b> - 2020-09-20
</li>
<li>
<b>4.0.0-beta.10</b> - 2020-09-18
</li>
<li>
<b>4.0.0-beta.9</b> - 2020-09-01
</li>
<li>
<b>4.0.0-beta.8</b> - 2020-09-01
</li>
<li>
<b>4.0.0-beta.7</b> - 2020-08-19
</li>
<li>
<b>4.0.0-beta.6</b> - 2020-08-05
</li>
<li>
<b>4.0.0-beta.5</b> - 2020-08-03
</li>
<li>
<b>4.0.0-beta.4</b> - 2020-07-25
</li>
<li>
<b>4.0.0-beta.3</b> - 2020-07-21
</li>
<li>
<b>4.0.0-beta.2</b> - 2020-07-07
</li>
<li>
<b>4.0.0-beta.1</b> - 2020-07-03
</li>
<li>
<b>4.0.0-alpha.14</b> - 2020-07-01
</li>
<li>
<b>4.0.0-alpha.13</b> - 2020-06-18
</li>
<li>
<b>4.0.0-alpha.12</b> - 2020-05-19
</li>
<li>
<b>4.0.0-alpha.11</b> - 2020-05-12
</li>
<li>
<b>4.0.0-alpha.10</b> - 2020-05-05
</li>
<li>
<b>4.0.0-alpha.9</b> - 2020-04-29
</li>
<li>
<b>4.0.0-alpha.8</b> - 2020-04-29
</li>
<li>
<b>4.0.0-alpha.7</b> - 2020-04-17
</li>
<li>
<b>4.0.0-alpha.6</b> - 2020-04-17
</li>
<li>
<b>4.0.0-alpha.5</b> - 2020-04-08
</li>
<li>
<b>4.0.0-alpha.4</b> - 2020-03-28
</li>
<li>
<b>4.0.0-alpha.3</b> - 2020-03-14
</li>
<li>
<b>4.0.0-alpha.2</b> - 2020-03-14
</li>
<li>
<b>4.0.0-alpha.1</b> - 2020-02-26
</li>
<li>
<b>4.0.0-alpha.0</b> - 2020-02-21
</li>
<li>
<b>4.0.0-329e962</b> - 2021-10-19
</li>
<li>
<b>3.6.5</b> - 2022-09-06
</li>
<li>
<b>3.6.4</b> - 2022-08-25
</li>
<li>
<b>3.6.3</b> - 2022-08-23
</li>
<li>
<b>3.6.2</b> - 2022-08-23
</li>
<li>
<b>3.6.1</b> - 2022-08-23
</li>
<li>
<b>3.6.0</b> - 2022-08-22
</li>
<li>
<b>3.5.4</b> - 2022-05-16
</li>
<li>
<b>3.5.3</b> - 2021-10-26
</li>
</ul>
from <a href="https://snyk.io/redirect/github/vuejs/router/releases">vue-router GitHub release notes</a>
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:
🔕 Ignore this dependency or unsubscribe from future upgrade PRs
This PR was automatically created by Snyk using the credentials of a real user.
Snyk has created this PR to upgrade vue-router from 3.5.3 to 4.1.4.
:information_source: Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.*Warning:* This is a major version upgrade, and may be a breaking change. - The recommended version is **73 versions** ahead of your current version. - The recommended version was released **24 days ago**, on 2022-08-22.
Release notes
Package name: vue-router
Please refer to CHANGELOG.md for details.
We are excited to announce the release of Vue Router 4.1 with a few new interesting features, better support for Node ESM and no breaking changes.
Omitting the
component
/components
option in routesIt's now possible to completely omit the
component
option when defining routes with children. While nested routes are about defining layouts, they are also directly connected to apath
and users often found themselves defining a pass through component that would just render a<RouterView>
component to reuse thepath
structure. You can now simplify this to:<div class="highlight highlight-source-diff notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- import { RouterView } from 'vue-router'
const routes = [ { path: '/admin',
In other words, you can now nest paths without having to define a component.
Passing History State in navigations
Passing History State through
router.push()
has been implemented and used by the router since its version 4.0 but hasn't been exposed as a public API until now. This enables passing astate
property when callingrouter.push()
orrouter.replace()
. This is useful to pass global state to be associated with the history entry that cannot be shared by copying the URL. One common example of this are Modals:To see a full example, check the modal e2e test, it has been updated to use the
state
property.It's worth noting this shouldn't be used to pass fetched data or complex objects such as classes because of type and size limitations. Check the History State documentation for more information about the
state
property.Given the nature of the
<RouterView>
'sroute
prop, there is also a new functionloadRouteLocation()
that can be used on a resolved route location to load a route with lazy loading:<div class="highlight highlight-source-js notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="import { loadRouteLocation } from 'vue-router'
const loadedRoute = await loadRouteLocation(router.resolve('/users/24'))">