Gathering detailed insights and metrics for mobx-react-devtools
Gathering detailed insights and metrics for mobx-react-devtools
Gathering detailed insights and metrics for mobx-react-devtools
Gathering detailed insights and metrics for mobx-react-devtools
mobx-devtools-mst
Allows debugging mobx-state-tree roots. See [mobx-devtools/README.md](https://github.com/mobxjs/mobx-devtools/blob/master/README.md#mobx-state-tree).
mobx-react-lite
Lightweight React bindings for MobX based on React 16.8+ and Hooks
mobx-react
React bindings for MobX. Create fully reactive components.
react-devtools-core
Use react-devtools outside of the browser
npm install mobx-react-devtools
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
1,229 Stars
223 Commits
49 Forks
19 Watching
4 Branches
45 Contributors
Updated on 10 Aug 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
15.1%
2,973
Compared to previous day
Last week
18.7%
17,056
Compared to previous week
Last month
6.7%
63,635
Compared to previous month
Last year
-3.5%
654,169
Compared to previous year
:warning: Note: This package is deprecated. Use the browser plugin instead. Also note that with mobx-react@6 and higher the package should no longer be needed, see changelog :warning:
DevTools for MobX to track the rendering behavior and data dependencies of your app.
The default position of the panel has been changed to bottom right. If you prefer top right like in the gif above, add position="topRight"
to <DevTools />
.
npm install --save-dev mobx-react-devtools
or
<script src="https://unpkg.com/mobx-react-devtools"></script>
Somewhere in your application, create a DevTools component:
1import DevTools from 'mobx-react-devtools'; 2 3class MyApp extends React.Component { 4 render() { 5 return ( 6 <div> 7 ... 8 <DevTools /> 9 </div> 10 ); 11 } 12}
or
React.createElement(mobxDevtools.default)
Supported props:
highlightTimeout
— number, default: 1500noPanel
— boolean, if set, do not render control panel, default: falseposition
— string (or object), topRight
, bottomRight
, bottomLeft
or topLeft
, default: bottomRight
className
— string, className of control panel, default: not definedstyle
— object, inline style object of control panel, default: not definedIn order to be compatible with earlier versions of mobx-react-devtools
it is also possible to assign position
to an object containing inline styles. Using the dedicated style
property is however recommended.
From there on, after each rendering a reactive components logs the following three metrics:
render()
method of a componentrender()
method until the changes are flushed to the DOMFor each component the color indicates roughly how long the coloring took. Rendering times are cumulative; they include time spend in the children
Note that if logging is enabled, MobX actions and reactions will appear as collapsible groups inside the browsers console. Mind that any log statements that are printed during these (re)actions will appear inside those groups as well, so that you can exactly trace when they are triggered.
1import { configureDevtool } from 'mobx-react-devtools';
2
3// Any configurations are optional
4configureDevtool({
5 // Turn on logging changes button programmatically:
6 logEnabled: true,
7 // Turn off displaying components updates button programmatically:
8 updatesEnabled: false,
9 // Log only changes of type `reaction`
10 // (only affects top-level messages in console, not inside groups)
11 logFilter: change => change.type === 'reaction',
12});
13
There are also aliases for turning on/off devtools buttons:
1import { setLogEnabled, setUpdatesEnabled, setGraphEnabled } from 'mobx-react-devtools'; 2 3setLogEnabled(true); // same as configureDevtool({ logEnabled: true }); 4setUpdatesEnabled(false); // same as configureDevtool({ updatesEnabled: false }); 5setGraphEnabled(false); // same as configureDevtool({ graphEnabled: false });
1import DevTools, { GraphControl, LogControl, UpdatesControl } from 'mobx-react-devtools'; 2 3class MyNiceButton extends React.Component { 4 render() { 5 const { active, onToggle, children } = this.props; 6 return ( 7 <button onClick={onToggle}> 8 {children} 9 {active ? ' on' : ' off'} 10 </button> 11 ); 12 } 13} 14 15class MyApp extends React.Component { 16 render() { 17 return ( 18 <div> 19 20 {/* Include somewhere with `noPanel` prop. Is needed to display updates and modals */} 21 <DevTools noPanel /> 22 23 <div className="my-custom-devtools-panel-design"> 24 <GraphControl> 25 {/* Must have only one child that takes props: `active` (bool), `onToggle` (func) */} 26 <MyNiceButton>Graph</MyNiceButton> 27 </GraphControl> 28 <LogControl> 29 {/* Must have only one child that takes props: `active` (bool), `onToggle` (func) */} 30 <MyNiceButton>Log</MyNiceButton> 31 </LogControl> 32 <UpdatesControl> 33 {/* Must have only one child that takes props: `active` (bool), `onToggle` (func) */} 34 <MyNiceButton>Updates</MyNiceButton> 35 </UpdatesControl> 36 </div> 37 </div> 38 ); 39 } 40}
5.0.1
5.0.0
4.2.15
4.2.14
4.2.13
4.2.12
4.2.11
4.2.9
4.2.8
4.2.7
4.2.6
4.2.5
4.2.4
4.2.3
4.2.2
4.0.5
4.0.2
4.0.1
4.0.0
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 6/13 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
64 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More