dva

🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)

MIT License

Downloads
291.7K
Stars
16.2K
Committers
101

Bot releases are visible (Hide)

dva -

Published by sorrycc about 6 years ago

[email protected] (2018-09-20)

💅 Enhancement

  • dva-core, dva-immer, dva-loading, dva-no-router, dva-react-router-3, dva
    • #1908 feat: upgrade babel to 7, and use @babel/runtime-corejs2 (@sorrycc)
  • dva-loading

Committers: 4

dva -

Published by sorrycc about 6 years ago

[email protected] (2018-08-10)

🐛 Bug Fix

💅 Enhancement

  • dva-core
  • dva-no-router, dva
  • dva-no-router
    • #1849 chore: include missed *.d.ts files for dva-no-router in package.json. (@baurine)

Committers: 5

dva -

Published by sorrycc over 6 years ago

[email protected] (2018-06-11)

🐛 Bug Fix

📝 Documentation

Committers: 2

dva -

Published by sorrycc over 6 years ago

[email protected] (2018-06-01)

🐛 Bug Fix

  • dva
    • #1698 Fix incorrect Typescript definition for router. (@shapel)

💅 Enhancement

  • dva-core
    • #1661 enhance: saga-effect take should be able to take multi actions;. (@sjy)
    • #1690 feat: Support put.resolve to wait the effect to resolve. (@macroxing)
    • #1532 feat: Add extension args to onError hook. (@macroxing)
    • #1627 feat(dva-core): migrate to redux@4. (@sorrycc)
  • dva-immer
    • #1729 Feat(dva-immer): compatibility with normal reducer modify pattern. (@paranoidjk)
  • dva

Committers: 14


中文版 CHANGELOG:

  • 支持 put.resolve 调用其他的 effect,#1690
  • dva-immer 兼容旧的 reducer 写法,所以现在就可以在旧项目里用起来了,#1729
  • 升级 redux 到 4,#1627
  • take 支持多个 action,#1661
  • onError 提供额外的 args,#1532
  • 修复 ts 定义,#1668,#1698
dva -

Published by sorrycc over 6 years ago

[email protected] (2018-04-18)

🐛 Bug Fix

  • dva

Committers: 1

dva -

Published by sorrycc over 6 years ago

Improvement

  • support Typescript, #1248
  • new dva plugin: umi-immer, #1595
  • dva/dynamic support return Promise with model Array, #1355
  • update deps for react-router-redux and redux-saga,#1330
  • throw error when action's type is empty, #1607
  • Refact: update scripts, umd bundle with rollup, test with jest, es module, ..., #1594

Bugfix

  • 修复 dva/dynamic 在动态加载没完成但组件已被卸载时报 setState 警告,#1391
  • fix redux-saga bundled twice, #1610
  • fix model without reducers will lose state after it's injected, #1608
  • fix register the model will affecting itself, #1605
  • fix typo, extitraReducers to extraReducers, #1522
  • fix return Promises when trigger the same effect multiple times, #1602
  • fix the known root container, #1589, #1591

中文版 CHANGELOG :

改进

  • 新增 Typescript 支持, #1248
  • 新增 dva 插件 umi-immer,允许在 reducer 中直接修改对象进行更新,后续会写文章介绍, #1595
  • 新增 dva/dynamic 支持返回数组格式的 model Promise, #1355
  • 增加在 action type 为空时报错, #1607
  • 更新 react-router-redux 依赖版本,修复 peerDependencies 警告问题,#1330
  • Refact: update scripts, umd bundle with rollup, test with jest, es module, ..., #1594

Bugfix

  • 修复 dva/dynamic 在动态加载没完成但组件已被卸载时报 setState 警告,#1391
  • 修复 redux-saga 被打包两次的问题,压缩后尺寸减少 8K, #1610
  • 修复没有 reducers 的 model 在动态注入后会丢失 state 的问题, #1608
  • 修复 model 注册时会修改自己的问题, #1605
  • 修复 typo,extitraReducers -> extraReducers, #1522
  • 修复触发同一个 effect 多次返回的 Promise 不对的问题, #1602
  • 修复 root container 显示 known 的问题, #1589, #1591
dva - [email protected] (November 13, 2017)

Published by sorrycc almost 7 years ago

Enhancement

dva -

Published by sorrycc about 7 years ago

💅 Enhancement

  • dva-core
    • #1227 feat(dva-core): support set devtool option with window.__REDUX_DEVTOOLS_EXTENSION__OPTIONS. (@sorrycc)
    • #1224 feat(dva-core): support e.preventDefault() in onError to prevent reject. (@sorrycc)

Committers: 1

dva -

Published by sorrycc about 7 years ago

[email protected] (2017-09-15)

🐛 Bug Fix

  • dva
    • #1209 Fix history.listen don't return the unlisten function, and it makes HMR work again. (@yangbin1994)

Committers: 2

dva -

Published by sorrycc about 7 years ago

[email protected] (2017-09-10)

🐛 Bug Fix

  • dva-loading
    • #1204 Fix dva-loading: dispatch multiple effects of the same model will break the model loading state. (@sorrycc)

Committers: 1

dva - 2.0.1 (September 5, 2017)

Published by sorrycc about 7 years ago

[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

dva - 2.0.0 (September 4, 2017)

Published by sorrycc about 7 years ago

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

dva - 1.2.0 (December 30, 2016)

Published by sorrycc almost 8 years ago

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

dva - 1.0.0

Published by sorrycc almost 8 years ago

  • #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

dva - 1.1.0 (October 14, 2016)

Published by sorrycc about 8 years ago

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

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