feat(server-renderer): render suspense in vnode mode (#727)

This commit is contained in:
Dmitry Sharshakov
2020-03-10 01:20:30 +03:00
committed by GitHub
parent e12ddd96ba
commit 589aeb402c
4 changed files with 133 additions and 4 deletions

View File

@@ -449,7 +449,7 @@ function createSuspenseBoundary<HostNode, HostElement>(
return suspense
}
function normalizeSuspenseChildren(
export function normalizeSuspenseChildren(
vnode: VNode
): {
content: VNode

View File

@@ -114,6 +114,7 @@ import {
setCurrentRenderingInstance
} from './componentRenderUtils'
import { isVNode, normalizeVNode } from './vnode'
import { normalizeSuspenseChildren } from './components/Suspense'
// SSR utils are only exposed in cjs builds.
const _ssrUtils = {
@@ -122,7 +123,8 @@ const _ssrUtils = {
renderComponentRoot,
setCurrentRenderingInstance,
isVNode,
normalizeVNode
normalizeVNode,
normalizeSuspenseChildren
}
export const ssrUtils = (__NODE_JS__ ? _ssrUtils : null) as typeof _ssrUtils