Skip to content

Commit 680bebf

Browse files
committed
chore: check initial data on package page
1 parent 40d1964 commit 680bebf

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

app/pages/package/[[org]]/[name].vue

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,53 @@ const isSpaFallback = shallowRef(hasEmptyPayload && !nuxtApp.payload.path)
266266
const isHydratingWithServerContent = shallowRef(
267267
hasEmptyPayload && nuxtApp.payload.path === route.path,
268268
)
269+
270+
watch(isSpaFallback, value => {
271+
console.log('isSpaFallback', value)
272+
})
273+
watch(isHydratingWithServerContent, value => {
274+
console.log('isHydratingWithServerContent', value)
275+
})
276+
watch(
277+
[
278+
() => hasEmptyPayload,
279+
() => isSpaFallback.value,
280+
() => isHydratingWithServerContent.value,
281+
() => status.value,
282+
],
283+
([hasEmptyPayloadArg, isSpaFallbackArg, isHydratingWithServerContentArg, statusArg]) => {
284+
console.log(
285+
'main bunch',
286+
hasEmptyPayloadArg,
287+
isSpaFallbackArg,
288+
isHydratingWithServerContentArg,
289+
statusArg,
290+
)
291+
},
292+
)
293+
watch(
294+
[
295+
() => import.meta.client,
296+
() => nuxtApp.isHydrating,
297+
() => nuxtApp.payload.serverRendered,
298+
() => Object.keys(nuxtApp.payload.data ?? {}).length,
299+
],
300+
([importMetaClientArg, isHydratingArg, serverRenderedArg, dataLengthArg]) => {
301+
console.log(
302+
'additional bunch',
303+
importMetaClientArg,
304+
isHydratingArg,
305+
serverRenderedArg,
306+
dataLengthArg,
307+
)
308+
},
309+
)
310+
watch(
311+
() => nuxtApp.payload.data,
312+
data => {
313+
console.log('nuxtApp.payload.data', data)
314+
},
315+
)
269316
// When we have server-rendered content but no payload data, capture the server
270317
// DOM before Vue's hydration replaces it. This lets us show the server-rendered
271318
// HTML as a static snapshot while data refetches, avoiding any visual flash.

0 commit comments

Comments
 (0)