diff --git a/packages/vike-pinia/renderer/+config.ts b/packages/vike-pinia/renderer/+config.ts
index 5cea5c19..d88884cc 100644
--- a/packages/vike-pinia/renderer/+config.ts
+++ b/packages/vike-pinia/renderer/+config.ts
@@ -4,8 +4,8 @@ export default {
// @ts-ignore Remove this ts-ignore once Vike's new version is released.
name: 'vike-pinia',
onCreateAppPinia: 'import:vike-pinia/renderer/installPinia:installPinia',
- onAfterRenderSSRApp: 'import:vike-pinia/renderer/dehydratePinia:dehydratePinia',
- onBeforeMountApp: 'import:vike-pinia/renderer/hydratePinia:hydratePinia'
+ onAfterRenderSSRAppPinia: 'import:vike-pinia/renderer/dehydratePinia:dehydratePinia',
+ onBeforeMountAppPinia: 'import:vike-pinia/renderer/hydratePinia:hydratePinia'
}
declare global {
diff --git a/packages/vike-vue/src/+config.ts b/packages/vike-vue/src/+config.ts
index 01676fa9..c9222545 100644
--- a/packages/vike-vue/src/+config.ts
+++ b/packages/vike-vue/src/+config.ts
@@ -89,9 +89,15 @@ const config = {
onCreateAppPinia: {
env: { server: true, client: true }
},
+ onAfterRenderSSRAppPinia: {
+ env: { server: true }
+ },
onAfterRenderSSRApp: {
env: { server: true }
},
+ onBeforeMountAppPinia: {
+ env: { server: false, client: true }
+ },
onBeforeMountApp: {
env: { server: false, client: true }
},
@@ -172,6 +178,20 @@ declare global {
*/
onCreateAppPinia?: OnCreateAppSync | OnCreateAppAsync
+ /**
+ * Temporary workaround until `cumulative` is implemented for `onCreateApp`.
+ *
+ * See https://github.com/vikejs/vike-vue/pull/65#discussion_r1449227587
+ */
+ onAfterRenderSSRAppPinia?: OnAfterRenderSSRAppSync | OnAfterRenderSSRAppAsync
+
+ /**
+ * Temporary workaround until `cumulative` is implemented for `onCreateApp`.
+ *
+ * See https://github.com/vikejs/vike-vue/pull/65#discussion_r1449227587
+ */
+ onBeforeMountAppPinia?: OnBeforeMountAppSync | OnBeforeMountAppAsync
+
/**
* Hook called right after rendering the page's root Vue component.
* The hook can return additional page context that will be passed to the client under `pageContext.fromHtmlRenderer`.
diff --git a/packages/vike-vue/src/renderer/onRenderClient.ts b/packages/vike-vue/src/renderer/onRenderClient.ts
index 47eb018b..20a27ceb 100644
--- a/packages/vike-vue/src/renderer/onRenderClient.ts
+++ b/packages/vike-vue/src/renderer/onRenderClient.ts
@@ -16,6 +16,7 @@ const onRenderClient: OnRenderClientAsync = async (pageContext): ReturnType`
let pageView: ReturnType | ReturnType | string = ''
- let fromHtmlRenderer = undefined
+ const fromHtmlRenderer: PageContext['fromHtmlRenderer'] = {}
if (!!pageContext.Page) {
// SSR is enabled
@@ -29,7 +29,9 @@ const onRenderHtml: OnRenderHtmlAsync = async (pageContext): ReturnType | string = ''
diff --git a/packages/vike-vue/src/types/PageContext.ts b/packages/vike-vue/src/types/PageContext.ts
index 06506ed5..e7b0d4a4 100644
--- a/packages/vike-vue/src/types/PageContext.ts
+++ b/packages/vike-vue/src/types/PageContext.ts
@@ -25,7 +25,7 @@ declare global {
app?: VikeVueApp
// Set by onRenderHtml()
- fromHtmlRenderer: unknown
+ fromHtmlRenderer: Record
}
}
}