1 Star 1 Fork 0

SyncGithub / Srejs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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(appprocess.env.NODE_ENV != 'production',false); 
app.use((ctx,next)=>{
    Sre.render(ctx,'index',{title:'标题'})
})
app.listen(8001);

Quikstart

MIT License

MIT License Copyright (c) 2021 dazjean Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

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

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/sync-github/Srejs.git
git@gitee.com:sync-github/Srejs.git
sync-github
Srejs
Srejs
main

搜索帮助