create-vike 0.0.332 → 0.0.334
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/.testRun.ts +4 -1
- package/boilerplate-react/package.json +1 -1
- package/boilerplate-react-ts/package.json +1 -1
- package/boilerplate-vue/package.json +1 -1
- package/boilerplate-vue/renderer/app.js +5 -18
- package/boilerplate-vue-ts/package.json +3 -2
- package/boilerplate-vue-ts/renderer/app.ts +4 -19
- package/package.json +1 -1
package/.testRun.ts
CHANGED
|
@@ -31,7 +31,10 @@ function testRun(
|
|
|
31
31
|
const isDev = !isProd
|
|
32
32
|
const testHMR = isDev && (uiFramewok === 'react' || uiFramewok === 'vue')
|
|
33
33
|
|
|
34
|
-
run(cmd, {
|
|
34
|
+
run(cmd, {
|
|
35
|
+
// HMR tests are flaky (I couldn't make them reliable)
|
|
36
|
+
isFlaky: testHMR
|
|
37
|
+
})
|
|
35
38
|
|
|
36
39
|
test('page content is rendered to HTML', async () => {
|
|
37
40
|
const html = await fetchHtml('/')
|
|
@@ -1,30 +1,17 @@
|
|
|
1
1
|
export { createApp }
|
|
2
2
|
|
|
3
|
-
import { createSSRApp, defineComponent, h, markRaw, reactive } from 'vue'
|
|
3
|
+
import { createSSRApp, defineComponent, h, markRaw, reactive, ref } from 'vue'
|
|
4
4
|
import PageShell from './PageShell.vue'
|
|
5
5
|
import { setPageContext } from './usePageContext'
|
|
6
6
|
|
|
7
7
|
function createApp(pageContext) {
|
|
8
8
|
const { Page } = pageContext
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
const pageRef = ref(markRaw(Page))
|
|
11
|
+
|
|
11
12
|
const PageWithShell = defineComponent({
|
|
12
|
-
data: () => ({
|
|
13
|
-
Page: markRaw(Page)
|
|
14
|
-
}),
|
|
15
|
-
created() {
|
|
16
|
-
rootComponent = this
|
|
17
|
-
},
|
|
18
13
|
render() {
|
|
19
|
-
return h(
|
|
20
|
-
PageShell,
|
|
21
|
-
{},
|
|
22
|
-
{
|
|
23
|
-
default: () => {
|
|
24
|
-
return h(this.Page)
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
)
|
|
14
|
+
return h(PageShell, {}, { default: () => h(pageRef.value) })
|
|
28
15
|
}
|
|
29
16
|
})
|
|
30
17
|
|
|
@@ -34,7 +21,7 @@ function createApp(pageContext) {
|
|
|
34
21
|
Object.assign(app, {
|
|
35
22
|
changePage: (pageContext) => {
|
|
36
23
|
Object.assign(pageContextReactive, pageContext)
|
|
37
|
-
|
|
24
|
+
pageRef.value = markRaw(pageContext.Page)
|
|
38
25
|
}
|
|
39
26
|
})
|
|
40
27
|
|
|
@@ -1,32 +1,17 @@
|
|
|
1
1
|
export { createApp }
|
|
2
2
|
|
|
3
|
-
import { createSSRApp, defineComponent, h, markRaw, reactive } from 'vue'
|
|
3
|
+
import { createSSRApp, defineComponent, h, markRaw, reactive, ref } from 'vue'
|
|
4
4
|
import PageShell from './PageShell.vue'
|
|
5
|
-
import type { Component } from './types'
|
|
6
5
|
import { setPageContext } from './usePageContext'
|
|
7
6
|
import type { PageContext } from 'vike/types'
|
|
8
7
|
|
|
9
8
|
function createApp(pageContext: PageContext) {
|
|
10
9
|
const { Page } = pageContext
|
|
11
10
|
|
|
12
|
-
|
|
11
|
+
const pageRef = ref(markRaw(Page))
|
|
13
12
|
const PageWithShell = defineComponent({
|
|
14
|
-
data: () => ({
|
|
15
|
-
Page: markRaw(Page)
|
|
16
|
-
}),
|
|
17
|
-
created() {
|
|
18
|
-
rootComponent = this
|
|
19
|
-
},
|
|
20
13
|
render() {
|
|
21
|
-
return h(
|
|
22
|
-
PageShell,
|
|
23
|
-
{},
|
|
24
|
-
{
|
|
25
|
-
default: () => {
|
|
26
|
-
return h(this.Page)
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
)
|
|
14
|
+
return h(PageShell, {}, { default: () => h(pageRef.value) })
|
|
30
15
|
}
|
|
31
16
|
})
|
|
32
17
|
|
|
@@ -36,7 +21,7 @@ function createApp(pageContext: PageContext) {
|
|
|
36
21
|
objectAssign(app, {
|
|
37
22
|
changePage: (pageContext: PageContext) => {
|
|
38
23
|
Object.assign(pageContextReactive, pageContext)
|
|
39
|
-
|
|
24
|
+
pageRef.value = markRaw(pageContext.Page)
|
|
40
25
|
}
|
|
41
26
|
})
|
|
42
27
|
|