Releases: dvajs/dva
Releases · dvajs/dva
2.0.1 (September 5, 2017)
2.0.0 (September 4, 2017)
详细的中文版发布日志请看 [email protected] 发布。
Enhancement
dispatch(effectAction) => Proimse
例如:
dispatch({ type: 'count/addAsync' })
.then(() => {
console.log('done');
});
Add dva/dynamic
util to dynamic load Route Component and models
const Users = dynamic({
app,
models: [
import('./models/users'),
],
component: import('./routes/Users'),
});
// render
<Route exact path="/users" component={Users} />
Add namespace prefix to take automatically
{
namespace: 'count',
effects: {
*a(action, { take }) {
// Before
yield take('count/b');
// After
yield take('b');
}
}
}
Break Changes
react-router@4
dva@2 based on react-router@4.
Reducer and effect with the same name will not fallthrough (both executed), but only execute effect
// model.js
export default {
namespace: 'count',
reducers: {
a() {},
},
effects: {
*a() {},
}
}
// Only execute effects.a, don't execute reducers.a
dispatch({ type: 'count/a' });
No dva/mobile
Use dva-no-router instead.
1.2.0 (December 30, 2016)
此版本无不 BREAK CHANGE,使用 [email protected] 的同学可无缝升级。
改进
- 通过
app.unmodel
支持 model 的取消注册,详见 API (#137) - 支持 SSR,附 boilerplate (#303)
- 支持 redux enhancer (#258, #439)
- 通过
dva/saga
输出 redux-saga 的所有 API (#393, #432) - 替换 whatwg-fetch 为 isomorphic-fetch,让 SSR 时可共用 fetch
app.model()
时检查命名冲突 (#203)- 尺寸减少,压缩后的 dva-min.js 从
301K
减少到201K
,详见 #138 - 升级 redux-saga 到 0.14,内部命名改进,无功能变化
- 移除 redux-actions 依赖
- 生产环境不添加 redux-devtools 中间件 (#442)
工具
- babel-plugin-dva-hmr @0.2.1,支持 model 的热替换
- dva-cli @0.7.4,通过
dva generate
辅助脚手架生成,并启用 roadhog 作为 server, build 和 test 工具
文档
- 重新梳理中英文版的简介、概念和 API 等文档,入口为 https://github.com/dvajs/dva
- 新的 dva 教程: 12 步 30 分钟,完成用户管理的 CURD 应用 (react+dva+antd)
- Deprecated dva-docs
This version of dva has no BREAK CHANGE. If you're using [email protected], feel free to upgrade with no modification.
Improvement
- Support model unregister with
app.unmodel
, checkout API for details (#137) - Support SSR, and boilerplate (#303)
- Support redux enhancer (#258, #439)
- Export all the API of redux-saga with
dva/saga
(#393, #432) - Replace whatwg-fetch with isomorphic-fetch for SSR reason
- Check namespace conflict when
app.model()
(#203) - Reduce bundle size, make uglified dva-min.js from
301K
to201K
, checkout #138 for details - Upgrade redux-saga to 0.14, code style improvement, no feature change
- Remove redux-actions dependency
- Don't add redux-devtools in production (#442)
Tool
- babel-plugin-dva-hmr @0.2.1, support HMR with models
- dva-cli @0.7.4, speed up file generation wieh
dva generate
, and use roadhog as the tool for server, build and test
Documentation
- Rewrite introduction, concepts and API documentation, the entry is https://github.com/dvajs/dva
- Deprecated dva-docs
1.1.0 (October 14, 2016)
Changes
- Fully typescript support, and have setup a dva-boilerplate-typescript for quicking start. (#44, #142, #157)
onError
hook supports dispatch action (#126, #136)onEffect
hook supports actionType, and we used it for implement effect level loading state in dva-loading (#94, dvajs/dva-loading#1, dvajs/dva-loading#4)- Upgraded redux-saga to 0.12 enhancement, add
throttle
type to effect (#129, #135)
Bug Fix
1.0.0
- #42
- Add namespace prefix for reducers and effects automatically
- Add namespace prefix for dispatch in subscriptions, and put in effects
- Delete api
dva/effects
, it's passed to effect as second argument - Simplify
app.start()
, move config todva()
- Change subscriptions format to Object, keep the same with effects and reducers
- Replace assert with invariant and warning
- Refactor testcase
- #56 - Remove router match from history, use path-to-regexp instead, example
- #59 - Add onEffect hook, so we can use plugin like dva-loading
- #71 - Use handleActions directly to resize dva size by 46K (minified)
Docs: Upgrade to 1.0.0