Vortigern通用Web应用脚手架TypeScript、React、Redux、服务端渲染

TypeScript 和 React 的组合,配上 Redux 和服务端渲染,Vortigern 这个脚手架算是比较全能的一个了。你要是想快速起一个有点规模的 Web 项目,嗯,它确实挺省事。

Vortigern的定位挺清晰:做一个可以跑在客户端和服务器端的通用 React 应用。不仅代码结构合理,而且打包、路由、状态管理这些都帮你配好了。用的库也都是现在主流的,像ReactReduxReact RouterTypeScript这些,基本是标配。

状态这块,用的是redux + redux-thunk,你可以方便地写异步求逻辑,配合isomorphic-fetch,客户端、服务端都能通用。还有一个细节挺好,状态和路由是同步的,用的是react-router-redux,不容易出 bug。

样式支持也不错,服务端可以预加载 CSS,省了不少事。开发时还有Webpack热更新,改完能秒看到效果,响应也快。ts-loaderbabel-loader 也都配置好了,想直接撸 TS 没问题。

构建这块是用的 Webpack,已经配好了基本的构建逻辑,包括服务端打包和客户端打包两个环境。目录结构也清晰,src 下面一目了然。要是你有 CI/CD 的需求,改改也挺方便的。

不过也不是全无缺点,项目稍微有点重,如果只是做个小页面,会有点大材小用。但如果你打算做一个长期维护的中大型项目,它还是挺合适的。

如果你对React SSR感兴趣,可以顺带看看这篇演示文章:React 服务器端渲染演示,和 Vortigern 的思路比较像,蛮有参考价值的。

Vortigern适合那种不想重复配置、又项目结构专业点的你。刚上手要看下文档,但整体还算好懂。要是你也在折腾 React SSR,不妨试试。

zip
vortigern-develop.zip 预估大小:60个文件
folder
vortigern-develop 文件夹
file
.dockerignore 509B
file
.gitattributes 360B
file
yarn.lock 272KB
file
.stylelintrc 267B
folder
src 文件夹
file
server.tsx 3KB
file
favicon.ico 31KB
folder
app 文件夹
folder
redux 文件夹
file
store.ts 1KB
folder
modules 文件夹
folder
stars 文件夹
file
index.ts 2KB
file
index.test.ts 2KB
folder
counter 文件夹
file
index.ts 892B
file
index.test.ts 1KB
file
reducers.ts 484B
file
IStore.ts 150B
folder
models 文件夹
file
counter.ts 100B
file
stars.ts 215B
folder
containers 文件夹
folder
App 文件夹
file
index.test.tsx 343B
file
index.tsx 486B
file
style.css 67B
file
index.tsx 244B
folder
About 文件夹
file
index.test.tsx 447B
file
index.tsx 256B
file
style.css 10B
folder
Counter 文件夹
file
index.test.tsx 1KB
file
index.tsx 1KB
file
style.css 14B
folder
Stars 文件夹
file
index.test.tsx 549B
file
index.tsx 757B
file
style.css 10B
folder
Home 文件夹
file
index.test.tsx 536B
file
index.tsx 298B
file
style.css 32B
file
barbar.png 10KB
folder
Html 文件夹
file
index.tsx 2KB
folder
components 文件夹
file
index.tsx 35B
folder
Header 文件夹
file
index.tsx 379B
file
style.css 171B
folder
helpers 文件夹
file
TestHelper.tsx 733B
folder
routes 文件夹
file
index.tsx 387B
file
client.tsx 908B
folder
vendor 文件夹
file
main.ts 252B
file
.babelrc 36B
folder
.vscode 文件夹
file
settings.json 56B
file
tasks.json 617B
file
Dockerfile 169B
file
.travis.yml 219B
file
tsconfig.json 622B
folder
config 文件夹
file
main.js 678B
folder
types 文件夹
file
dev.d.ts 318B
folder
test 文件夹
file
karma.conf.js 4KB
folder
webpack 文件夹
file
prod.js 4KB
file
server.js 2KB
file
test.js 302B
file
dev.js 3KB
file
index.js 146B
file
LICENSE 1KB
file
tslint.json 462B
file
README.md 9KB
file
.editorconfig 414B
file
.gitignore 525B
file
package.json 5KB
...
zip 文件大小:124.85KB