Skip to content

Commit dc3f630

Browse files
authored
Merge pull request #38 from oslabs-beta/austin/readme
added readme for npm package
2 parents 458030a + 1177639 commit dc3f630

File tree

11 files changed

+192
-84
lines changed

11 files changed

+192
-84
lines changed

README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<a name="readme-top"></a>
1+
<a id="readme-top"></a>
22

33
<p align="center">
44
<img src="./extension/public/icon.png" alt="Logo" width="250"/>
@@ -33,31 +33,36 @@ React Query Rewind introduces a powerful DevTool extension designed to work in c
3333

3434
## Installation
3535

36-
1. Download npm package into your application.
36+
1. Download npm package into your application.
3737

38-
```sh
39-
npm i react-query-rewind
40-
```
38+
```sh
39+
npm i react-query-rewind
40+
```
4141

42-
2. Import the ReactQueryRewind component into the root of your applicaiton.
42+
2. Import the ReactQueryRewind component into the root of your applicaiton.
4343

44-
_picture of importing the component_
44+
_picture of importing the component_
4545

46-
```sh
47-
import ReactQueryRewind from 'react-query-rewind'
48-
```
46+
```javascript
47+
import ReactQueryRewind from 'react-query-rewind';
48+
```
4949

50-
3. Place ReactQueryRewind next to the root of your application inside the QueryClientProvider component.
50+
3. Place ReactQueryRewind next to the root of your application inside the QueryClientProvider component.
5151

52-
<p align="left">
53-
<img src="./assets/component-placement.png" alt="Component Placement" width="600"/>
54-
</p>
52+
```javascript
53+
ReactDOM.createRoot(document.getElementById('root')!).render(
54+
<QueryClientProvider client={queryClient}>
55+
<App />
56+
<ReactQueryRewind />
57+
</QueryClientProvider>
58+
);
59+
```
5560

56-
4. Open the Chrome DevTool Extension and start coding!
61+
4. Open the Chrome DevTool Extension and start coding!
5762

58-
<p align="left">
59-
<img src="./assets/chrome-devtool.png" alt="Component Placement" width="600"/>
60-
</p>
63+
<p align="left">
64+
<img src="./assets/chrome-devtool.png" alt="Component Placement" width="600"/>
65+
</p>
6166

6267
# Features
6368

@@ -100,8 +105,8 @@ Rui Fan - [GitHub](https://github.com/ruifan-IU) - [LinkedIn](https://www.linked
100105
101106
# Links
102107
103-
[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](MEDIUMARTICLELINKHERE)
104-
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](LINKEDINHERE)
108+
[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@teeringe/react-query-rewind-time-travel-debugging-made-simple-46aaeeafd497)
109+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/react-query-rewind/)
105110
106111
Project Link: [React Query Rewind](https://github.com/oslabs-beta/react-query-rewind-chrome)
107112

package/README copy.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# React Query Rewind
2+
See https://github.com/oslabs-beta/react-query-rewind/blob/main/README.md for a complete overview.
3+
4+
This document details setting up the package and examples for a testing environment.
5+
6+
## Production Installation and Set-Up
7+
Install the pacakage with:
8+
`npm i -D react-query-rewind`
9+
10+
Import the ReactQueryRewind component and place it as close as possible to the root of your app.
11+
12+
Download the chrome extension from ***insert url here*** in order to time travel state in a developer toosl panel within your chrome browser.
13+
14+
## Example
15+
16+
```javascript
17+
import React from 'react';
18+
import ReactDOM from 'react-dom/client';
19+
import App from './App';
20+
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
21+
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
22+
23+
const queryClient = new QueryClient();
24+
25+
ReactDOM.createRoot(document.getElementById('root')!).render(
26+
<QueryClientProvider client={queryClient}>
27+
<ReactQueryRewind/>
28+
<App />
29+
<ReactQueryDevtools />
30+
</QueryClientProvider>
31+
);
32+
```
33+
34+
## Set-Up Examples
35+
**From the package directory:**
36+
Run with "1" or "2" depending on which example you'd like to set up
37+
1. `npm run install-all`
38+
1. Installs all dependencies for the package and both example apps
39+
2. `npm run link-dependencies-1` or `npm run link-dependencies-2`
40+
1. Installs all peer dependencies in our package to ensure there are no duplicates
41+
2. Can see all packages currently linked with *`npm ls -g --depth=0 --link=tr`*
42+
3. `npm run watch`
43+
1. Starts rollup in watch mode and creates dist folder
44+
4. `npm run link-package-1` *or* `npm run link-package-2`
45+
1. Links React Query Rewind
46+
5. `npm run example-1` *or* `npm run example-2`
47+
1. Starts the example server with webpack. Note: this is a hot reload, but it does not always pick up changes to the npm package
48+
49+
# Publishing
50+
1. `npm login` to login to the npm site. Follow the instructions to publish your npm package
51+
2. `npm publish`
52+
53+
# Development
54+
Contributions are always welcome. Please create a fork from https://github.com/oslabs-beta/react-query-rewind.
55+
56+
57+
### Future Development Needs
58+
- Rollup currently does not build on older macs or on Linux (we have not confirmed the issue on Windows yet)
59+
- Some developers on older macs need to install @rollup/rollup-darwin-x64 to get the build working
60+
- Github actions uses linux and as a result, our test.yml script installs @rollup/rollup-darwin-x64 to ensure the build works properly
61+
- Future development should ensure that builds work correclty regardless of the developer's machine and remove the installation of @rollup/rollup-darwin-x64 from the tests.yml file

package/README.md

Lines changed: 106 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,106 @@
1-
# React Query Rewind
2-
See https://github.com/oslabs-beta/react-query-rewind/blob/main/README.md for a complete overview.
3-
4-
This document details setting up the package and examples for a testing environment.
5-
6-
## Production Installation and Set-Up
7-
Install the pacakage with:
8-
`npm i -D react-query-rewind`
9-
10-
Import the ReactQueryRewind component and place it as close as possible to the root of your app.
11-
12-
Download the chrome extension from ***insert url here*** in order to time travel state in a developer toosl panel within your chrome browser.
13-
14-
## Example
15-
16-
```javascript
17-
import React from 'react';
18-
import ReactDOM from 'react-dom/client';
19-
import App from './App';
20-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
21-
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
22-
23-
const queryClient = new QueryClient();
24-
25-
ReactDOM.createRoot(document.getElementById('root')!).render(
26-
<QueryClientProvider client={queryClient}>
27-
<ReactQueryRewind/>
28-
<App />
29-
<ReactQueryDevtools />
30-
</QueryClientProvider>
31-
);
32-
```
33-
34-
## Set-Up Examples
35-
**From the package directory:**
36-
Run with "1" or "2" depending on which example you'd like to set up
37-
1. `npm run install-all`
38-
1. Installs all dependencies for the package and both example apps
39-
2. `npm run link-dependencies-1` or `npm run link-dependencies-2`
40-
1. Installs all peer dependencies in our package to ensure there are no duplicates
41-
2. Can see all packages currently linked with *`npm ls -g --depth=0 --link=tr`*
42-
3. `npm run watch`
43-
1. Starts rollup in watch mode and creates dist folder
44-
4. `npm run link-package-1` *or* `npm run link-package-2`
45-
1. Links React Query Rewind
46-
5. `npm run example-1` *or* `npm run example-2`
47-
1. Starts the example server with webpack. Note: this is a hot reload, but it does not always pick up changes to the npm package
48-
49-
# Publishing
50-
1. `npm login` to login to the npm site. Follow the instructions to publish your npm package
51-
2. `npm publish`
52-
53-
# Development
54-
Contributions are always welcome. Please create a fork from https://github.com/oslabs-beta/react-query-rewind.
55-
56-
57-
### Future Development Needs
58-
- Rollup currently does not build on older macs or on Linux (we have not confirmed the issue on Windows yet)
59-
- Some developers on older macs need to install @rollup/rollup-darwin-x64 to get the build working
60-
- Github actions uses linux and as a result, our test.yml script installs @rollup/rollup-darwin-x64 to ensure the build works properly
61-
- Future development should ensure that builds work correclty regardless of the developer's machine and remove the installation of @rollup/rollup-darwin-x64 from the tests.yml file
1+
<a id="readme-top"></a>
2+
3+
<p align="center">
4+
<img src="./assets/icon.png" alt="Logo" width="250"/>
5+
</p>
6+
7+
# Technologies
8+
9+
[![JavaScript](https://img.shields.io/badge/javascript-%23323330.svg?style=for-the-badge&logo=javascript&logoColor=%23F7DF1E)](https://www.javascript.com/)
10+
[![TypeScript](https://img.shields.io/badge/TypeScript-007ACC?style=for-the-badge&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
11+
[![React](https://img.shields.io/badge/react-%2320232a.svg?style=for-the-badge&logo=react&logoColor=%2361DAFB)](https://reactjs.org/)
12+
[![HTML5](https://img.shields.io/badge/html5-%23E34F26.svg?style=for-the-badge&logo=html5&logoColor=white)](https://html.com/html5/)
13+
[![Webpack](https://img.shields.io/badge/webpack-%238DD6F9.svg?style=for-the-badge&logo=webpack&logoColor=black)](https://webpack.js.org/)
14+
[![D3](https://img.shields.io/badge/d3%20js-F9A03C?style=for-the-badge&logo=d3.js&logoColor=white)](https://d3js.org/)
15+
[![ESLint](https://img.shields.io/badge/eslint-3A33D1?style=for-the-badge&logo=eslint&logoColor=white)](https://eslint.org/)
16+
[![Material UI](https://img.shields.io/badge/Material%20UI-007FFF?style=for-the-badge&logo=mui&logoColor=white)](https://mui.com/)
17+
[![Jest](https://img.shields.io/badge/Jest-C21325?style=for-the-badge&logo=jest&logoColor=white)](https://jestjs.io/)
18+
[![Babel](https://img.shields.io/badge/Babel-F9DC3E?style=for-the-badge&logo=babel&logoColor=white)](https://babeljs.io/)
19+
20+
# Overview
21+
22+
React Query Rewind introduces a powerful DevTool extension designed to work in conjunction with React Query's built-in DevTools in order to optimize time-traveling through state changes in an application. This open-source extension is tailored to enhance the debugging experience for React Query users, allowing them to explore state changes and component relationships with ease.
23+
24+
# Getting Started
25+
26+
## Prerequisites
27+
28+
1. React Query installed and in use in your application.
29+
30+
2. Install RQRewind Chrome Extension.
31+
32+
<!-- _link / picture of Extension in Chrome Store_ -->
33+
34+
## Installation
35+
36+
1. Download npm package into your application.
37+
38+
```sh
39+
npm i react-query-rewind
40+
```
41+
42+
2. Import the ReactQueryRewind component into the root of your applicaiton.
43+
44+
_picture of importing the component_
45+
46+
```javascript
47+
import ReactQueryRewind from 'react-query-rewind';
48+
```
49+
50+
3. Place ReactQueryRewind next to the root of your application inside the QueryClientProvider component.
51+
52+
```javascript
53+
ReactDOM.createRoot(document.getElementById('root')!).render(
54+
<QueryClientProvider client={queryClient}>
55+
<App />
56+
<ReactQueryRewind />
57+
</QueryClientProvider>
58+
);
59+
```
60+
61+
4. Open the Chrome DevTool Extension and start coding!
62+
63+
<p align="left">
64+
<img src="./assets/chrome-devtool.png" alt="Component Placement" width="600"/>
65+
</p>
66+
67+
# Features
68+
69+
- <b>Query States: </b>Upon opening RQRewind in Chrome Dev Tools, you will see the Queries tab open with a drop down menu listing the query keys of all the incoming queries. Select the queries that you want to monitor, make changes on the web app, and the changes of query states will be logged as reflected by the growing number above the play bar. Use the play bar to navigate to a particular state snapshot that you would like to inspect.
70+
71+
<p align="center"><img src="./assets/query-states.gif" width='800' style="margin-top: 1em; margin-bottom: 1em;"></p>
72+
73+
- <b>State Diff: </b>Toggle on the Diff button to see state changes between each snapshot highlighted. Turn on the switch on top of the page to show only parts of the state that are changed.
74+
75+
<p align="center"><img src="./assets/state-diff.gif" width='800' style="margin-top: 1em; margin-bottom: 1em;"></p>
76+
77+
- <b>Live UI Change: </b>As you review the state change history, there is also the option to turn on the time travel mode by clicking on the clock icon button. Under time travel mode, when visiting a logged state snapshot on RQRewindl, the UI of the app will change accordingly. Turn off time travel mode for RQRewind to continue logging future state changes.
78+
79+
<p align="center"><img src="./assets/UI-change.gif" width='800' style="margin-top: 1em; margin-bottom: 1em;"></p>
80+
81+
- <b>Component Tree: </b> Click on the Component Tree tab and turn on the Start Profiling switch. Click on any component on the app, and view the component tree that is rendered on the dev tools panel.
82+
83+
<p align="center"><img src="./assets/component-tree.gif" width='800' style="margin-top: 1em; margin-bottom: 1em;"></p>
84+
85+
# Contact Information
86+
87+
Austin Cavanagh - [GitHub](https://github.com/austin-cavanagh) - [LinkedIn](https://www.linkedin.com/in/austincavanagh/) - austin.cavanagh.cs@gmail.com
88+
89+
Emma Teering - [GitHub](https://github.com/eteering) - [LinkedIn](https://www.linkedin.com/in/emma-teering/) - teeringe@gmail.com
90+
91+
John Dunn - [GitHub](https://github.com/johnwdunn20) - [LinkedIn](https://www.linkedin.com/in/johnwdunn/) - johnwdunn20@gmail.com
92+
93+
Rui Fan - [GitHub](https://github.com/ruifan-IU) - [LinkedIn](https://www.linkedin.com/in/rui-fan-868231299/) - rfan1986@gmail.com
94+
95+
# Links
96+
97+
[![Medium](https://img.shields.io/badge/Medium-12100E?style=for-the-badge&logo=medium&logoColor=white)](https://medium.com/@teeringe/react-query-rewind-time-travel-debugging-made-simple-46aaeeafd497)
98+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/react-query-rewind/)
99+
100+
Project Link: [React Query Rewind](https://github.com/oslabs-beta/react-query-rewind-chrome)
101+
102+
# License
103+
104+
_MIT Link_
105+
106+
<p align="right">(<a href="#readme-top">back to top</a>)</p>

package/assets/UI-change.gif

1.16 MB
Loading

package/assets/chrome-devtool.png

363 KB
Loading

package/assets/component-tree.gif

821 KB
Loading

package/assets/icon.png

330 KB
Loading

package/assets/query-states.gif

1.3 MB
Loading

package/assets/state-diff.gif

793 KB
Loading

package/examples/example-2/client/src/client/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ const queryClient = new QueryClient({
1717
});
1818

1919
ReactDOM.createRoot(document.getElementById('root')!).render(
20-
// <React.StrictMode>
2120
<QueryClientProvider client={queryClient}>
2221
<App />
23-
{/* <ReactQueryDevtools /> */}
2422
<ReactQueryRewind />
2523
</QueryClientProvider>
26-
// </React.StrictMode>
2724
);

0 commit comments

Comments
 (0)