diff --git a/packages/server-renderer/__tests__/renderVnode.spec.ts b/packages/server-renderer/__tests__/renderProps.spec.ts similarity index 92% rename from packages/server-renderer/__tests__/renderVnode.spec.ts rename to packages/server-renderer/__tests__/renderProps.spec.ts index 038b9339..89c778fd 100644 --- a/packages/server-renderer/__tests__/renderVnode.spec.ts +++ b/packages/server-renderer/__tests__/renderProps.spec.ts @@ -1,4 +1,4 @@ -describe('ssr: render raw vnodes', () => { +describe('ssr: render props', () => { test('class', () => {}) test('styles', () => { diff --git a/packages/server-renderer/src/index.ts b/packages/server-renderer/src/index.ts index 8546d247..22885a58 100644 --- a/packages/server-renderer/src/index.ts +++ b/packages/server-renderer/src/index.ts @@ -1,16 +1,11 @@ import { toDisplayString } from 'vue' +import { escape } from './escape' -export { renderToString, renderComponent } from './renderToString' - -export { - renderVNode, - renderClass, - renderStyle, - renderProps -} from './renderVnode' - -export { escape } from './escape' +export { escape } export function interpolate(value: unknown) { return escape(toDisplayString(value)) } + +export { renderToString, renderComponent, renderSlot } from './renderToString' +export { renderClass, renderStyle, renderProps } from './renderProps' diff --git a/packages/server-renderer/src/renderProps.ts b/packages/server-renderer/src/renderProps.ts new file mode 100644 index 00000000..e3059eaa --- /dev/null +++ b/packages/server-renderer/src/renderProps.ts @@ -0,0 +1,5 @@ +export function renderProps() {} + +export function renderClass() {} + +export function renderStyle() {} diff --git a/packages/server-renderer/src/renderToString.ts b/packages/server-renderer/src/renderToString.ts index b35ca8f2..d55d77b8 100644 --- a/packages/server-renderer/src/renderToString.ts +++ b/packages/server-renderer/src/renderToString.ts @@ -9,11 +9,10 @@ import { renderComponentRoot } from 'vue' import { isString, isPromise, isArray, isFunction } from '@vue/shared' -import { renderVNode } from './renderVnode' -export type SSRBuffer = SSRBufferItem[] -export type SSRBufferItem = string | ResolvedSSRBuffer | Promise -export type ResolvedSSRBuffer = (string | ResolvedSSRBuffer)[] +type SSRBuffer = SSRBufferItem[] +type SSRBufferItem = string | ResolvedSSRBuffer | Promise +type ResolvedSSRBuffer = (string | ResolvedSSRBuffer)[] function createBuffer() { let appendable = false @@ -107,3 +106,11 @@ function innerRenderComponent( Promise.all(buffer as any) : (buffer as ResolvedSSRBuffer) } + +export function renderVNode(push: (item: SSRBufferItem) => void, vnode: VNode) { + // TODO +} + +export function renderSlot() { + // TODO +} diff --git a/packages/server-renderer/src/renderVnode.ts b/packages/server-renderer/src/renderVnode.ts deleted file mode 100644 index 09f32df2..00000000 --- a/packages/server-renderer/src/renderVnode.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { VNode } from 'vue' -import { SSRBufferItem } from './renderToString' - -export function renderVNode( - push: (item: SSRBufferItem) => void, - vnode: VNode -) {} - -export function renderProps() {} - -export function renderClass() {} - -export function renderStyle() {}