Skip to content
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

dva@2 #1119

Merged
merged 10 commits into from
Aug 31, 2017
Merged

dva@2 #1119

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .babelrc

This file was deleted.

4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ dist
coverage
.nyc_output
npm-debug.log*
test/typescript/*.map
test/typescript/*.jsx
lerna-debug.log
packages/dva-example-user-dashboard
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
language: node_js

node_js:
- "6"
- "7"
- "8"

after_success:
- npm run coveralls

script: lerna run test
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

## Next Version

* [BREAK CHANGE] 同名 reducer 和 effect 不会 fallthrough,仅执行 effect
* take effect 会自动加上 namespace prefix,所以之前手动加 namespace 的会收到一个 warning
* `dispatch(EffectAction)` 会返回 Promise
* effect 前后会额外触发 `/@@start` 和 `/@@end` 的 action,可以利用此约定实现 put 的同步执行
* no dva/mobile
* new dva/dynamic
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 ChenCheng (sorrycc@gmail.com)
Copyright (c) 2016-2017 ChenCheng (sorrycc@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
30 changes: 0 additions & 30 deletions Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[以中文查看](./README_zh-CN.md)

Lightweight front-end framework based on [redux](https://github.com/reactjs/redux), [redux-saga](https://github.com/yelouafi/redux-saga) and [react-router@2.x](https://github.com/ReactTraining/react-router/tree/v2.8.1). (Inspired by [elm](http://elm-lang.org/) and [choo](https://github.com/yoshuawuyts/choo))
Lightweight front-end framework based on [redux](https://github.com/reactjs/redux), [redux-saga](https://github.com/yelouafi/redux-saga) and [react-router](https://github.com/ReactTraining/react-router). (Inspired by [elm](http://elm-lang.org/) and [choo](https://github.com/yoshuawuyts/choo))

---

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

[View README in English](README.md)

基于 [redux](https://github.com/reactjs/redux)、[redux-saga](https://github.com/yelouafi/redux-saga) 和 [react-router@2.x](https://github.com/ReactTraining/react-router/tree/v2.8.1) 的轻量级前端框架。(Inspired by [elm](http://elm-lang.org/) and [choo](https://github.com/yoshuawuyts/choo))
基于 [redux](https://github.com/reactjs/redux)、[redux-saga](https://github.com/yelouafi/redux-saga) 和 [react-router](https://github.com/ReactTraining/react-router) 的轻量级前端框架。(Inspired by [elm](http://elm-lang.org/) and [choo](https://github.com/yoshuawuyts/choo))

---

Expand Down
24 changes: 19 additions & 5 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@

Default export file.

### dva/mobile

`dva/mobile` is the dva without router, should be used in multiple-page app, react-native, and so on.

### dva/router

Export the api of [react-router@2.x](https://github.com/ReactTraining/react-router/tree/v2.8.1), and also export [react-router-redux](https://github.com/reactjs/react-router-redux) with the `routerRedux` key.
Export the api of [react-router@4.x](https://github.com/ReactTraining/react-router), and also export [react-router-redux](https://github.com/reactjs/react-router-redux) with the `routerRedux` key.

e.g.

Expand All @@ -29,6 +25,24 @@ Async request library, export the api of [isomorphic-fetch](https://github.com/m

Export the api of [redux-saga](https://github.com/yelouafi/redux-saga).

### dva/dynamic

A util method to load React Component dynamically, based on [react-async-component](https://github.com/ctrlplusb/react-async-component).

e.g.

```js
import dynamic from 'dva/dynamic';

const UserPageComponent = dynamic({
app,
models: [
import('./models/users'),
],
component: import('./routes/UserPage'),
});
```

## dva API
### `app = dva(opts)`

Expand Down
24 changes: 19 additions & 5 deletions docs/API_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@

默认输出文件。

### dva/mobile

`dva/mobile` 是无 router 版的 dva,可用于多页应用,react-native 等。叫 `dva/mobile` 有点欠考虑,可能在下个大版本中改名。

### dva/router

默认输出 [react-router@2.x](https://github.com/ReactTraining/react-router/tree/v2.8.1) 接口, [react-router-redux](https://github.com/reactjs/react-router-redux) 的接口通过属性 routerRedux 输出。
默认输出 [react-router](https://github.com/ReactTraining/react-router) 接口, [react-router-redux](https://github.com/reactjs/react-router-redux) 的接口通过属性 routerRedux 输出。

比如:

Expand All @@ -29,6 +25,24 @@ import { Router, Route, routerRedux } from 'dva/router';

输出 [redux-saga](https://github.com/yelouafi/redux-saga) 的接口,主要用于用例的编写。(用例中需要用到 effects)

### dva/dynamic

解决组件动态加载问题的 util 方法,基于 [react-async-component](https://github.com/ctrlplusb/react-async-component) 实现。

比如:

```js
import dynamic from 'dva/dynamic';

const UserPageComponent = dynamic({
app,
models: [
import('./models/users'),
],
component: import('./routes/UserPage'),
});
```

## dva API
### `app = dva(opts)`

Expand Down
10 changes: 0 additions & 10 deletions examples/count-mobile/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions examples/count-mobile/index.js

This file was deleted.

23 changes: 0 additions & 23 deletions examples/count-mobile/package.json

This file was deleted.

5 changes: 0 additions & 5 deletions examples/count-mobile/webpack.config.js

This file was deleted.

12 changes: 0 additions & 12 deletions examples/count-umd/README.md

This file was deleted.

22 changes: 0 additions & 22 deletions examples/count-umd/index.html

This file was deleted.

48 changes: 0 additions & 48 deletions examples/count-umd/index.js

This file was deleted.

11 changes: 0 additions & 11 deletions examples/count-umd/package.json

This file was deleted.

10 changes: 0 additions & 10 deletions examples/count-undo/README.md

This file was deleted.

16 changes: 0 additions & 16 deletions examples/count-undo/index.html

This file was deleted.

Loading