wip(ssr): basic components

This commit is contained in:
Evan You
2020-02-05 23:07:23 -05:00
parent 27e2e482e9
commit ee5ed73361
20 changed files with 254 additions and 132 deletions

View File

@@ -19,6 +19,13 @@ import { warn } from './warning'
// resolveComponent, resolveDirective) during render
export let currentRenderingInstance: ComponentInternalInstance | null = null
// exposed for server-renderer only
export function setCurrentRenderingInstance(
instance: ComponentInternalInstance | null
) {
currentRenderingInstance = instance
}
// dev only flag to track whether $attrs was used during render.
// If $attrs was used during render then the warning for failed attrs
// fallthrough can be suppressed.

View File

@@ -101,7 +101,10 @@ export { registerRuntimeCompiler } from './component'
// SSR -------------------------------------------------------------------------
import { createComponentInstance, setupComponent } from './component'
import { renderComponentRoot } from './componentRenderUtils'
import {
renderComponentRoot,
setCurrentRenderingInstance
} from './componentRenderUtils'
import { isVNode, normalizeVNode } from './vnode'
// SSR utils are only exposed in cjs builds.
@@ -109,6 +112,7 @@ const _ssrUtils = {
createComponentInstance,
setupComponent,
renderComponentRoot,
setCurrentRenderingInstance,
isVNode,
normalizeVNode
}