Skip to content

Releases: dvajs/dva

2.0.1 (September 5, 2017)

04 Sep 23:39
Compare
Choose a tag to compare

[email protected] (2017-09-05)

🐛 Bug Fix

  • dva-core, dva-no-router, dva-react-router-3, dva, dva-loading
  • dva-example-user-dashboard, dva

Committers: 2

2.0.0 (September 4, 2017)

04 Sep 07:11
Compare
Choose a tag to compare

详细的中文版发布日志请看 [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)

30 Dec 07:48
Compare
Choose a tag to compare

此版本无不 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 工具

文档


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 to 201K, 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

Documentation

1.1.0 (October 14, 2016)

14 Oct 07:35
Compare
Choose a tag to compare

Changes

Bug Fix

  • Fixed window undefined in non-browser env (#105)
  • Fixed model should not inject if exists (#152, #158)

1.0.0

27 Dec 09:29
Compare
Choose a tag to compare
  • #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 to dva()
    • 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