- 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
- Fix renderProps undefined when redirecting
- 34 - Support dynamic load
- Break Change: 32 - Improve subscription, with api break change
- 33 - Change plugin from singleton to class, so won't break with multiple dva instance
- 31, Add onReducer hook to support reducer enhancer
- Fix fetch and router don't work
- 28, Support plugin with
app.use
- Export api from react-router-redux, so we can use actions like
push
,go
,replace
, ... - Use whatwg-fetch instead of isomorphic-fetch
- app.start: Return react component so that can be rendered by ReactDOM
- 12 - Fix effects can't pass arguments
- 7 - API Improvement
详见:API 设计
- Change
app.start(elementId)
toapp.start(domElement)
- 5 - Prepare umd build before publish, then we can make demo on jsfiddle and jsbin more easily
- Change router format from jsx element to component function
- Export render from app.start, so we can apply hmr to routes and components, HMR Example
先说 Router 。之前是这样的:
app.router(
<Route path="/" component={App} />
);
这有几个问题:
- 不支持 Dynamic Routing
- 有多个路由配置时,由于 jsx 的限制,必须有一个额外的 element 把它们包含起来。比如:
<div><Route path="/a" /><Route path="/b" /></div>
- HMR 支持问题。
<Router>
不放外面传入会触发 react-router 的 rerender,而 react-router 不允许 rerender
另外,app.start
return render 方法纯粹是为了支持 components 和 routes 的 HMR,之后如果找到更好的方法,会去掉。
- 4 - Extend effects, support takeLatest and takeEvery
- Add fetch, so we can
import fetch from 'dva/fetch'
- First version