vike-ripple 0.4.5 → 0.4.6
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/package.json
CHANGED
|
@@ -4,15 +4,30 @@ import { setPageContext } from '../hooks/usePageContext.js'
|
|
|
4
4
|
import { setHydrated } from '../hooks/useHydrated.js'
|
|
5
5
|
|
|
6
6
|
const onRenderClient = async (pageContext) => {
|
|
7
|
+
console.log('[vike-ripple] onRenderClient called', {
|
|
8
|
+
isHydration: pageContext.isHydration,
|
|
9
|
+
isFirstRender: 'isFirstRender' in pageContext,
|
|
10
|
+
hasPage: !!pageContext.Page,
|
|
11
|
+
url: pageContext.urlOriginal,
|
|
12
|
+
location: window.location.href,
|
|
13
|
+
})
|
|
14
|
+
|
|
7
15
|
const { Page } = pageContext
|
|
8
16
|
if (!Page) return
|
|
9
17
|
|
|
10
18
|
setPageContext(pageContext)
|
|
11
19
|
const container = document.getElementById('root')
|
|
12
|
-
if (!container)
|
|
20
|
+
if (!container) {
|
|
21
|
+
console.warn('[vike-ripple] no #root container')
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
console.log('[vike-ripple] container child count before:', container.childElementCount)
|
|
13
26
|
|
|
14
|
-
// mount() clears container (target.textContent = '') and renders
|
|
27
|
+
// Just mount — mount() clears container (target.textContent = '') and renders
|
|
15
28
|
const { mount } = await import('ripple')
|
|
16
29
|
mount(Page, { target: container, props: {} })
|
|
17
30
|
setHydrated()
|
|
31
|
+
|
|
32
|
+
console.log('[vike-ripple] container child count after:', container.childElementCount)
|
|
18
33
|
}
|