feat(ssr): compiler-ssr support for Suspense
This commit is contained in:
@@ -34,7 +34,7 @@ describe('ssr: components', () => {
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { resolveDynamicComponent: _resolveDynamicComponent } = require(\\"vue\\")
|
||||
const { ssrRenderComponent: _ssrRenderComponent } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(_ssrRenderComponent(_resolveDynamicComponent(_ctx.foo, _ctx.$), { prop: \\"b\\" }, null, _parent))
|
||||
}"
|
||||
@@ -269,7 +269,6 @@ describe('ssr: components', () => {
|
||||
})
|
||||
|
||||
test('built-in fallthroughs', () => {
|
||||
// no fragment
|
||||
expect(compile(`<transition><div/></transition>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"
|
||||
@@ -278,7 +277,6 @@ describe('ssr: components', () => {
|
||||
}"
|
||||
`)
|
||||
|
||||
// wrap with fragment
|
||||
expect(compile(`<transition-group><div/></transition-group>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"
|
||||
@@ -287,7 +285,6 @@ describe('ssr: components', () => {
|
||||
}"
|
||||
`)
|
||||
|
||||
// no fragment
|
||||
expect(compile(`<keep-alive><foo/></keep-alive>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { resolveComponent: _resolveComponent } = require(\\"vue\\")
|
||||
@@ -299,28 +296,6 @@ describe('ssr: components', () => {
|
||||
_push(_ssrRenderComponent(_component_foo, null, null, _parent))
|
||||
}"
|
||||
`)
|
||||
|
||||
// wrap with fragment
|
||||
expect(compile(`<suspense><div/></suspense>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_push(\`<div></div>\`)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
|
||||
test('portal rendering', () => {
|
||||
expect(compile(`<portal :target="target"><div/></portal>`).code)
|
||||
.toMatchInlineSnapshot(`
|
||||
"const { ssrRenderPortal: _ssrRenderPortal } = require(\\"@vue/server-renderer\\")
|
||||
|
||||
return function ssrRender(_ctx, _push, _parent) {
|
||||
_ssrRenderPortal((_push) => {
|
||||
_push(\`<div></div>\`)
|
||||
}, _ctx.target, _parent)
|
||||
}"
|
||||
`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user