-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge redux-devtools-log-monitor (#432)
* Move from gaearon/redux-devtools-log-monitor * Npm package config and add credits
- Loading branch information
1 parent
8988026
commit e6fdfb9
Showing
19 changed files
with
926 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015-loose", "stage-0", "react"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lib | ||
**/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"extends": "eslint-config-airbnb", | ||
"env": { | ||
"browser": true, | ||
"mocha": true, | ||
"node": true | ||
}, | ||
"rules": { | ||
"react/jsx-uses-react": 2, | ||
"react/jsx-uses-vars": 2, | ||
"react/react-in-jsx-scope": 2, | ||
"no-console": 0, | ||
// Temporarily disabled due to babel-eslint issues: | ||
"block-scoped-var": 0, | ||
"padded-blocks": 0, | ||
}, | ||
"plugins": [ | ||
"react" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2015 Dan Abramov | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
Redux DevTools Log Monitor | ||
========================= | ||
|
||
The default monitor for [Redux DevTools](https://github.com/gaearon/redux-devtools) with a tree view. | ||
It shows a log of states and actions, and lets you change their history. Created by [Dan Abramov](http://github.com/gaearon) and merged into `redux-devtools` monorepo from [here](https://github.com/gaearon/redux-devtools-log-monitor). | ||
|
||
 | ||
|
||
### Installation | ||
|
||
``` | ||
npm install --save-dev redux-devtools-log-monitor | ||
``` | ||
|
||
### Usage | ||
|
||
You can use `LogMonitor` as the only monitor in your app: | ||
|
||
##### `containers/DevTools.js` | ||
|
||
```js | ||
import React from 'react'; | ||
import { createDevTools } from 'redux-devtools'; | ||
import LogMonitor from 'redux-devtools-log-monitor'; | ||
|
||
export default createDevTools( | ||
<LogMonitor /> | ||
); | ||
``` | ||
|
||
Then you can render `<DevTools>` to any place inside app or even into a separate popup window. | ||
|
||
Alternative, you can use it together with [`DockMonitor`](https://github.com/gaearon/redux-devtools-dock-monitor) to make it dockable. | ||
Consult the [`DockMonitor` README](https://github.com/gaearon/redux-devtools-dock-monitor) for details of this approach. | ||
|
||
[Read how to start using Redux DevTools.](https://github.com/reduxjs/redux-devtools) | ||
|
||
### Features | ||
|
||
Every action is displayed in the log. You can expand the tree view to inspect the `action` object and the `state` after it. | ||
|
||
If a reducer throws while handling an action, you will see “Interrupted by an error up the chain” instead of the state and action tree view. Scroll up until you find the action which caused the error. You will see the error message in the action log entry. If you use a hot reloading tool, you can edit the reducer, and the error will automatically update or go away. | ||
|
||
Clicking an action will disable it. It will appear crossed out, and the state will be recalculated as if the action never happened. Clicking it once again will enable it back. Use this together with a hot reloading solution to work sequentially on different states of your app without reproducing them by hand. You can toggle any action except for the initial one. | ||
|
||
There are four buttons at the very top. “Reset” takes your app to the state you created the store with. The other three buttons work together. You might find it useful to think of them like you think of Git commits. “Commit” removes all actions in your log, and makes the current state your initial state. This is useful when you start working on a feature and want to remove the previous noise. After you’ve dispatched a few actions, you can press “Revert” to go back to the last committed state. Finally, if you dispatched some actions by mistake and you don’t want them around, you can toggle them by clicking on them, and press “Sweep” to completely remove all currently disabled actions from the log. | ||
|
||
### Props | ||
|
||
Name | Description | ||
------------- | ------------- | ||
`theme` | Either a string referring to one of the themes provided by [redux-devtools-themes](https://github.com/gaearon/redux-devtools-themes) (feel free to contribute!) or a custom object of the same format. Optional. By default, set to [`'nicinabox'`](https://github.com/gaearon/redux-devtools-themes/blob/master/src/nicinabox.js). | ||
`select` | A function that selects the slice of the state for DevTools to show. For example, `state => state.thePart.iCare.about`. Optional. By default, set to `state => state`. | ||
`preserveScrollTop` | When `true`, records the current scroll top every second so it can be restored on refresh. This only has effect when used together with `persistState()` enhancer from Redux DevTools. By default, set to `true`. | ||
`expandActionRoot` | When `true`, displays the action object expanded rather than collapsed. By default, set to `true`. | ||
`expandStateRoot` | When `true`, displays the state object expanded rather than collapsed. By default, set to `true`. | ||
`markStateDiff` | When `true`, mark the state's values which were changed comparing to the previous state. It affects the performance significantly! You might also want to set `expandStateRoot` to `true` as well when enabling it. By default, set to `false`. | ||
`hideMainButtons` | When `true`, will show only the logs without the top button bar. By default, set to `false`. | ||
|
||
### License | ||
|
||
MIT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "redux-devtools-log-monitor", | ||
"version": "1.4.0", | ||
"description": "The default tree view monitor for Redux DevTools", | ||
"main": "lib/index.js", | ||
"files": [ | ||
"lib", | ||
"src" | ||
], | ||
"scripts": { | ||
"clean": "rimraf lib", | ||
"build": "babel src --out-dir lib", | ||
"lint": "eslint src test", | ||
"test": "NODE_ENV=test mocha --compilers js:babel-core/register --recursive", | ||
"test:watch": "NODE_ENV=test mocha --compilers js:babel-core/register --recursive --watch", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm run lint && npm run test && npm run clean && npm run build" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/reduxjs/redux-devtools" | ||
}, | ||
"keywords": [ | ||
"redux", | ||
"devtools", | ||
"flux", | ||
"react", | ||
"hot reloading", | ||
"time travel", | ||
"live edit" | ||
], | ||
"author": "Dan Abramov <dan.abramov@me.com> (http://github.com/gaearon)", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/reduxjs/redux-devtools/issues" | ||
}, | ||
"homepage": "https://github.com/reduxjs/redux-devtools", | ||
"devDependencies": { | ||
"babel-cli": "^6.3.15", | ||
"babel-core": "^6.1.20", | ||
"babel-eslint": "^5.0.0-beta4", | ||
"babel-loader": "^6.2.0", | ||
"babel-preset-es2015-loose": "^6.1.3", | ||
"babel-preset-react": "^6.3.13", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"eslint": "^0.23", | ||
"eslint-config-airbnb": "0.0.6", | ||
"eslint-plugin-react": "^3.6.3", | ||
"expect": "^1.6.0", | ||
"mocha": "^2.2.5", | ||
"mocha-jsdom": "^1.0.0", | ||
"rimraf": "^2.3.4", | ||
"webpack": "^1.11.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^15.0.0 || ^16.0.0", | ||
"redux-devtools": "^3.4.0" | ||
}, | ||
"dependencies": { | ||
"lodash.debounce": "^4.0.4", | ||
"prop-types": "^15.0.0", | ||
"react-json-tree": "^0.11.0", | ||
"react-pure-render": "^1.0.2", | ||
"redux-devtools-themes": "^1.0.0" | ||
} | ||
} |
Oops, something went wrong.