Skip to content

Commit 32bd27b

Browse files
authored
Merge pull request #24 from reactrewind/dev
prepare final merge
2 parents 408b9fb + a42e609 commit 32bd27b

File tree

9 files changed

+75
-39
lines changed

9 files changed

+75
-39
lines changed

README.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,61 @@
1+
<p align="center">
2+
<img src ="./images/greygreen_gg_full_350w.png" width="200"/>
3+
</p>
14

2-
<div style="text-align:center"><img src ="./images/greygreen_gg_full_350w.png" width="200"/></div>
5+
# Rewind: A Time Travel Debugger for React *useReducer*
36

4-
# Rewind : A Time Travel Debugger for React useReducer
5-
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/reactrewind/react-rewind/pulls) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)<br/>
6-
A time travel debugger for React's useReducer hook, designed to help engineers record and replay user sessions to fix bugs faster.
7-
Debug issues easier by “rewinding” your session instead of having to reproduce the issue until you find the bug.
7+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/reactrewind/react-rewind/pulls) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8+
![Release Beta](https://img.shields.io/badge/release-beta-blue.svg)<br/><br/>
9+
Designed to help engineers fix bugs faster by recording and replaying through different states of their applications. Debug your app more easily by “rewinding” your session instead of having to reproduce the issue until you find the problem. <br/>
810

9-
- Press record and start interacting with your application
10-
- Each dispatched action will be stored as a unique “event” in time
11-
- Rewind through your recorded actions with back buttom
12-
- Press play to view your changing app state
1311

1412

15-
**React Rewind is in active development. Please follow this repo for contribution guidelines and our development road map.**
13+
- Press record and start interacting with your application.
14+
- Each dispatched action will be stored as a unique event in time.
15+
- Rewind through your recorded actions with the back button or by dragging the slider.
16+
- Analyze the state, the effects and the action object of every disptached event.
17+
- Press play and watch your app change!
18+
<p align="center">
19+
<img src ="images/BrowserPreview_tmp.gif" width="600">
20+
</p>
21+
22+
**React Rewind is in active development. Follow this repo for contribution guidelines.**
1623
## Getting Started
1724

18-
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
25+
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
1926

2027
### Prerequisites
21-
Your application must be using the hook useReducer for actions to be record.
28+
Your application must be using the hook `useReducer` for actions to be recorded.
2229

2330
### Installing
2431
React Rewind will soon be available as a Chrome extension through the Google Chrome Web Store.
2532

26-
If you prefer to install locally, setup instructions are as follows:
33+
To install locally, setup instructions are as follows:
2734

2835
1. `git clone https://github.com/reactrewind/react-rewind.git`
2936
2. `cd react-rewind`
30-
3. `npm install`
37+
3. `npm run install_dep`
3138
4. `npm run build`
32-
5. `Then head to [chrome://extensions/](chrome://extensions/)`
33-
6. `Click Load Unpacked button and upload the chrome folder, located at react-rewind/src/browser/chrome.`
34-
7. `On your application page open Chrome Developer tools and select React Rewind from the tool bar.`
35-
8. `Click Record and begin interacting with your application.`
39+
5. Visit the URL `chrome://extensions/`
40+
6. Click Load Unpacked button and select the folder `react-rewind/src/browser/chrome`
41+
7. On your application page, open the Chrome Developer tools and select `React Rewind` from the tool bar
42+
8. Click Record and begin interacting with your application
43+
3644

45+
As you interact with your application, actions will populate the events panel. Click on these actions to view more details about them, such as the action object that was dispatched, the effects or state difference, and the whole state of the application after the dispatch. The time slider panel allows you to rewind, fast forward, and play through all recorded actions.
3746

38-
As you interact with your application actions will populate in the events panel. These actions are clickable and will change the state of your page. The actions can be viewed in more detail in the right panel by inspecting the actions, effects, and state. The time slider panel allows you to rewind, fast forward,and play through all recorded actions.
47+
### Application Features
48+
<p align="center">
49+
<img src ="images/effects_900w.gif" width="700" />
50+
</p>
3951

40-
### The UI
41-
|Property | Description |
52+
| Field | Description |
4253
| ------------- | ------------- |
43-
| Events | Dispatched actions (three ways to view see below) <br/>Shows elapsed time since last dispatch |
44-
|Actions | Events action type and payload |
45-
|Effects | Difference between selected event and previous state |
46-
|State | Overall state of the application at the selected time |
54+
| events | action types and time since last dispatch |
55+
| actions | the action object that was dispatched |
56+
| effects | difference between the states before and after the action was dispatched |
57+
| state | the state object after the action was dispatched |
58+
4759
## Contributing
4860

4961
Please fork this repo. We welcome pull requests. For suggestions or to report bugs please log an issue.
@@ -54,9 +66,9 @@ We use [SemVer](http://semver.org/) for versioning. For the versions available,
5466

5567
## Authors
5668

57-
[Brandon Murphy](https://github.com/murphybrandon) | [Victor Varaschin](https://github.com/victorvrv) | [Kia Colbert](https://github.com/kiacolbert) | [Gabor Mowiena](https://github.com/GaberMowiena)
69+
[Brandon Murphy](https://github.com/murphybrandon) | [Victor Varaschin](https://github.com/victorvrv) | [Kia Colbert](https://github.com/kiacolbert) | [Gaber Mowiena](https://github.com/GaberMowiena)
5870

5971
## License
6072

61-
This project is licensed under the MIT License - see the [LICENSE.md](./LICENSE) file for details
73+
This project is licensed under the MIT License - see the [LICENCE.md](./LICENCE) file for details
6274

images/BrowserPreview_tmp.gif

499 KB
Loading

images/effects_900w.gif

456 KB
Loading

src/app/components/App.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,13 @@ class App extends Component {
104104
isPlayingIndex: state.data.length,
105105
filteredData: [...state.filteredData, newData],
106106
eventTimes: [...state.eventTimes, eventTime],
107+
...newData,
107108
}));
108109
} else {
109110
this.setState(state => ({
110111
data: [...state.data, newData],
111112
isPlayingIndex: state.data.length,
113+
...newData,
112114
}));
113115
}
114116
});

src/app/components/DetailCards/Actions/ActionsDisplay.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import ReactJson from 'react-json-view';
44
//styled components
55
import { DetailsWrapper } from '../../../styles/Details.jsx';
66

7-
export default function Actions(props) {
7+
export default function Actions({ action, setIsClicked }) {
88
// renders action information
9-
const { action } = props;
9+
setIsClicked(true);
1010
return (
1111
<DetailsWrapper>
1212
{<ReactJson

src/app/components/DetailCards/Effects/EffectsDisplay.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import stateDifference from '../../stateDifference.jsx';
77

88

99
export default function Effects(props) {
10-
const { prevState, actionState } = props;
10+
const { prevState, actionState, setIsClicked } = props;
1111
const differenceOfPrevAndNextState = stateDifference(prevState, actionState);
12-
12+
setIsClicked(true);
1313
return (
1414
<DetailsWrapper>
1515
<ReactJson
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import ReactJson from 'react-json-view';
3+
4+
//styled components
5+
import { DetailsWrapper } from '../../../styles/Details.jsx';
6+
7+
export default function InitialDisplay({ action }) {
8+
// renders action information
9+
10+
return (
11+
<DetailsWrapper>
12+
{<ReactJson
13+
theme={'threezerotwofour'}
14+
style={{ backgroundColor: 'transparent' }}
15+
displayDataTypes={false}
16+
src={action}
17+
/> || 'select an event'}
18+
</DetailsWrapper>
19+
);
20+
}

src/app/components/DetailCards/State/StateDisplay.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import StateCard from './StateCard.jsx';
44
// styled component
55
import { DetailsWrapper } from '../../../styles/Details.jsx';
66

7-
export default function State(props) {
7+
export default function State({ actionState, setIsClicked }) {
88
// stringifying data to pass down to StateCard to display
9-
const { actionState } = props;
9+
setIsClicked(true);
1010
return (
1111
<DetailsWrapper>
1212
{<StateCard actionState={actionState} />}

src/app/container/Details.jsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { Component, useState } from 'react';
22

33
const ReactRouter = require('react-router-dom');
44

@@ -12,7 +12,7 @@ import DetailsNav from '../components/DetailCards/DetailsNav.jsx';
1212
import ActionsDisplay from '../components/DetailCards/Actions/ActionsDisplay.jsx'
1313
import EffectsDisplay from '../components/DetailCards/Effects/EffectsDisplay.jsx'
1414
import StateDisplay from '../components/DetailCards/State/StateDisplay.jsx'
15-
15+
import InitalDisplay from '../components/DetailCards/InitialDetailCard/InitialDisplay.jsx'
1616

1717
export default function Details(props) {
1818
// destructuring required info that's being passed down from App.jsx
@@ -21,24 +21,26 @@ export default function Details(props) {
2121
action, prevState, actionState,
2222
} = props;
2323

24-
24+
const [isClicked, setIsClicked] = useState(false);
25+
console.log('isClicked', isClicked);
2526
return (
2627
<Router>
2728
<>
2829
<DetailsNav />
30+
{isClicked === false ? <InitalDisplay action={action} /> : null }
2931
{/* routing components and rendering them with props */}
3032
<Route
3133
exact
3234
path='/'
33-
render={props => <ActionsDisplay {...props} action={action} />}
35+
render={props => <ActionsDisplay {...props} action={action} setIsClicked={setIsClicked} />}
3436
/>
3537
<Route
3638
path='/effects'
37-
render={props => <EffectsDisplay {...props} prevState={prevState} actionState={actionState} />}
39+
render={props => <EffectsDisplay {...props} prevState={prevState} setIsClicked={setIsClicked} actionState={actionState} />}
3840
/>
3941
<Route
4042
path='/state'
41-
render={props => <StateDisplay {...props} actionState={actionState} />}
43+
render={props => <StateDisplay {...props} actionState={actionState} setIsClicked={setIsClicked} />}
4244
/>
4345
</>
4446
</Router>

0 commit comments

Comments
 (0)