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

feat: open redux-devtool trace history #2096

Merged
merged 2 commits into from
May 10, 2019
Merged

feat: open redux-devtool trace history #2096

merged 2 commits into from
May 10, 2019

Conversation

coolliyong
Copy link
Contributor

增加Redux调试面板trace调用记录

  • 打开 Redux面板trace的开关,保留默认10条记录

Checklist

  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines

Description of change

dva-core/src/createStore.js

before

const composeEnhancers =
  process.env.NODE_ENV !== "production" &&
  window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
    ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
    : compose;

const enhancers = [applyMiddleware(...middlewares), ...extraEnhancers];

after

  const composeEnhancers =
  process.env.NODE_ENV !== "production" &&
  window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
    ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true,maxAge:30 })
    : compose;

  const enhancers = [applyMiddleware(...middlewares), ...extraEnhancers];

首先dva非常好用

但是在现在开发的项目中model定义超过100个,由不同的开发人员进行开发,在调度model上各不同,调试变得略微麻烦,在找寻解决方法时发现redux有提供调用追踪,并在项目中使用,对于项目中追踪调度和调试还有有效率上的改变,所以希望能在dva这么一个优秀的开源项目中提供一PR,享受更便捷的调试

@coveralls
Copy link

coveralls commented May 9, 2019

Coverage Status

Coverage remained the same at 87.282% when pulling b7080a5 on coolliyong:master into 99ec56c on dvajs:master.

@@ -29,7 +29,7 @@ export default function({
const composeEnhancers =
process.env.NODE_ENV !== "production" &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({ trace: true,maxAge:30 })
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true, 后加个空格。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

空格已经加上,lint-staged自动补入了当前文件line19的一个分号,又Get一个新东西

@sorrycc sorrycc changed the title open redux-devtool trace history feat: open redux-devtool trace history May 10, 2019
@sorrycc sorrycc merged commit 09d8eeb into dvajs:master May 10, 2019
@sorrycc
Copy link
Member

sorrycc commented May 10, 2019

@yoyo837
Copy link

yoyo837 commented May 11, 2019

dva@2.6.0-beta.4 npm publish 一下亲。

GoToBoy pushed a commit to GoToBoy/dva that referenced this pull request Oct 12, 2023
* open redux-devtool trace history

* '空格'
GoToBoy pushed a commit to GoToBoy/dva that referenced this pull request Oct 12, 2023
* open redux-devtool trace history

* '空格'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants