feat(ssr/suspense): suspense hydration
In order to support hydration of async components, server-rendered fragments must be explicitly marked with comment nodes.
This commit is contained in:
@@ -80,7 +80,7 @@ describe('ssr: v-if', () => {
|
||||
"
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
if (_ctx.foo) {
|
||||
_push(\`hello\`)
|
||||
_push(\`<!--1-->hello<!--0-->\`)
|
||||
} else {
|
||||
_push(\`<!---->\`)
|
||||
}
|
||||
@@ -110,7 +110,7 @@ describe('ssr: v-if', () => {
|
||||
"
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
if (_ctx.foo) {
|
||||
_push(\`<div>hi</div><div>ho</div>\`)
|
||||
_push(\`<!--1--><div>hi</div><div>ho</div><!--0-->\`)
|
||||
} else {
|
||||
_push(\`<!---->\`)
|
||||
}
|
||||
@@ -126,9 +126,11 @@ describe('ssr: v-if', () => {
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
if (_ctx.foo) {
|
||||
_push(\`<!--1-->\`)
|
||||
_ssrRenderList(_ctx.list, (i) => {
|
||||
_push(\`<div></div>\`)
|
||||
})
|
||||
_push(\`<!--0-->\`)
|
||||
} else {
|
||||
_push(\`<!---->\`)
|
||||
}
|
||||
@@ -145,7 +147,7 @@ describe('ssr: v-if', () => {
|
||||
"
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
if (_ctx.foo) {
|
||||
_push(\`<div>hi</div><div>ho</div>\`)
|
||||
_push(\`<!--1--><div>hi</div><div>ho</div><!--0-->\`)
|
||||
} else {
|
||||
_push(\`<div></div>\`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user