@vuepress/client
Advanced tools
Comparing version 2.0.0-beta.10 to 2.0.0-beta.12
@@ -6,2 +6,18 @@ # Change Log | ||
# [2.0.0-beta.12](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2021-04-30) | ||
### Performance Improvements | ||
* **core:** reduce page data and component file size ([4c6eea5](https://github.com/vuepress/vuepress-next/commit/4c6eea5188e804cb3f6c7648d6528d43002618ae)) | ||
### BREAKING CHANGES | ||
* **core:** `pagePath` prop of `<Content>` renamed to `pageKey` | ||
# [2.0.0-beta.10](https://github.com/vuepress/vuepress-next/compare/v2.0.0-beta.9...v2.0.0-beta.10) (2021-04-27) | ||
@@ -8,0 +24,0 @@ |
@@ -62,4 +62,4 @@ import { createApp, createSSRApp, computed, h } from 'vue'; | ||
[pageData.value] = await Promise.all([ | ||
resolvePageData(to.path), | ||
(_a = pagesComponents[to.path]) === null || _a === void 0 ? void 0 : _a.__asyncLoader(), | ||
resolvePageData(to.name), | ||
(_a = pagesComponents[to.name]) === null || _a === void 0 ? void 0 : _a.__asyncLoader(), | ||
]); | ||
@@ -66,0 +66,0 @@ } |
@@ -6,3 +6,3 @@ import type { FunctionalComponent } from 'vue'; | ||
export declare const Content: FunctionalComponent<{ | ||
pagePath?: string; | ||
pageKey?: string; | ||
}>; |
@@ -10,4 +10,4 @@ import { h } from 'vue'; | ||
// use the page key from props directly | ||
if (props.pagePath) { | ||
key = props.pagePath; | ||
if (props.pageKey) { | ||
key = props.pageKey; | ||
} | ||
@@ -17,3 +17,3 @@ else { | ||
const page = usePageData(); | ||
key = page.value.path; | ||
key = page.value.key; | ||
} | ||
@@ -32,3 +32,3 @@ const component = pagesComponents[key]; | ||
Content.props = { | ||
pagePath: { | ||
pageKey: { | ||
type: String, | ||
@@ -35,0 +35,0 @@ required: false, |
@@ -7,2 +7,2 @@ import type { Ref } from 'vue'; | ||
export declare const usePageData: <T extends Record<any, any> = Record<never, never>>() => PageDataRef<T>; | ||
export declare const resolvePageData: (routePath: string) => Promise<PageData>; | ||
export declare const resolvePageData: (pageKey: string) => Promise<PageData>; |
@@ -16,4 +16,4 @@ import { ref, readonly } from 'vue'; | ||
}; | ||
export const resolvePageData = async (routePath) => { | ||
const pageDataResolver = pagesData.value[routePath]; | ||
export const resolvePageData = async (pageKey) => { | ||
const pageDataResolver = pagesData.value[pageKey]; | ||
if (!pageDataResolver) { | ||
@@ -28,3 +28,3 @@ return pageDataEmpty; | ||
__VUE_HMR_RUNTIME__.updatePageData = (data) => { | ||
pagesData.value[data.path] = () => Promise.resolve(data); | ||
pagesData.value[data.key] = () => Promise.resolve(data); | ||
if (data.key === pageData.value.key) { | ||
@@ -31,0 +31,0 @@ pageData.value = data; |
{ | ||
"name": "@vuepress/client", | ||
"version": "2.0.0-beta.10", | ||
"version": "2.0.0-beta.12", | ||
"description": "Client package of VuePress", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "3fb99981d3c476f7ec8d38a352a049586b4c2854" | ||
"gitHead": "f3fadbc8a730a5985115b8e94f9a634b92354ac3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39329