GithubHelp home page GithubHelp logo

hhy5277 / react-monocle Goto Github PK

View Code? Open in Web Editor NEW

This project forked from team-gryff/react-monocle

0.0 1.0 0.0 6.17 MB

A developer tool to visualize a React application's component hierarchy.

License: MIT License

JavaScript 99.45% HTML 0.55%

react-monocle's Introduction

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

react-monocle's People

Contributors

amilajack avatar bjddev1 avatar chronick avatar jerrymao15 avatar mbchoa avatar radarhere avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.