wip(ssr): further restructure
This commit is contained in:
parent
27fbfbdb8b
commit
f4d190cc9c
@ -1,4 +1,4 @@
|
||||
describe('ssr: render raw vnodes', () => {
|
||||
describe('ssr: render props', () => {
|
||||
test('class', () => {})
|
||||
|
||||
test('styles', () => {
|
@ -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'
|
||||
|
5
packages/server-renderer/src/renderProps.ts
Normal file
5
packages/server-renderer/src/renderProps.ts
Normal file
@ -0,0 +1,5 @@
|
||||
export function renderProps() {}
|
||||
|
||||
export function renderClass() {}
|
||||
|
||||
export function renderStyle() {}
|
@ -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<SSRBuffer>
|
||||
export type ResolvedSSRBuffer = (string | ResolvedSSRBuffer)[]
|
||||
type SSRBuffer = SSRBufferItem[]
|
||||
type SSRBufferItem = string | ResolvedSSRBuffer | Promise<SSRBuffer>
|
||||
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
|
||||
}
|
||||
|
@ -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() {}
|
Loading…
Reference in New Issue
Block a user