vike-ripple 0.4.7 → 0.4.9
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
|
@@ -13,14 +13,6 @@ const tsrx_element = (fn) => ({
|
|
|
13
13
|
let dispose = null
|
|
14
14
|
|
|
15
15
|
const onRenderClient = async (pageContext) => {
|
|
16
|
-
console.log('[vike-ripple] onRenderClient', {
|
|
17
|
-
isHydration: pageContext.isHydration,
|
|
18
|
-
url: pageContext.urlOriginal,
|
|
19
|
-
hasPage: !!pageContext.Page,
|
|
20
|
-
hasLayout: !!pageContext.config?.Layout,
|
|
21
|
-
hasWrapper: !!pageContext.config?.Wrapper,
|
|
22
|
-
})
|
|
23
|
-
|
|
24
16
|
const { Page, config } = pageContext
|
|
25
17
|
if (!Page) return
|
|
26
18
|
|
|
@@ -28,8 +20,6 @@ const onRenderClient = async (pageContext) => {
|
|
|
28
20
|
const container = document.getElementById('root')
|
|
29
21
|
if (!container) return
|
|
30
22
|
|
|
31
|
-
console.log('[vike-ripple] container child count before:', container.childElementCount)
|
|
32
|
-
|
|
33
23
|
// ── Build same component tree as SSR ──
|
|
34
24
|
// Apply Layouts (innermost first → outermost last)
|
|
35
25
|
const Layout = config.Layout ?? config.layout
|
|
@@ -53,21 +43,14 @@ const onRenderClient = async (pageContext) => {
|
|
|
53
43
|
|
|
54
44
|
// ── Clean up previous root ──
|
|
55
45
|
if (dispose) {
|
|
56
|
-
console.log('[vike-ripple] disposing previous root')
|
|
57
46
|
dispose()
|
|
58
47
|
dispose = null
|
|
59
48
|
}
|
|
60
49
|
|
|
61
|
-
//
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
} else {
|
|
67
|
-
const { mount } = await import('ripple')
|
|
68
|
-
console.log('[vike-ripple] using mount')
|
|
69
|
-
dispose = mount(component, { target: container, props: {} })
|
|
70
|
-
}
|
|
50
|
+
// Always use mount() — hydrate() crashes Ripple's hmr wrapper (hydrate_node is null).
|
|
51
|
+
// mount() clears the container (target.textContent = '') and renders fresh.
|
|
52
|
+
// Ripple SSR is used for content delivery; client side always re-renders.
|
|
53
|
+
const { mount } = await import('ripple')
|
|
54
|
+
dispose = mount(component, { target: container, props: {} })
|
|
71
55
|
setHydrated()
|
|
72
|
-
console.log('[vike-ripple] container child count after:', container.childElementCount)
|
|
73
56
|
}
|