fix(ssr): avoid hard-coded ssr checks in cjs builds

This commit is contained in:
Evan You
2020-01-29 09:49:17 -05:00
parent 6b1ce00621
commit bc07e95ca8
8 changed files with 31 additions and 19 deletions

View File

@@ -19,8 +19,7 @@ import {
isPromise,
isArray,
isFunction,
isVoidTag,
EMPTY_OBJ
isVoidTag
} from '@vue/shared'
import { renderProps } from './renderProps'
import { escape } from './escape'
@@ -104,7 +103,11 @@ function renderComponentVNode(
parentComponent: ComponentInternalInstance | null = null
): ResolvedSSRBuffer | Promise<ResolvedSSRBuffer> {
const instance = createComponentInstance(vnode, parentComponent)
const res = setupComponent(instance, null)
const res = setupComponent(
instance,
null /* parentSuspense */,
true /* isSSR */
)
if (isPromise(res)) {
return res.then(() => renderComponentSubTree(instance))
} else {