@vuepress/client 2.0.0-rc.7 → 2.0.0-rc.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { C as CreateVueAppFunction } from './createVueAppFunction-YNGNKfE3.js';
1
+ import { C as CreateVueAppFunction } from './createVueAppFunction-onJTVJru.js';
2
2
  import 'vue';
3
3
  import 'vue-router';
4
4
 
package/dist/app.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  usePageLang,
13
13
  usePageLayout,
14
14
  withBase
15
- } from "./chunk-VWNFZFFH.js";
15
+ } from "./chunk-VA7KP4YF.js";
16
16
 
17
17
  // src/app.ts
18
18
  import { clientConfigs } from "@internal/clientConfigs";
@@ -69,6 +69,8 @@ var createVueRouter = () => {
69
69
  // attach page chunk route meta
70
70
  _pageChunk: pageChunk
71
71
  };
72
+ } else if (to.path === from.path) {
73
+ to.meta = from.meta;
72
74
  }
73
75
  });
74
76
  return router;
@@ -82,21 +84,26 @@ var setupGlobalComponents = (app) => {
82
84
  };
83
85
 
84
86
  // src/setupGlobalComputed.ts
85
- import { computedWithControl } from "@vueuse/core";
86
- import { computed } from "vue";
87
+ import { computed, customRef } from "vue";
87
88
  var setupGlobalComputed = (app, router, clientConfigs2) => {
88
89
  const routePath = computed(() => router.currentRoute.value.path);
89
- const pageChunk = computedWithControl(
90
- routePath,
91
- () => router.currentRoute.value.meta._pageChunk
92
- );
90
+ const pageChunk = customRef((track, trigger) => ({
91
+ get() {
92
+ track();
93
+ return router.currentRoute.value.meta._pageChunk;
94
+ },
95
+ set(value) {
96
+ router.currentRoute.value.meta._pageChunk = value;
97
+ trigger();
98
+ }
99
+ }));
93
100
  if (__VUEPRESS_DEV__ && (import.meta.webpackHot || import.meta.hot)) {
94
101
  __VUE_HMR_RUNTIME__.updatePageData = async (newPageData) => {
95
102
  const oldPageChunk = await routes.value[newPageData.path].loader();
96
- routes.value[newPageData.path].loader = () => Promise.resolve({ comp: oldPageChunk.comp, data: newPageData });
103
+ const newPageChunk = { comp: oldPageChunk.comp, data: newPageData };
104
+ routes.value[newPageData.path].loader = () => Promise.resolve(newPageChunk);
97
105
  if (newPageData.path === router.currentRoute.value.meta._pageChunk?.data.path) {
98
- router.currentRoute.value.meta._pageChunk.data = newPageData;
99
- pageChunk.trigger();
106
+ pageChunk.value = newPageChunk;
100
107
  }
101
108
  };
102
109
  }
@@ -225,6 +225,9 @@ var resolvers = reactive({
225
225
  */
226
226
  resolvePageLayout: (pageData, layouts) => {
227
227
  const layoutName = isString(pageData.frontmatter.layout) ? pageData.frontmatter.layout : LAYOUT_NAME_DEFAULT;
228
+ if (!layouts[layoutName]) {
229
+ throw new Error(`[vuepress] Cannot resolve layout: ${layoutName}`);
230
+ }
228
231
  return layouts[layoutName];
229
232
  },
230
233
  /**
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { PageData, HeadConfig, SiteData, PageFrontmatter } from '@vuepress/share
4
4
  export { HeadConfig, PageData, PageFrontmatter, PageHeader, SiteData } from '@vuepress/shared';
5
5
  import { Router } from 'vue-router';
6
6
  export { RouteLocationNormalizedLoaded, Router, useRoute, useRouter } from 'vue-router';
7
- export { C as CreateVueAppFunction } from './createVueAppFunction-YNGNKfE3.js';
7
+ export { C as CreateVueAppFunction } from './createVueAppFunction-onJTVJru.js';
8
8
 
9
9
  /**
10
10
  * Name of the default layout
@@ -91,7 +91,7 @@ interface ClientConfig {
91
91
  /**
92
92
  * Layout components
93
93
  */
94
- layouts?: Layouts;
94
+ layouts?: Partial<Layouts>;
95
95
  /**
96
96
  * Components to be placed directly into the root node of vue app
97
97
  */
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ import {
25
25
  useSiteLocaleData,
26
26
  useUpdateHead,
27
27
  withBase
28
- } from "./chunk-VWNFZFFH.js";
28
+ } from "./chunk-VA7KP4YF.js";
29
29
  export {
30
30
  ClientOnly,
31
31
  Content,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/client",
3
- "version": "2.0.0-rc.7",
3
+ "version": "2.0.0-rc.8",
4
4
  "description": "Client package of VuePress",
5
5
  "keywords": [
6
6
  "vuepress",
@@ -33,11 +33,10 @@
33
33
  "types.d.ts"
34
34
  ],
35
35
  "dependencies": {
36
- "@vue/devtools-api": "^6.5.1",
37
- "@vueuse/core": "^10.7.2",
38
- "vue": "^3.4.15",
36
+ "@vue/devtools-api": "^6.6.1",
37
+ "vue": "^3.4.19",
39
38
  "vue-router": "^4.2.5",
40
- "@vuepress/shared": "2.0.0-rc.7"
39
+ "@vuepress/shared": "2.0.0-rc.8"
41
40
  },
42
41
  "publishConfig": {
43
42
  "access": "public"