com

@srejs/common

Server rendering engine 缩写为 srejs 即服务器端渲染引擎,为React,Vue提供轻量级封装的服务端渲染骨架。提供了类似模板引擎一样的用法用于在Koa框架中使用。

Showing:

Popularity

Downloads/wk

48

GitHub Stars

13

Maintenance

Last Commit

3d ago

Contributors

1

Package

Dependencies

6

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme


Server rendering engine, abbreviated as srejs, is the server-side rendering engine. It provides the simplest and most flexible react and Vue lightweight server-side rendering skeleton tool for each node development framework, and supports the use in any koa framework.

react vue License Node

Server rendering engine 缩写为 Srejs, 即服务器端渲染引擎,为各个node开发框架提供最简单,最灵活的React,Vue轻量级服务端渲染骨架工具,支持在任何koa框架中使用。

Development

yarn install
cd packages/app && npm start   // 开发调试react
cd packages/app-vue && npm start // 开发调试vue

Feature

  • 🚀 支持SSR和CSR模式切换
  • 🚀 数据管理支持redux,useContext+useReducer
  • 🚀 服务端数据初始化
  • 🚀 搭配react-router使用,不局限服务端路由,可动态修改baseName
  • 🚀 自定义HTML和SEO
  • 🚀 vue2.0
  • 🚀 vuex
  • 🚀 vue-router
  • 🚀 单页面应用和多页面应用
  • 🚀 页面级构建更新
  • layout
  • vue3.0+vite

Client

//web/pages/index/index.ts
import React from 'react'
export default function (props:any) {
  const { title } = props
  return <div className="ts-demo">{title}</div>
}

Server

import koa from 'koa';
import srejs from '@srejs/react';
// import srejs from '@srejs/vue'; 

const app = new koa();
const Sre = new srejs(app,process.env.NODE_ENV != 'production',false); 
app.use((ctx,next)=>{
    Sre.render(ctx,'index',{title:'标题'})
})
app.listen(8001);

Quikstart

MIT License

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100