Skip to content
This repository has been archived by the owner. It is now read-only.
A developer tool to visualize a React application's component hierarchy.
JavaScript HTML
Branch: master
Clone or download
mbchoa and jerrymao15 Support .js React extension out of the box (#146)
* Support .js React extension out of the box

* Update README.md, update comments in cmd.js

* Simplify renderHtml call
Latest commit b90f26e May 8, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Support .js React extension out of the box (#146) May 9, 2017
esquery heavy refactor on iterated components, preparation for state flow lat… Jul 16, 2016
esrecurse remove reference to package json Jul 21, 2016
estraverse heavy refactor on iterated components, preparation for state flow lat… Jul 16, 2016
examples Support .js React extension out of the box (#146) May 9, 2017
react refactored UI (changed colors, made boxes smaller, props are now numb… Jul 25, 2016
server d3 w/ react integration Jul 7, 2016
src added additional query for css string Aug 27, 2016
.eslintignore add eslint, add npm script for linting Jul 2, 2016
.eslintrc add eslint rule to disable strict mode checking Jul 28, 2016
.gitignore Support .js React extension out of the box (#146) May 9, 2017
.travis.yml Added optimal travis ci settings Jul 31, 2016
LICENSE Initial commit Jun 25, 2016
README.md Support .js React extension out of the box (#146) May 9, 2017
demo.gif updated demo, added additional file path cases Jul 25, 2016
index.html update monocle tree styling (#114) Jul 23, 2016
package.json add back d3 to devDependencies Jul 30, 2016
webpack.config.js cleaned up webpack config Aug 27, 2016
webpack.production.config.js

README.md

react-monocle

Build Status npm version


**React Monocle** is a developer tool for generating visual representations of your React app's component hierarchy.

How It Works

React Monocle parses through your React source files to generate a visual tree graph representing your React component hierarchy. The tree is then displayed along with a live copy of your application. This is done by using your un-minified bundle file to inject wrapper functions around setState calls in order to have our tree display real-time feedback. The rendered tree is synced up to the state(s) of your component using Redux, and as the state of your live app changes, the monocle tree graph will also provide visual feedback of data flow and state changes through the React components.

Setup

IMPORTANT The way we use your bundle file requires so that the bundle is not mangled (ie not minified).

  1. npm install -g react-monocle
  2. Navigate to the directory which contains your html file.
  3. Type in monocle -h in order to find what options suit your needs the best. The only required option is specifying the bundle.

Options

Option Command Description
Bundle --bundle (-b) Required Path to React bundle file.
HTML --html (-c) HTML page which has your bundle and CSS files. Specify if you want CSS displayed and/or you are relying on external scripts.
Entry --entry (-e) App entry point. Defaults to JSX file where ReactDOM.render is found.
Directory --directory (-d) directory of React files. Defaults to where Monocle was called.

Contributing/Testing

  • Please feel free to fork and submit pull requests!
  • After installing, you can run tests via npm run unit-tests or npm run test to run ESLint simultaneously
  • Tests can be found in src/test and are currently broken out into:
    1. astGeneratorTest.js
    2. d3DataBuilderTest.js
    3. iterTest.js
    4. previewParserTest.js
    5. reactParserTest.js
    6. test.js (to compile and run all tests at once)
  • Please add new tests to relevant files specified above, or create new test files as needed.

Coming Soon

  • Demo
  • Quick description of what goes on under the hood.
  • Improving how we search for components

In the Pipeline

  • Support for React-Router
  • Support for Redux

Our Team

License

MIT

You can’t perform that action at this time.