Skip to content

Commit 9d416b3

Browse files
committed
merged files with master
2 parents c5e8972 + 687cf33 commit 9d416b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+39144
-7116
lines changed

.eslintrc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
{
2-
"extends": ["airbnb", "plugin:jest/recommended"],
2+
"extends": [
3+
"airbnb",
4+
"plugin:jest/recommended",
5+
"plugin:@typescript-eslint/eslint-recommended",
6+
"plugin:@typescript-eslint/recommended"],
37
"root": true,
4-
"plugins": ["jest", "react", "react-hooks"],
8+
"plugins": ["jest", "react", "react-hooks", "@typescript-eslint"],
59
"rules": {
610
"arrow-parens": [2, "as-needed"],
711
"import/no-unresolved": "off",

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"eslint.enable": true
2+
"eslint.enable": true,
3+
"git.ignoreLimitWarning": true
34
}

MyMovie.gif

446 KB
Loading

package-lock.json

Lines changed: 1062 additions & 6944 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@
6363
"@babel/preset-react": "^7.10.4",
6464
"@types/chrome": "^0.0.119",
6565
"@types/jest": "^26.0.4",
66-
"@types/node": "^14.0.23",
66+
"@types/node": "^12.12.50",
67+
"@typescript-eslint/eslint-plugin": "^3.6.1",
68+
"@typescript-eslint/parser": "^3.6.1",
6769
"babel-loader": "^8.1.0",
6870
"core-js": "^3.6.5",
6971
"css-loader": "^3.6.0",

readme-OldVersion.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<p align="center">
2+
<img src ="./assets/readme-logo-svg.svg" width="300"/>
3+
</p>
4+
5+
<h1 align="center">State Debugger for React</h1>
6+
7+
[![GitHub](https://img.shields.io/github/license/oslabs-beta/reactime)](https://github.com/oslabs-beta/reactime) [![Build Status](https://travis-ci.com/oslabs-beta/reactime.svg?branch=master)](https://travis-ci.com/oslabs-beta/reactime) [![npm version](https://badge.fury.io/js/reactime.svg)](http://badge.fury.io/js/reactime) [![Dependencies](https://david-dm.org/oslabs-beta/reactime.svg)](https://david-dm.org/oslabs-beta/reactime#info=dependencies) [![DevDependencies](https://david-dm.org/oslabs-beta/reactime/dev-status.svg)](https://david-dm.org/oslabs-beta/reactime?type=dev) [![Vulnerabilities](https://snyk.io/test/github/oslabs-beta/reactime/badge.svg)](https://snyk.io/test/github/oslabs-beta/reactime)
8+
9+
10+
![demo](./demo.gif)
11+
12+
13+
14+
Reactime is a debugging tool for React developers. It records state whenever it is changed and allows the user to jump to any previously recorded state.
15+
16+
This tool is for React apps using stateful components and prop drilling, and has beta support for Context API, conditional state routing, Hooks (useState, useEffect) and functional components.
17+
18+
The latest release extends the core functionality by including support for TypeScript applications, improving the user experience through more declarative titles in the actions panel, and extending support for components with conditional state fields. The testing suite has also been expanded with the inclusion of a Sandbox utility to aid future expansion as well as additional E2E and integration tests with Puppeteer and React Testing Library.
19+
20+
After installing the Reactime, you can test its functionalities in the following demo repositories:
21+
22+
- [Calculator](https://joshua0308.github.io/calculator/)
23+
- [Bitcoin Price Index](http://reactime-demo2.us-east-1.elasticbeanstalk.com)
24+
25+
Reactime was nominated for the Productivity Booster award at [React Open Source Awards 2020](https://osawards.com/react/)!
26+
27+
## Installation
28+
29+
Two parts are required for this tool to function: a [**Chrome extension**](https://chrome.google.com/webstore/detail/react-time-travel/cgibknllccemdnfhfpmjhffpjfeidjga) and an [**NPM package**](https://www.npmjs.com/package/reactime).
30+
31+
1. Install the Reactime [extension](https://chrome.google.com/webstore/detail/reactime/cgibknllccemdnfhfpmjhffpjfeidjga) from Chrome Web Store. Alternatively, use `src/extension/build/build.zip` for manual installation in [Developer mode](https://developer.chrome.com/extensions/faq#faq-dev-01). Turn on 'Allow access to file URLs' in extension details page if testing locally.
32+
33+
2. Install the [NPM package](https://www.npmjs.com/package/reactime) in your application's root directory.
34+
35+
```
36+
npm i reactime
37+
```
38+
39+
3. Call the library method on your root container after rendering your App.
40+
41+
```
42+
import reactime from 'reactime';
43+
44+
const rootContainer = document.getElementById('root');
45+
ReactDOM.render(<App />, rootContainer);
46+
47+
reactime(rootContainer);
48+
```
49+
50+
4. For experimental concurrent mode support.
51+
52+
```
53+
import reactime from 'reactime';
54+
55+
const rootContainer = ReactDOM.createRoot(document.getElementById('root'));
56+
rootContainer.render(<App />);
57+
reactime(rootContainer);
58+
```
59+
60+
5. Done! That's all you have to do to link your React project to our library.
61+
62+
## How to Use
63+
64+
After installing both the Chrome extension and the NPM package, just open up your project in the browser.
65+
66+
Then open up your Chrome DevTools and navigate to the Reactime tab.
67+
68+
## Features
69+
70+
### Recording
71+
72+
Whenever state is changed (whenever setState or useState is called), this extension will create a snapshot of the current state tree and record it. Each snapshot will be displayed in Chrome DevTools under the Reactime panel.
73+
74+
### Viewing
75+
76+
You can click on a snapshot to view your app's state. State can be visualized in a JSON or a tree. Also, snapshots can be diffed with the previous snapshot, which can be viewed under the Diff tab.
77+
78+
### Jumping
79+
80+
Jumping is the most important feature of all. It allows you to jump to any previous recorded snapshots. Hitting the jump button on any snapshot will change the DOM by setting their state.
81+
82+
### TypeScript Support
83+
84+
Reactime offers beta support for TypeScript applications using stateful class components and functional components with useState hooks. Further testing and development is required for custom hooks, Context API, and Concurrent Mode.
85+
86+
### Additional Features
87+
88+
- multiple tree graph branches depicting state changes
89+
- tree graph hover functionality to view state changes
90+
- ability to pan and zoom tree graph
91+
- multiple tabs support
92+
- a slider to move through snapshots quickly
93+
- a play button to move through snapshots automatically
94+
- a pause button, which stops recording each snapshot
95+
- a lock button to freeze the DOM in place. setState will lose all functionality while the extension is locked
96+
- a persist button to keep snapshots upon refresh (handy when changing code and debugging)
97+
- export/import the current snapshots in memory
98+
- declarative titles in the actions panel
99+
- extended support for components with conditional state fields
100+
- a Sandbox utility to aid future expansion
101+
102+
## Authors
103+
- **Carlos Perez** - [@crperezt](https://github.com/crperezt)
104+
- **Edwin Menendez** - [@edwinjmenendez](https://github.com/edwinjmenendez)
105+
- **Gabriela Jardim Aquino** - [@aquinojardim](https://github.com/aquinojardim)
106+
- **Gregory Panciera** - [@gpanciera](https://github.com/gpanciera)
107+
- **Nathanael Wa Mwenze** - [@nmwenz90](https://github.com/nmwenz90)
108+
- **Ryan Dang** - [@rydang](https://github.com/rydang)
109+
- **Bryan Lee** - [@mylee1995](https://github.com/mylee1995)
110+
- **Josh Kim** - [@joshua0308](https://github.com/joshua0308)
111+
- **Sierra Swaby** - [@starkspark](https://github.com/starkspark)
112+
- **Ruth Anam** - [@peachiecodes](https://github.com/peachiecodes)
113+
- **David Chai** - [@davidchaidev](https://github.com/davidchai717)
114+
- **Yujin Kang** - [@yujinkay](https://github.com/yujinkay)
115+
- **Andy Wong** - [@andywongdev](https://github.com/andywongdev)
116+
- **Chris Flannery** - [@chriswillsflannery](https://github.com/chriswillsflannery)
117+
- **Rajeeb Banstola** - [@rajeebthegreat](https://github.com/rajeebthegreat)
118+
- **Prasanna Malla** - [@prasmalla](https://github.com/prasmalla)
119+
- **Rocky Lin** - [@rocky9413](https://github.com/rocky9413)
120+
- **Abaas Khorrami** - [@dubalol](https://github.com/dubalol)
121+
- **Ergi Shehu** - [@Ergi516](https://github.com/ergi516)
122+
- **Raymond Kwan** - [@rkwn](https://github.com/rkwn)
123+
- **Joshua Howard** - [@Joshua-Howard](https://github.com/joshua-howard)
124+
125+
## License
126+
127+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details
128+

readme.md

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![GitHub](https://img.shields.io/github/license/oslabs-beta/reactime)](https://github.com/oslabs-beta/reactime) [![Build Status](https://travis-ci.com/oslabs-beta/reactime.svg?branch=master)](https://travis-ci.com/oslabs-beta/reactime) [![npm version](https://badge.fury.io/js/reactime.svg)](http://badge.fury.io/js/reactime) [![Dependencies](https://david-dm.org/oslabs-beta/reactime.svg)](https://david-dm.org/oslabs-beta/reactime#info=dependencies) [![DevDependencies](https://david-dm.org/oslabs-beta/reactime/dev-status.svg)](https://david-dm.org/oslabs-beta/reactime?type=dev) [![Vulnerabilities](https://snyk.io/test/github/oslabs-beta/reactime/badge.svg)](https://snyk.io/test/github/oslabs-beta/reactime)
88

99

10-
![demo](./demo.gif)
10+
![demo](./MyMovie.gif)
1111

1212

1313

@@ -26,38 +26,11 @@ Reactime was nominated for the Productivity Booster award at [React Open Source
2626

2727
## Installation
2828

29-
Two parts are required for this tool to function: a [**Chrome extension**](https://chrome.google.com/webstore/detail/react-time-travel/cgibknllccemdnfhfpmjhffpjfeidjga) and an [**NPM package**](https://www.npmjs.com/package/reactime).
29+
Just one step needed [**Chrome extension**](https://chrome.google.com/webstore/detail/react-time-travel/cgibknllccemdnfhfpmjhffpjfeidjga) and an [**NPM package**](https://www.npmjs.com/package/reactime).
3030

3131
1. Install the Reactime [extension](https://chrome.google.com/webstore/detail/reactime/cgibknllccemdnfhfpmjhffpjfeidjga) from Chrome Web Store. Alternatively, use `src/extension/build/build.zip` for manual installation in [Developer mode](https://developer.chrome.com/extensions/faq#faq-dev-01). Turn on 'Allow access to file URLs' in extension details page if testing locally.
3232

33-
2. Install the [NPM package](https://www.npmjs.com/package/reactime) in your application's root directory.
34-
35-
```
36-
npm i reactime
37-
```
38-
39-
3. Call the library method on your root container after rendering your App.
40-
41-
```
42-
import reactime from 'reactime';
43-
44-
const rootContainer = document.getElementById('root');
45-
ReactDOM.render(<App />, rootContainer);
46-
47-
reactime(rootContainer);
48-
```
49-
50-
4. For experimental concurrent mode support.
51-
52-
```
53-
import reactime from 'reactime';
54-
55-
const rootContainer = ReactDOM.createRoot(document.getElementById('root'));
56-
rootContainer.render(<App />);
57-
reactime(rootContainer);
58-
```
59-
60-
5. Done! That's all you have to do to link your React project to our library.
33+
*** for old version instaling [click here](https://github.com/open-source-labs/reactime/blob/master/readme-OldVersion.md) ***
6134

6235
## How to Use
6336

src/app/__tests__/SwitchApp.test.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ describe('Unit testing for SwitchApp.jsx', () => {
4040
beforeEach(() => {
4141
wrapper.find('.tab-select-container').simulate('change', {});
4242
});
43-
// console.log('dispatch mock calls', dispatch.mock.calls);
4443
it('SwitchApp component returns <Select /> from react-select library', () => {
4544
expect(wrapper.find('.tab-select-container').type()).toEqual(Select);
4645
expect(wrapper.find('.tab-select-container').props().className).toBe('tab-select-container');

src/app/components/Action.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,16 @@ interface ActionProps {
2626
* @param displayName : Label showing sequence number of state change, reflects changes in Chart.tsx
2727
* @param componentName : Displays the name of compenent's state being changed
2828
* @param last : The last index in the array
29-
* @param sliderIndex: Index of the slider in the array of state changes (clicking the block changes the slider, related to MainSlider.tsx slider)
29+
* @param sliderIndex: Index of the slider in the array of state changes
30+
* (clicking the block changes the slider, related to MainSlider.tsx slider)
3031
* @param componentData: Displays react fiber data
3132
* @param viewIndex: Index of the tab in the array when timejump is made
3233
* @method dispatch Executes actions that changes state in reactime
3334
* @method handleOnkeyDown Executes key commands
34-
*
35+
*
3536
*/
37+
/* // gabi :: index and delta props were removed from Action.jsx */
38+
// viewIndex and handleonkeyDown added to props
3639
const Action = (props: ActionProps) => {
3740
const {
3841
selected, last, index, sliderIndex, dispatch, displayName, componentName, componentData, state, viewIndex, handleOnkeyDown,

src/app/styles/components/d3graph.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@ div.tooltip {
5454
max-width: 250px;
5555
overflow-wrap: break-word;
5656
padding: 6px;
57-
color: #320a5c;
57+
color: #1a2229;
5858
font-size: 12px;
5959
font-family: "Overpass Mono", monospace;
60-
background: #9cf4df;
60+
background: #6699C4;
6161
border-radius: 8px;
6262
pointer-events: none;
6363
}
6464

6565
.d3-tip {
6666
line-height: 1;
6767
padding: 6px;
68-
background: #9cf4df;
69-
color: #320a5c;
68+
background: #6699C4;
69+
color: #1a2229;
7070
border-radius: 4px;
7171
font-size: 13px;
7272
max-width: 400px;
@@ -80,7 +80,7 @@ div.tooltip {
8080
display: inline;
8181
font-size: 15px;
8282
line-height: 1;
83-
color: #9cf4df;
83+
color: #6699C4;
8484
content: "\25BC";
8585
position: absolute;
8686
text-align: center;

0 commit comments

Comments
 (0)