Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 3.1 KB

README.en.md

File metadata and controls

50 lines (35 loc) · 3.1 KB

San SSR

npm version downloads Build Status Coveralls semantic-release GitHub issues David David Dev DUB license Commitizen friendly

The purpurse of this repo is to provide an SSR framework and utils for the san components.

Usage

The SanProject class is used to compile component files into ssr render function.

const { SanProject } = require('san-ssr')
const app = require('src/component.js')

const project = new SanProject()
const render = project.compileToRenderer(app)

console.log(render({name: 'harttle'}))

See API doc SanProject for details, or refer to the demo project in /demo directory.

Working with San

Supported san versions for each release are specified by peerDependencies, that means you'll need both san and san-ssr installed in case you need server side rendering. And it's considered compatible as long as you don't see any UNMET warning.

Note: As described in baidu/san/issues/441, a minor version in san implies possible BREAKING CHANGES, thus the peerDependency is specified via tilde version.

Other Target Platforms

san-ssr provides static analysis for San components and generates abstract component tree, while code generation is a separated process, which is provided by specific implementations: