Skip to content

Commit 2f526d5

Browse files
committed
Merge branch 'dev' into james/test/tree-files
2 parents 35ceda6 + 0e3c761 commit 2f526d5

File tree

2 files changed

+122
-50
lines changed

2 files changed

+122
-50
lines changed

README.md

Lines changed: 120 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
</a>
1919
<a href="https://travis-ci.com/oslabs-beta/reactime">
2020
<img src="https://travis-ci.com/oslabs-beta/reactime.svg?branch=master" alt="Build Status">
21-
</a>
21+
</a>
2222
<a href="http://badge.fury.io/js/reactime">
2323
<img src="https://badge.fury.io/js/reactime.svg" alt="npm version">
24-
</a>
24+
</a>
2525
<img src="https://img.shields.io/badge/babel%20preset-airbnb-ff69b4" alt="BabelPresetPrefs">
2626
<img src="https://img.shields.io/badge/linted%20with-eslint-blueviolet" alt="LintPrefs">
2727
</p>
@@ -43,51 +43,87 @@
4343
<a href="#how-to-use">How To Use</a> • <a href="#features">Features</a> • <a href="https://reactime.io">Website</a> • <a href="#read-more">Read More</a>
4444
</p>
4545

46-
<b>Reactime 16.0</b> presents the codebase with substantial, much-needed clean-up. From the backend and frontend to testing, the Reactime XVI team has: removed vestigial code, added comments to clarify code, implemented 100% testing coverage for the codebase, compartmentalized and modularized files, and implemented typescript.
46+
<b>Reactime 16.0</b> presents the codebase with substantial, much-needed
47+
clean-up. From the backend and frontend to testing, the Reactime XVI team has:
48+
removed vestigial code, added comments to clarify code, implemented 100% testing
49+
coverage for the codebase, compartmentalized and modularized files, and
50+
implemented typescript.
4751

48-
The primary purpose of this update is to allow easier understanding of Reactime's codebase by individuals or groups wishing to further update Reactime, keeping this great developer tool alive.
52+
The primary purpose of this update is to allow easier understanding of
53+
Reactime's codebase by individuals or groups wishing to further update Reactime,
54+
keeping this great developer tool alive.
4955

50-
With release of Node v18.12.1(LTS) on 11/4/22, the script has been updated to 'npm run dev' || 'npm run build' for backwards compatibility.<br/>
51-
For version Node v16.16.0, please use script 'npm run devlegacy' || 'npm run buildlegacy'
56+
With release of Node v18.12.1(LTS) on 11/4/22, the script has been updated to
57+
'npm run dev' || 'npm run build' for backwards compatibility.<br/> For version
58+
Node v16.16.0, please use script 'npm run devlegacy' || 'npm run buildlegacy'
5259

5360
Previously, <b>Reactime 14.0 and 15.0</b> added the exciting features below:
5461

55-
I. React Router Compatibility <br>
56-
Reactime is now compatible with React Router applications! Prior to Reactime 14.0, recording state snapshots as the user navigated across various routes was possible, but time travel debugging was only possible for the current route (i.e. jumping back to a prior state at a different route was not possible). In order to streamline debugging of applications with multiple routes, Reactime 14.0 added functionality that allows the user to time-travel back to different routes, including live updating in the browser to reflect the state of their application at that previously visited route.
57-
58-
II. Classifying State Snapshots by Route <br>
59-
The list of state snapshots in the Reactime dashboard is now classified by route to give the developer visual cues of the snapshot-route relationship and make time travel debugging of various routes easier.
60-
61-
III. Filtering Performance Metrics By Route <br>
62-
The Reactime dashboard includes a stacked bar graph showing render times for each component, with a separate bar stack for each snapshot. With Reactime 14.0, this composite bar graph can now be filtered by route to allow the developer to review detailed performance data by route.
63-
64-
IV. Visualize And Compare Components Within a Snapshot <br>
65-
Users not only have access to multiple snapshots, but can now zone into a specified snapshot more granularly through a new visualization consisting of its individual components. These new graphs are rendered directly in the same Performance tab in Reactime and provide details for each component when the user hovers over, providing a new visual comparison of components across a single chosen state.
62+
I. React Router Compatibility <br> Reactime is now compatible with React Router
63+
applications! Prior to Reactime 14.0, recording state snapshots as the user
64+
navigated across various routes was possible, but time travel debugging was only
65+
possible for the current route (i.e. jumping back to a prior state at a
66+
different route was not possible). In order to streamline debugging of
67+
applications with multiple routes, Reactime 14.0 added functionality that allows
68+
the user to time-travel back to different routes, including live updating in the
69+
browser to reflect the state of their application at that previously visited
70+
route.
71+
72+
II. Classifying State Snapshots by Route <br> The list of state snapshots in the
73+
Reactime dashboard is now classified by route to give the developer visual cues
74+
of the snapshot-route relationship and make time travel debugging of various
75+
routes easier.
76+
77+
III. Filtering Performance Metrics By Route <br> The Reactime dashboard includes
78+
a stacked bar graph showing render times for each component, with a separate bar
79+
stack for each snapshot. With Reactime 14.0, this composite bar graph can now be
80+
filtered by route to allow the developer to review detailed performance data by
81+
route.
82+
83+
IV. Visualize And Compare Components Within a Snapshot <br> Users not only have
84+
access to multiple snapshots, but can now zone into a specified snapshot more
85+
granularly through a new visualization consisting of its individual components.
86+
These new graphs are rendered directly in the same Performance tab in Reactime
87+
and provide details for each component when the user hovers over, providing a
88+
new visual comparison of components across a single chosen state.
6689

6790
<p align="center">
6891
<img src="./assets/snapshot-comparison.gif" />
6992

70-
After installing Reactime, you can test its functionalities with your React application in development mode.
93+
After installing Reactime, you can test its functionalities with your React
94+
application in development mode.
7195

72-
Please note, the time jumping feature will <b>ONLY</b> work when your application is running in <b>development mode</b>. In production mode, you are able to view your application’s component map but no additional features.
96+
Please note, the time jumping feature will <b>ONLY</b> work when your
97+
application is running in <b>development mode</b>. In production mode, you are
98+
able to view your application’s component map but no additional features.
7399

74100
## <b>Installation</b>
75101

76-
To get started, install the Reactime [extension](https://chrome.google.com/webstore/detail/reactime/cgibknllccemdnfhfpmjhffpjfeidjga) from Chrome Web Store.
102+
To get started, install the Reactime
103+
[extension](https://chrome.google.com/webstore/detail/reactime/cgibknllccemdnfhfpmjhffpjfeidjga)
104+
from Chrome Web Store.
77105

78-
NOTE: The React Developer Tools [extension](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en) is also required for Reactime to run, if you do not already have it installed on your browser.
106+
NOTE: The React Developer Tools
107+
[extension](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en)
108+
is also required for Reactime to run, if you do not already have it installed on
109+
your browser.
79110

80-
### Installation
111+
### Manual Installation
81112

82-
Go to Chrome Extensions (make sure Chrome Extension is in Developer Mode) for manual installation in (https://developer.chrome.com/extensions/faq#faq-dev-01) and click on Load Unpacked. Use `src/extension/build/` to load this extension. Turn on 'Allow access to file URLs' in extension details page if testing locally.
113+
Go to Chrome Extensions (make sure Chrome Extension is in Developer Mode) for
114+
manual installation in (https://developer.chrome.com/extensions/faq#faq-dev-01)
115+
and click on Load Unpacked. Use `src/extension/build/` to load this extension.
116+
Turn on 'Allow access to file URLs' in extension details page if testing
117+
locally.
83118

84-
<i>Please refer to Developer Install for a detailed guide:</i>
85-
<a href='/DeveloperREADME.md'>Developer Install</a>
119+
### Looking to contribute to Reactime?
86120

87-
### Building from source
121+
<i>Please refer to Developer Install for a detailed guide:</i>
122+
<a href='/DeveloperREADME.md'>Developer Install</a>
88123

89-
Please see [the developer README](src/README.md) for instructions on building
90-
from source.
124+
After you finish the Develpoer Install, checkout
125+
[the developer README](src/README.md) for more info on the project, and
126+
instructions on building from source.
91127

92128
## <b>How to Use</b>
93129

@@ -99,26 +135,36 @@ Then open up your Chrome DevTools and navigate to the Reactime panel.
99135

100136
### ❓ <b>Why is Reactime telling me that no React application is found?</b>
101137

102-
Reactime initially runs using the dev tools global hook from the Chrome API. It takes time for Chrome to load this. Try refreshing your application a couple times until you see Reactime running.
138+
Reactime initially runs using the dev tools global hook from the Chrome API. It
139+
takes time for Chrome to load this. Try refreshing your application a couple
140+
times until you see Reactime running.
103141

104142
### ❓ <b>There is a black screen instead of the Reactime extension</b>
105143

106-
Try refreshing the application you want to test and refresh the DevTools by clicking the right mouse button “Reload frame”.
144+
Try refreshing the application you want to test and refresh the DevTools by
145+
clicking the right mouse button “Reload frame”.
107146

108147
### ❓ <b>I found a bug in Reactime</b>
109148

110-
Reactime is an open source project, and we’d really appreciate your help with improving user experience. Please read [the developer README](src/README.md), and create a pull request (or issue) to propose and collaborate on changes to a repository.
149+
Reactime is an open source project, and we’d really appreciate your help with
150+
improving user experience. Please read [the developer README](src/README.md),
151+
and create a pull request (or issue) to propose and collaborate on changes to a
152+
repository.
111153

112154
### ❓ <b>Node version compatiability</b>
113155

114-
With release of Node v18.12.1(LTS) on 11/4/22, the script has been updated to 'npm run dev' | 'npm run build' for backwards compatibility.<br/>
115-
For version Node v16.16.0, please use script 'npm run devlegacy' | 'npm run buildlegacy'
156+
With release of Node v18.12.1(LTS) on 11/4/22, the script has been updated to
157+
'npm run dev' | 'npm run build' for backwards compatibility.<br/> For version
158+
Node v16.16.0, please use script 'npm run devlegacy' | 'npm run buildlegacy'
116159

117160
## <b>Features</b>
118161

119162
### 🔹 Viewing
120163

121-
You can view your application's file structure and click on a snapshot to view your app's state. State can be visualized in a Component Graph, JSON Tree, or Performance Graph. Snapshots can be diffed with the previous snapshot, which can be viewed in Diff mode.
164+
You can view your application's file structure and click on a snapshot to view
165+
your app's state. State can be visualized in a Component Graph, JSON Tree, or
166+
Performance Graph. Snapshots can be diffed with the previous snapshot, which can
167+
be viewed in Diff mode.
122168
<br>
123169
<br>
124170

@@ -129,7 +175,10 @@ You can view your application's file structure and click on a snapshot to view y
129175

130176
### 🔹 Snapshot Series and Action Comparison
131177

132-
You can save a series of state snapshots and use it to analyze changes in component render performance between current and previous series of snapshots. You can also name specific snapshots and compare all snapshots with the same name.
178+
You can save a series of state snapshots and use it to analyze changes in
179+
component render performance between current and previous series of snapshots.
180+
You can also name specific snapshots and compare all snapshots with the same
181+
name.
133182
<br>
134183
<br>
135184

@@ -140,7 +189,10 @@ You can save a series of state snapshots and use it to analyze changes in compon
140189

141190
### 🔹 Components Comparison
142191

143-
When toggled to a specific snapshot, a visualization of the individual components of the snapshow will be displayed. This can be done under the same Performance tab where the snapshots are rendered. You will also find details of each component upon hovering.
192+
When toggled to a specific snapshot, a visualization of the individual
193+
components of the snapshow will be displayed. This can be done under the same
194+
Performance tab where the snapshots are rendered. You will also find details of
195+
each component upon hovering.
144196
<br>
145197
<br>
146198

@@ -151,7 +203,9 @@ When toggled to a specific snapshot, a visualization of the individual component
151203

152204
### 🔹 Recording
153205

154-
Whenever state is changed (whenever setState, 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.
206+
Whenever state is changed (whenever setState, useState is called), this
207+
extension will create a snapshot of the current state tree and record it. Each
208+
snapshot will be displayed in Chrome DevTools under the Reactime panel.
155209
<br>
156210
<br>
157211

@@ -162,27 +216,40 @@ Whenever state is changed (whenever setState, useState is called), this extensio
162216

163217
### 🔹 Re-render Optimization
164218

165-
One of the most common issues that affects performance in React is unnecessary render cycles. This problem can be fixed by checking your renders in the Performance tab in Chrome DevTools under the Reactime panel.
219+
One of the most common issues that affects performance in React is unnecessary
220+
render cycles. This problem can be fixed by checking your renders in the
221+
Performance tab in Chrome DevTools under the Reactime panel.
166222

167223
### 🔹 Jumping
168224

169-
Using the actions sidebar, a user can jump to any previous recorded snapshots. Hitting the jump button on any snapshot will allow a user to view state data at any point in the history of the target application.
225+
Using the actions sidebar, a user can jump to any previous recorded snapshots.
226+
Hitting the jump button on any snapshot will allow a user to view state data at
227+
any point in the history of the target application.
170228

171229
### 🔹 Gatsby
172230

173-
Reactime offers full support for Gatsby applications. You would be able to identify unnecessary renders, duration of each rendering, travel-debugging features and visual representation of the tree components.
231+
Reactime offers full support for Gatsby applications. You would be able to
232+
identify unnecessary renders, duration of each rendering, travel-debugging
233+
features and visual representation of the tree components.
174234

175235
### 🔹 Next.js
176236

177-
Reactime offers debugging and performance tools for Next.js apps: time-traveling debugging, preventing unnecessary components re-renders and making your application faster.
237+
Reactime offers debugging and performance tools for Next.js apps: time-traveling
238+
debugging, preventing unnecessary components re-renders and making your
239+
application faster.
178240

179241
### 🔹 TypeScript Support
180242

181-
Reactime offers beta support for TypeScript applications using stateful class components and functional components. Further testing and development is required for custom hooks, Context API, and Concurrent Mode.
243+
Reactime offers beta support for TypeScript applications using stateful class
244+
components and functional components. Further testing and development is
245+
required for custom hooks, Context API, and Concurrent Mode.
182246

183247
### 🔹 Documentation
184248

185-
After cloning this repository, developers can simply run `npm run docs` at the root level and serve the dynamically generated `/docs/index.html` file on a browser. Doing so will provide a readable, extensible, and interactive GUI view of the structure and interfaces of the codebase.
249+
After cloning this repository, developers can simply run `npm run docs` at the
250+
root level and serve the dynamically generated `/docs/index.html` file on a
251+
browser. Doing so will provide a readable, extensible, and interactive GUI view
252+
of the structure and interfaces of the codebase.
186253
<br>
187254

188255
### <b>Additional Features</b>
@@ -196,7 +263,8 @@ After cloning this repository, developers can simply run `npm run docs` at the r
196263
- A slider to move through snapshots quickly
197264
- A play button to move through snapshots automatically
198265
- A lock button, which stops recording each snapshot
199-
- A persist button to keep snapshots upon refresh (handy when changing code and debugging)
266+
- A persist button to keep snapshots upon refresh (handy when changing code and
267+
debugging)
200268
- Download/upload the current snapshots in memory
201269
- Declarative titles in the actions sidebar
202270
- Interative Tutorial Walkthrough
@@ -209,7 +277,8 @@ After cloning this repository, developers can simply run `npm run docs` at the r
209277
### <b>Bug Fixes</b>
210278

211279
- Search bar now searches for specific nodes successfully
212-
- Tab titles of chrome browser tabs not running an application in development mode are no longer affected by Reactime
280+
- Tab titles of chrome browser tabs not running an application in development
281+
mode are no longer affected by Reactime
213282
- Multiple black screens fixed
214283
- Improved UI and performance
215284
- No longer inject scripts to non-target applications
@@ -244,7 +313,8 @@ After cloning this repository, developers can simply run `npm run docs` at the r
244313
- **Daljit Gill** - [@dgill05](https://github.com/dgill05)
245314
- **Ben Michareune** - [@bmichare](https://github.com/bmichare)
246315
- **Dane Corpion** - [@danecorpion](https://github.com/danecorpion)
247-
- **Harry Fox** - [@StackOverFlowWhereArtThou](https://github.com/StackOverFlowWhereArtThou)
316+
- **Harry Fox** -
317+
[@StackOverFlowWhereArtThou](https://github.com/StackOverFlowWhereArtThou)
248318
- **Nathan Richardson** - [@BagelEnthusiast](https://github.com/BagelEnthusiast)
249319
- **David Bernstein** - [@dangitbobbeh](https://github.com/dangitbobbeh)
250320
- **Joseph Stern** - [@josephiswhere](https://github.com/josephiswhere)
@@ -279,7 +349,8 @@ After cloning this repository, developers can simply run `npm run docs` at the r
279349
- **David Chai** - [@davidchaidev](https://github.com/davidchai717)
280350
- **Yujin Kang** - [@yujinkay](https://github.com/yujinkay)
281351
- **Andy Wong** - [@andynullwong](https://github.com/andynullwong)
282-
- **Chris Flannery** - [@chriswillsflannery](https://github.com/chriswillsflannery)
352+
- **Chris Flannery** -
353+
[@chriswillsflannery](https://github.com/chriswillsflannery)
283354
- **Rajeeb Banstola** - [@rajeebthegreat](https://github.com/rajeebthegreat)
284355
- **Prasanna Malla** - [@prasmalla](https://github.com/prasmalla)
285356
- **Rocky Lin** - [@rocky9413](https://github.com/rocky9413)
@@ -299,4 +370,5 @@ After cloning this repository, developers can simply run `npm run docs` at the r
299370

300371
## <b>License </b>
301372

302-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
373+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
374+
for details.

src/backend/linkFiber.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ const exclude = ['alternate', '_owner', '_store', 'get key', 'ref', '_self', '_s
140140
// This recursive function is used to grab the state of children components
141141
// and push them into the parent componenent
142142
// react elements throw errors on client side of application - convert react/functions into string
143-
function convertDataToString(newObj, oldObj) {
143+
function convertDataToString(newObj, oldObj, depth = 0) {
144144
const newPropData = oldObj || {};
145145
for (const key in newObj) {
146146
if (typeof newObj[key] === 'function') {
@@ -149,7 +149,7 @@ function convertDataToString(newObj, oldObj) {
149149
newPropData[key] = 'reactFiber';
150150
return newPropData;
151151
} else if (typeof newObj[key] === 'object' && exclude.includes(key) !== true) {
152-
newPropData[key] = convertDataToString(newObj[key], null);
152+
newPropData[key] = depth > 10 ? 'convertDataToString reached max depth' : convertDataToString(newObj[key], null, depth + 1);
153153
} else if (exclude.includes(key) !== true) {
154154
newPropData[key] = newObj[key];
155155
}

0 commit comments

Comments
 (0)