Skip to content

Commit

Permalink
- 去掉NO_PROXY,[email protected] 已内置关闭MOCK=none
Browse files Browse the repository at this point in the history
- 更新React 16.3.0,修改componentWillReceiveProps为UNSAFE_componentWillReceiveProps
- 增加插件umi-plugin-dll,二次编译速度提升70%
  • Loading branch information
xiaohuoni committed May 18, 2018
1 parent 3f914d9 commit 2940f7c
Show file tree
Hide file tree
Showing 14 changed files with 44 additions and 19 deletions.
11 changes: 9 additions & 2 deletions .umirc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,18 @@ export default {
{
update(routes) {
return [
...routes,
// ...require("./src/pages/_routes")
// ...require("./src/pages/_routes"),
...routes
];
}
}
],
[
"umi-plugin-dll",
{
exclude: [],
include: ["dva", "dva/router", "dva/saga", "dva/fetch", "antd/es"]
}
]
],
pages: {
Expand Down
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@
- dva.js onError 和 initialState
- 增加配置服务器地址,支持build之后可预览
- 增加[antd-pro-server](https://github.com/xiaohuoni/antd-pro-server),主要修改.umirc.mock.js
20180517
- 去除手动重定向路由,加入umi配置路由pages/_route.json
20180518 更新[email protected]
- 去掉NO_PROXY,[email protected] 已内置关闭MOCK=none
- 更新React 16.3.0,修改componentWillReceiveProps为UNSAFE_componentWillReceiveProps
- 增加插件umi-plugin-dll,二次编译速度提升70%

如果出现[umi/#495](https://github.com/umijs/umi/issues/495)问题,可以先注释掉.umirc.js里
```js
[
"umi-plugin-dll",
{
exclude: [],
include: ["dva", "dva/router", "dva/saga", "dva/fetch", "antd/es"]
}
]
```

# Ant Design Pro

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"description": "umi example with ant design pro",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "umi dev",
"start:no-proxy": "cross-env NO_PROXY=true umi dev",
"start": "cross-env HARD_SOURCE=none umi dev",
"start:no-proxy": "cross-env MOCK=none umi dev",
"build": "umi build",
"lint": "eslint --ext .js src test",
"precommit": "npm run lint"
Expand All @@ -26,10 +26,13 @@
},
"homepage": "https://github.com/xiaohuoni/umi-antd-pro#readme",
"devDependencies": {
"cross-env": "^5.1.4",
"mockjs": "^1.0.1-beta3",
"moment": "^2.22.1",
"umi-plugin-routes": "^0.1.3",
"cross-env": "^5.1.4"
"umi": "1.3.3",
"umi-plugin-dll": "^0.2.1",
"umi-plugin-dva": "^0.7.2",
"umi-plugin-routes": "0.1.4"
},
"dependencies": {
"@antv/data-set": "^0.8.7",
Expand All @@ -48,8 +51,6 @@
"react-router-breadcrumbs-hoc": "^2.1.0",
"react-transition-group": "^2.3.1",
"rollbar": "^2.3.9",
"umi": "^1.3.1",
"umi-plugin-dva": "^0.7.1",
"url-polyfill": "^1.0.13"
}
}
2 changes: 1 addition & 1 deletion src/components/Authorized/PromiseRender.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default class PromiseRender extends React.PureComponent {
componentDidMount() {
this.setRenderComponent(this.props);
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// new Props enter
this.setRenderComponent(nextProps);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/Pie/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Pie extends Component {
window.addEventListener('resize', this.resize);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.data !== nextProps.data) {
// because of charts data create when rendered
// so there is a trick for get rendered time
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/Radar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class Radar extends Component {
this.getLengendData();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.data !== nextProps.data) {
this.getLengendData();
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Charts/TagCloud/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class TagCloud extends Component {
window.addEventListener('resize', this.resize);
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (JSON.stringify(nextProps.data) !== JSON.stringify(this.props.data)) {
this.renderChart(nextProps);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/CountDown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CountDown extends Component {
this.tick();
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.target !== nextProps.target) {
clearTimeout(this.timer);
const { lastTime } = this.initTime(nextProps);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ellipsis/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class Ellipsis extends Component {
}
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (this.props.lines !== nextProps.lines) {
this.computeLine();
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/SiderMenu/SiderMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class SiderMenu extends PureComponent {
openKeys: this.getDefaultCollapsedSubMenus(props),
};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if (nextProps.location.pathname !== this.props.location.pathname) {
this.setState({
openKeys: this.getDefaultCollapsedSubMenus(nextProps),
Expand Down
2 changes: 1 addition & 1 deletion src/components/StandardTable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class StandardTable extends PureComponent {
};
}

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
// clean state
if (nextProps.selectedRows.length === 0) {
const needTotalList = initTotalList(nextProps.columns);
Expand Down
2 changes: 1 addition & 1 deletion src/components/TagSelect/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TagSelect extends Component {
expand: false,
value: this.props.value || this.props.defaultValue || [],
};
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if ('value' in nextProps && nextProps.value) {
this.setState({ value: nextProps.value });
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/Forms/TableForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default class TableForm extends PureComponent {
loading: false,
};
}
componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
if ('value' in nextProps) {
this.setState({
data: nextProps.value,
Expand Down
2 changes: 1 addition & 1 deletion src/pages/User/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class Register extends Component {
prefix: '86',
};

componentWillReceiveProps(nextProps) {
UNSAFE_componentWillReceiveProps(nextProps) {
const account = this.props.form.getFieldValue('mail');
if (nextProps.register.status === 'ok') {
this.props.dispatch(routerRedux.push({
Expand Down

0 comments on commit 2940f7c

Please sign in to comment.