Update to Redux DevTools 3.0 Beta 2
gaearon opened this issue · comments
Redux DevTools beta is out with breaking changes. For monitors, there are a few of them:
- Instead of receiving action creators in
props
, you now getdispatch
in props and have toimport { ActionCreators } from 'redux-devtools'
to get access tocommit
,rollback
, etc - The action props are now indexed by ID, so instead of
stagedActions
andskippedActions
you getactionsById
,stagedActionIds
andskippedActionIds
.toggleAction()
now acceptsid
instead ofindex
. To grab vanilla action object by ID, usethis.props.actionsById[id].action
. The timestamp is also available on that action:this.props.actionsById[id].timestamp
. - The monitor now has to export a
reducer
static property. For what it's worth, it could be a no-op function, but it must exist. In more interesting case, it will be(state, action, props) => nextState
function wherestate
is the monitor's own state available to it asmonitorState
prop. You are free to use it to let monitor react to any action and remember any data. This is whysetMonitorState
prop is gone. - Monitors shouldn't take care anymore of
isVisible
(hiding or showing themselves) or doing so on special key presses. We're moving towards a composable monitor model, where you'd use a special dock monitor to contain other monitor. Therefore monitors should only be worried about rendering themselves.
The diff of the default LogMonitor can serve as an inspiration for these changes.
You can try the new version of Redux DevTools on the next
branch.
Please let me know if you find any issues. The API might change slightly in the final release, but this is pretty close, and it involves some work, so let me know if you need any help.
👍
Done! Published as 1.0.0-beta-1 and will release 1.0 when DevTools 3.0 is officially out. I didn't run into many issues, except some styling I already needed to address.
Thanks!
Looks like I forgot to update the Counter example to React 0.14 😨Sorry about that!
Just released 1.0.0 in conjunction with the DevTools 3.0.0 release.
cool, thanks @calesce