You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if(viewIndex!==-1){// snapshots should not have any property < 0. A viewIndex of '-1' means that we had a snapshot index that occurred before the initial snapshot of the application state... which is impossible. '-1' therefore means reset to the last/most recent snapshot.
26
+
previous=snapshots[viewIndex-1];// set previous to the snapshot that is before the one we are currently viewing
24
27
}else{
25
-
previous=snapshots[sliderIndex-1];
28
+
previous=snapshots[sliderIndex-1];// if viewIndex was an impossible index, we will get our snapshots index using 'sliderIndex.' sliderIndex should have already been reset to the latest snapshot index. Previous is then set to the snapshot that occurred immediately before our most recent snapshot.
26
29
}
30
+
31
+
/*
32
+
State snapshot objects have the following structure:
if(newObj.stateSnaphot){// if our new object has a stateSnaphot property
58
+
newObj.stateSnaphot=statelessCleaning(obj.stateSnaphot);// run statelessCleaning on the stateSnapshot
42
59
}
43
-
if(newObj.children){
60
+
61
+
if(newObj.children){// if our new object has a children property
44
62
newObj.children=[];
45
-
if(obj.children.length>0){
63
+
if(obj.children.length>0){// and if our input object's children property is non-empty, go through each children object and determine objects that need to be cleaned through statelessCleaning. Those that are cleaned through this process are then pushed to the new object's children array.
Copy file name to clipboardExpand all lines: src/app/components/DiffRoute.tsx
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,14 @@ import { MemoryRouter as Router, Route, NavLink, Switch } from 'react-router-dom
3
3
importDifffrom'./Diff';
4
4
import{DiffRouteProps}from'../FrontendTypes';
5
5
6
+
/*
7
+
Loads the appropriate DiffRoute view and renders the 'Tree' and 'Raw' navbar buttons after clicking on the 'Diff' button located near the top rightmost corner.
8
+
*/
9
+
10
+
// 'DiffRoute' only passed in prop is 'snapshot' from 'tabs[currentTab]' object in 'MainContainer'
Copy file name to clipboardExpand all lines: src/app/components/StateRoute/StateRoute.tsx
+22-21Lines changed: 22 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -16,19 +16,27 @@ import PerformanceVisx from './PerformanceVisx/PerformanceVisx';
16
16
importWebMetricsfrom'../WebMetrics';
17
17
import{StateRouteProps}from'../../FrontendTypes'
18
18
19
-
constHistory=require('./History').default;
20
-
21
-
constNO_STATE_MSG='No state change detected. Trigger an event to change state';
19
+
/*
20
+
Loads the appropriate StateRoute view and renders the Map, Performance, History, Webmetrics, and Tree navbar buttons after clicking on the 'State' button located near the top rightmost corner.
21
+
*/
22
22
23
+
constHistory=require('./History').default;
24
+
constNO_STATE_MSG='No state change detected. Trigger an event to change state';// message to be returned if there has been no state change detected in our hooked/target app
return<divclassName='noState'>{NO_STATE_MSG}</div>;// otherwise, inform the user that there has been no state change in the target/hooked application.
83
83
};
84
84
constrenderWebMetrics=()=>{
85
85
letLCPColor: String;
86
86
letFIDColor: String;
87
87
letFCPColor: String;
88
88
letTTFBColor: String;
89
89
90
+
// adjust the strings that represent colors of the webmetrics performance bar for 'Largest Contentful Paint (LCP)', 'First Input Delay (FID)', 'First Contentfuly Paint (FCP)', and 'Time to First Byte (TTFB)' based on webMetrics outputs.
0 commit comments