|
1 | | - |
2 | | -[](https://twitter.com/intent/tweet?text=Make%20development%20easier%20with%20Lucid.&url=https://github.com/Gossamer-React/React-Lucid&hashtags=react,graphql,apollographql,javascript,programming,developers,chrome%20@neyser_zana%20@eterna_t%20@yongnicholaskim%20@Niantendo) |
| 1 | +<p align="center"> |
| 2 | + <img width="460" height="150" src="public/assets/lucidlogo-transparent.png?raw=true"> |
| 3 | +</p> |
| 4 | + |
| 5 | +[](https://twitter.com/intent/tweet?text=Make%20development%20easier%20with%20Lucid.&url=https://github.com/Gossamer-React/Lucid&hashtags=react,graphql,apollographql,javascript,programming,developers,chrome) |
3 | 6 |  |
4 | 7 |  |
5 | | -## Lucid |
6 | | -*A React-GraphQL developer tool for Chrome.* |
7 | 8 |
|
8 | | -Lucid is a React / GraphQL Chrome Developer Tool designed to help developers debug their React applications that depend on GraphQL resources. Lucid allows you to visualize the component hierarchy of your React application, and your GraphQL schema, queries, and mutations side by side, making debugging fast and focused. |
| 9 | +## **Lucid**: *a React-GraphQL developer tool* |
9 | 10 |
|
10 | | -**IMPORTANT:** Lucid is in *BETA* mode and works best for React v16+ local projects in development environments. |
| 11 | +Lucid is a Chrome Developer Tool designed to help developers debug their React-GraphQL applications. |
| 12 | +- Visualize the component hierarchy, state/props data and state changes of your React application |
| 13 | +- See your GraphQL schema, queries, and mutations in real-time |
11 | 14 |
|
12 | | -## How It Works |
| 15 | +## Underlying Technology |
13 | 16 | ### React Tab |
14 | | -Lucid parses through your React app to generate an interactive tree graph representing your React component hierarchy, with node-specific state and props data. The tree updates upon each change to the React app's state, and displays a log of state diffs on the left. This is done by creating a persistent data bridge to the user's React application via the Javascript API for WebExtensions' background and content scripts. Lucid injects scripts utilizing React DevTool's Global Hook to recursively traverse through the React DOM each time setState is called, resulting in a tree and a log that each display real-time feedback. Our app itself uses React internally so as the state of your live app changes, the Lucid tree graph will also provide visual feedback of data flow and state changes through the React components immediately. |
| 17 | +Lucid parses through your React app to generate an interactive tree graph representing your __React component hierarchy__, with node-specific __state and props__ data. The tree updates upon each change to the React app's state, and displays a log of __state diffs__ on the left. This is done by creating a persistent data bridge to the user's React application via the Javascript API for WebExtensions' background and content scripts. Lucid injects scripts utilizing React DevTool's Global Hook to recursively traverse through the React DOM each time setState is called, resulting in a tree and a log that each display real-time feedback. Our app itself uses React internally so as the state of your live app changes, the Lucid tree graph will also provide visual feedback of data flow and state changes through the React components immediately. |
15 | 18 |
|
16 | 19 | ### GraphQL Tab |
17 | | -Lucid intercepts HTTP requests using Chrome Devtool APIs to display a log of real-time Apollo client queries and mutations, along with associated response objects. Lucid also uses GraphQL schema introspection to display schema information from the server. This allows full-stack developers to debug their app from the front-end all the way through to the back-end, as requests are generated, responses come back from the server, data flows through React components, and render in the DOM. |
| 20 | +Lucid intercepts HTTP requests using Chrome Devtool APIs to display a log of real-time __Apollo client queries and mutations__, along with associated __response__ objects. Lucid also uses GraphQL schema introspection to display __schema__ information from the server. This allows full-stack developers to debug their app from the front-end to the back-end, as requests are generated, responses are returned from the server, and data flows through React components to be rendered in the DOM. |
18 | 21 |
|
19 | 22 | ## Setup |
20 | | -### Install from Chrome Extension Store |
21 | | - |
22 | | -1. Install <a href="https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en">React Developer Tools</a>. |
23 | | - |
24 | | -2. Install <a href="https://chrome.google.com/webstore/category/extensions">Lucid</a>. |
25 | | - |
26 | | -3. Run your React-GraphQL application or open a site that uses React v16+ or GraphQL. |
27 | | - |
28 | | -4. Open Chrome Developer Tools (Inspect / Cmd+Opt+I / Ctrl+Shift+I), and click on the Lucid panel. |
29 | | - |
30 | | -5. Have fun! :) |
31 | | - |
32 | | -### Build your own extension |
33 | | - |
34 | | -1. Clone the repo and install dependendies: |
| 23 | +| Install from Chrome Extension Store | Build your own extension | |
| 24 | +| ------------- | ------------- | |
| 25 | +| 1. Install <a href="https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en">React Developer Tools</a>. | 1. Clone the repo and install dependendies: ```npm install``` | |
| 26 | +| 2. Install <a href="https://chrome.google.com/webstore/category/extensions">Lucid</a> or __Build your own extension__. | 2. ```npm run build ```| |
| 27 | +|3. Run your React-GraphQL application or open a site that uses React v16+ or GraphQL.|3. Navigate to chrome://extensions (or in your Chrome Browser Settings, click on **More Tools** >> **Extensions**). | |
| 28 | +|4. Open Chrome Developer Tools (Inspect or Cmd+Opt+I / Ctrl+Shift+I) and click on the Lucid panel.|4. Click **Load Unpacked** and select the './react-lucid/build' folder from your local directory.| |
| 29 | +|5. Have fun! | |
35 | 30 |
|
36 | | - ```npm install``` |
37 | | - |
38 | | -2. Build Lucid: |
39 | | - |
40 | | - ```npm run build ``` |
41 | | - |
42 | | -3. Navigate to chrome://extensions (or in your Chrome Browser Settings, click on **More Tools** >> **Extensions**). |
43 | | - |
44 | | -4. Click **Load Unpacked**. Select the './react-lucid/build' folder from your local directory. |
45 | | - |
46 | | -5. Have fun! |
| 31 | +**IMPORTANT:** Lucid is in *BETA* mode and works best for React v16+ local projects in development environments. |
47 | 32 |
|
48 | 33 | ## How to Use |
49 | | -### GraphQL View |
50 | | -Upon opening Lucid, users first land on the GraphQL panel where a log of previous API requests is available, as well as their associated responses. A GraphQL schema of all available types, queries, and mutations is also automatically fetched from the GraphQL server when Lucid is initialized. |
51 | | - |
52 | | -**NOTE:** Lucid only listens for HTTP requests when it is open in the Chrome Developer Tool panel. To see any requests that were made upon initial page load, reload your React page after opening Lucid in your Chrome browser. See a chronological log of GraphQL HTTP Requests on the left, and click on each log to view the HTTP response for that particular request. At the bottom of the panel, you'll find your React application's GraphQL schema. |
| 34 | +### GraphQL Tab |
| 35 | +* In the GraphQL panel, a chronological log of API __requests__ is shown on the left. |
| 36 | +* A GraphQL __schema__ of all available types, queries, and mutations is also automatically fetched from the GraphQL server when Lucid is initialized and displayed on the bottom. |
| 37 | +* Click each request log to see its associated HTTP __response__. |
| 38 | + |
| 39 | +**NOTE:** Lucid only listens for HTTP requests while it is open in the Chrome Developer Tool panel. To see any requests that were made upon initial page load, reload your React page after opening Lucid in your Chrome browser. |
53 | 40 |
|
54 | 41 |  |
55 | 42 |
|
56 | | -### Component Tree View |
57 | | -In the React Component Tree panel is a tree graph representing your loaded React application's component hierarchy. In the top left box, you will see the state and props data of any tree graph component you hover over. Below that, you will see a log of state diffs whenever you trigger setState() in your app. |
| 43 | +### React Tab |
| 44 | +* In the React panel is a tree graph representing your application's __component hierarchy__. |
| 45 | +* Hovering over any React Component in the tree displays the __state and props data__ of that component in the top left. |
| 46 | +* The __State Diff__ Log tracks changes in state whenever setState() is triggered. |
| 47 | +* Filter out specified higher-order components from your tree graph (e.g. Redux, Apollo-GraphQL, and React Router) by clicking the buttons. |
58 | 48 |
|
59 | 49 |  |
60 | 50 |
|
61 | | -Hovering over the React Component Tree chart displays the state and props of each component in the State/Props Panel. The State Diff Log tracks each event that changes the state in the loaded React application. |
62 | | -You also have the option to filter out specified higher-order components from your tree graph (e.g. Redux, Apollo-GraphQL, and React Router). |
63 | | - |
64 | 51 |  |
65 | 52 |
|
66 | 53 |  |
67 | 54 |
|
68 | 55 | ## Contributing |
69 | 56 |
|
70 | | -Please feel free to fork this repo and submit pull requests! Lucid is currently in beta release. Please let us know about bugs ! Also, if you have any requests or suggestions for features, please contact us at [email protected]. |
| 57 | +Lucid is currently in beta release. Please let us know about bugs and suggestions at [email protected]. Feel free to fork this repo and submit pull requests! |
71 | 58 |
|
72 | 59 | ## Coming Soon |
73 | 60 |
|
74 | 61 |
|
75 | | -## Our Team |
| 62 | +## Team |
76 | 63 |
|
77 | 64 | Yong-Nicholas Kim (https://github.com/yongnicholaskim) |
78 | 65 |
|
|
0 commit comments