// For integration with runtime compiler
export { registerRuntimeCompiler } from './component'
-// For server-renderer
-// TODO move these into a conditional object to avoid exporting them in client
-// builds
-export { createComponentInstance, setupComponent } from './component'
-export { renderComponentRoot } from './componentRenderUtils'
-export { normalizeVNode } from './vnode'
+// SSR -------------------------------------------------------------------------
+import { createComponentInstance, setupComponent } from './component'
+import { renderComponentRoot } from './componentRenderUtils'
+import { normalizeVNode } from './vnode'
+
+// SSR utils are only exposed in SSR builds.
+const _ssrUtils = {
+ createComponentInstance,
+ setupComponent,
+ renderComponentRoot,
+ normalizeVNode
+}
+
+export const ssrUtils = (__SSR__ ? _ssrUtils : null) as typeof _ssrUtils
// Types -----------------------------------------------------------------------
ComponentInternalInstance,
VNode,
VNodeChildren,
- createComponentInstance,
- setupComponent,
createVNode,
- renderComponentRoot,
Text,
Comment,
Fragment,
Portal,
ShapeFlags,
- normalizeVNode
+ ssrUtils
} from 'vue'
import {
isString,
import { renderProps } from './renderProps'
import { escape } from './escape'
+const {
+ createComponentInstance,
+ setupComponent,
+ renderComponentRoot,
+ normalizeVNode
+} = ssrUtils
+
// Each component has a buffer array.
// A buffer array can contain one of the following:
// - plain string