Closed Mister-Hope closed 7 months ago
So the new <RouterLink>
is not actually in use, right?
Is it possible to get rid of both new and old <RouterLink>
? If so, I think it's better to use <VPLink>
to replace the <RouterLink>
totally.
My concern is to reduce user's confusion about the three different link components.
I think we can stop providing the official router-link and use ours instead. But that could be a breaking change.
The router link component should be kept as we do care about active state and the exact href location sometimes.
With this, users should import the real routerlink and overide ours if they do want the official one
@vuepress/client
useResolvedRoute
composables (with redirects support)two replacement for
<RouterLink>
invue-router
:<VPLink>
component, do not resolve any route during initialization.<RouterLink>
component, handling redirects and reducerouter.resolve
cost comparing with official<RouterLink>
and active state withvp-active
@vuepress/markdown
<VPLink>
by default for links plugin@vuepress/shared
inferRoutePath
function to avoid possible redirect matching that needs to callrouter.resolve
againDocumentation
All related api docs update
Performance
( under 6x slowdown mocking withofficial docs)
Original:
Before:
After:
Adding 1000 pages on official docs:
Before:![image](https://github.com/vuepress/vuepress-next/assets/33315834/b70c14f8-c93e-40e3-a230-2ac14cb44afa)
After:![image](https://github.com/vuepress/vuepress-next/assets/33315834/70f45ec6-df6b-4e70-96e5-3eb9930ab065)