This pr reduce outputsize and improves performance at the same time. by avoiding:
heavy operation with router.resolve
router.resolve performs RegExp.exec() when mapping the whole routes array to find a matched result.
duplicated route records with redirects and maps holding data, components, now a single map holds all pages info and pageKey is no longer used at client.
Breaking changes
pageKey is removed at client, so operations like router.push(pageKey)router.resolve(pageKey) no longer work
routeMeta is renamed to meta
We want to decouple meta concept with router
routeMeta is deprecated but still supported for backwards compatibility, we should remove the support in stable.
People should use resolve in @vuepress/client to get page meta
Getting page meta with router.resolve is deprecated but still supported for backwards compatibility, we should remove the support in stable. (We can support this for sure, but I think that decouple meta with routes could be better)
Note: Calling router.resolve to get a correct page path is still supported as this is a correct usage. (but since it's heavy, maybe we should warn users to use resolve as first choice)
Other notes
To support clean url (e.g.: navigating to /a/b and resolve /a/b.html to /a/b), we improved generation of htmlRelativePath and htmlPath on Page object
This pr reduce outputsize and improves performance at the same time. by avoiding:
heavy operation with
router.resolve
router.resolve
performsRegExp.exec()
when mapping the whole routes array to find a matched result.duplicated route records with redirects and maps holding data, components, now a single map holds all pages info and pageKey is no longer used at client.
Breaking changes
pageKey is removed at client, so operations like
router.push(pageKey)
router.resolve(pageKey)
no longer workrouteMeta
is renamed tometa
We want to decouple meta concept with router
routeMeta
is deprecated but still supported for backwards compatibility, we should remove the support in stable.People should use
resolve
in@vuepress/client
to get page metaGetting page meta with
router.resolve
is deprecated but still supported for backwards compatibility, we should remove the support in stable. (We can support this for sure, but I think that decouple meta with routes could be better)Note: Calling
router.resolve
to get a correct page path is still supported as this is a correct usage. (but since it's heavy, maybe we should warn users to useresolve
as first choice)Other notes
To support clean url (e.g.: navigating to
/a/b
and resolve/a/b.html
to/a/b
), we improved generation ofhtmlRelativePath
andhtmlPath
on Page object