-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【博客2.0】技术栈选型 #208
Comments
啊哈,不用dva的话可以试试rematch |
已经更新。还有什么有意思的技术栈可以补充上~ |
EthanLin-TWer
added a commit
that referenced
this issue
Jun 22, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 22, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 22, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 22, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
EthanLin-TWer
added a commit
that referenced
this issue
Jun 24, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
选型
翻看以前的 Angular 代码时,发现早已看不懂,原因之一是层级有点混乱。于是想到,代码所谓的可读性,还不止在于代码自注释,它还需要一个更高层的「结构」,它需要符合人的思考、概念模型,这样才能一下就读懂这个应用的结构和各部分的功能。因此它最好是一个业界通用的模型。那就是架构了。那就是设计模式了。
用 dva 的话,一下子就不需要选择数据、路由和副作用工具了。像博客这种简单的 app,应该也没啥很复杂的定制化需求吧。
构建
部署
monorepo
webpack && rollup
dva
看 github 首页就知道了。是基于 React, Redux, redux-saga, react-router 封装的轻量级框架。不过看这个介绍可以知道,它的假设是,你要用 redux, redux-saga, react-router,可能还要用 umi。或者可以这样讲,作者认为这三个库是数据管理、副作用管理、路由管理的最佳实践或默认配置(在 官方文档 可以看到,这个假设是基于数据的)。
所以这么说吧:
特性部分。讲到4点:
所以,让我们关注在 效率提升 和 API 简单 这两点优点上。看了一下官方 demo,通过很多约定优于配置,将模板代码减少到了最少。节省的效率确实很爽!
可以看到,三大块:数据、路由、副作用分别只是包装了社区的最佳实践。
我会考察的一些点:
总的来说,看完一些简介,目前对 dva 的认识是说:它纯粹是为了提高开发效率而创造,没有新的东西,是对前端三大框架的封装。它怎么达到这个目标呢?通过约定式、框架本身隐含最佳实践的方式。
The text was updated successfully, but these errors were encountered: