From 2797662f457947c434540c2420ed877264106c81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=B8=85?= Date: Mon, 16 Jul 2018 09:24:28 +0800 Subject: [PATCH] Optimization: Slight performance optimization --- config/config.js | 20 ++++++++++++++------ src/pages/Dashboard/Analysis.js | 7 +++++-- src/pages/document.ejs | 4 +--- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/config/config.js b/config/config.js index 957687ba..f080272d 100644 --- a/config/config.js +++ b/config/config.js @@ -21,7 +21,6 @@ export default { // }, // ], ], - disableServiceWorker: true, locale: { enable: true, // default false default: 'zh-CN', // default zh-CN @@ -209,7 +208,6 @@ export default { theme: { 'card-actions-background': '#f5f8fa', }, - // entry: 'src/index.js', // TODO remove extraBabelPlugins: [['import', { libraryName: 'antd', libraryDirectory: 'es', style: true }]], env: { @@ -219,7 +217,6 @@ export default { }, externals: { '@antv/data-set': 'DataSet', - bizcharts: 'BizCharts', rollbar: 'rollbar', }, alias: { @@ -229,9 +226,6 @@ export default { common: path.resolve(__dirname, '../src/common/'), }, ignoreMomentLocale: true, - publicPath: '/', - // TODO check hash config - // hash: true, lessLoaderOptions: { javascriptEnabled: true, }, @@ -253,4 +247,18 @@ export default { }, }, disableFastClick: true, + manifest: { + name: 'ant-design-pro', + background_color: '#FFF', + description: 'An out-of-box UI solution for enterprise applications as a React boilerplate.', + display: 'standalone', + start_url: '/index.html', + icons: [ + { + src: '/favicon.png', + sizes: '48x48', + type: 'image/png', + }, + ], + }, }; diff --git a/src/pages/Dashboard/Analysis.js b/src/pages/Dashboard/Analysis.js index 1288da2c..fa4dd1bf 100644 --- a/src/pages/Dashboard/Analysis.js +++ b/src/pages/Dashboard/Analysis.js @@ -73,8 +73,10 @@ class Analysis extends Component { componentDidMount() { const { dispatch } = this.props; - dispatch({ - type: 'chart/fetch', + this.reqRef = requestAnimationFrame(() => { + dispatch({ + type: 'chart/fetch', + }); }); } @@ -83,6 +85,7 @@ class Analysis extends Component { dispatch({ type: 'chart/clear', }); + cancelAnimationFrame(this.reqRef); } handleChangeSalesType = e => { diff --git a/src/pages/document.ejs b/src/pages/document.ejs index ec7760ed..7b2a57bf 100644 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -6,11 +6,9 @@ Ant Design Pro + - - -- GitLab