Comments (4)
OK
from ssr.
plugin-faas plugin-react plugin-midway plugin-vue
大概用法如下。每个插件会暴露 start, build, deploy 等方法来启动服务
https://github.com/ykfe/ssr/blob/feat/plugins/packages/plugin-faas/src/index.ts
https://github.com/ykfe/ssr/blob/feat/plugins/packages/plugin-react/src/index.ts
https://github.com/ykfe/ssr/blob/feat/plugins/example/serverless-react-ssr/config.js
from ssr.
运行模式
支持 ssr/csr 两种运行模式,可通过 config.js 指定渲染模式,也可以运行过程中注入实时 config 来不发版修改渲染模式
插件列表
plugin-faas 负责 服务端为 serverless 情况下服务的启动和部署,依赖框架 midway-faas
plugin-react 负责前端框架为 React 情况下的 webpack 配置 以及 打包入口服务
plugin-midway 负责 服务端为 传统 Node.js 场景下服务的启动和构建,依赖框架 midway,midway默认底层框架为egg
plugin-vue 负责前端框架为 Vue 情况下的 webpack 配置 以及 打包入口服务,是否能够支持 vite 待定
其余 包
ssr-core-react 存放将 react 场景下服务端 bundle编译为 string/stream 的能力,只依赖一些简单的模块例如 react-dom.renderToString
ssr-core-react 存放将 vue 场景下服务端 bundle编译为 string/stream 的能力,只依赖一些简单的模块例如 vue-server.renderToString
ssr-webpack 负责启动本地开发的 服务端bundle/客户端bundle 对应webpack 服务,提供 热更新能力,webpack配置由具体的插件传入
ssr-server-utils 在 Node.js 环境下使用的工具库
ssr-client-utils 在浏览器环境下使用的工具库,禁止依赖 Node.js 模块 如 fs, path 等模块,常用于保存 hoc 高阶组件
ssr-types 抽离公共的类型
注意事项
由于 faaS 场景对代码包的大小很敏感,所以开发过程中需要非常注意分离开发环境依赖以及生产环境依赖。避免产生交集。
1、开发过程需要注意 plugin 类型的依赖只能够用于本地开发进行 start build 的操作,作为项目的 devDependencies。生产环境不得依赖 plugin 的功能
2、生产环境只能够依赖 ssr-core-react, ssr-core-vue ,ssr-server-utils 这些库。ssr, ssr-webpack 这些库同样只用于本地开发构建使用
from ssr.
下一步
1、官网建设
2、轻量级 vue 组件通信, provide/inject
from ssr.
Related Issues (20)
- 好像不支持动态配置文件 HOT 4
- Webpack最优化问题 HOT 1
- 使用antd时存在样式闪烁问题 HOT 7
- sourcemap 对应配置完善后,构建产物中未生成 sourcemap 文件 HOT 2
- 官网挂了,麻烦看一下 HOT 4
- ssr build 优化建议 HOT 3
- 框架怎么设置 productionSourceMap HOT 3
- vite编译超时 HOT 3
- 怎么引入element-plus HOT 14
- 通过 less loader 配置的 less 变量不生效 HOT 5
- 请问有没有 egg的服务端插件? 如果没有,后端想使用egg,该怎么做呢,谢谢。 HOT 5
- 访问未定义的路由时,server端代码报错
- 生产环境的antdv ui css 样式和开发环境不一致 HOT 4
- 引入 css文件 报错 HOT 17
- 请问启动后,isBrower找不到,编译报错怎么解决?谢谢 HOT 2
- npx ssr build --html 编译出错 HOT 1
- 使用midway-vue3-ssr模版在组件中访问public下的静态资源404 HOT 3
- antd5新版本的兼容性问题
- 新版本antd5兼容性问题 HOT 4
- ssr-plugin-react 新版本缺少src路径
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ssr.