Skip to content

Commit 0e06736

Browse files
committed
Merge branch 'master' of https://github.com/oslabs-beta/reactime
Pulled in team commits.
2 parents 606aedc + 5cf46af commit 0e06736

File tree

8 files changed

+58
-13
lines changed

8 files changed

+58
-13
lines changed

src/app/components/Action.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ interface ActionProps {
4141
// index and delta props were removed from Action.jsx */
4242
// viewIndex and handleonkeyDown added to props
4343
const Action = (props: ActionProps): JSX.Element => {
44+
4445
const {
4546
selected, last, index, sliderIndex, dispatch, displayName, componentName,
4647
componentData, viewIndex, handleOnkeyDown,
4748
} = props;
4849

50+
// nathan test for props
51+
console.log('componentName: ', componentName);
4952
/**
5053
* @function cleanTime: Displays render times for state changes
5154
* @returns render display time in seconds in miliseconds
@@ -91,7 +94,8 @@ const Action = (props: ActionProps): JSX.Element => {
9194
tabIndex={index}
9295
>
9396
<div className="action-component-text">
94-
{`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `}
97+
{/* {`${displayName}: ${componentName !== 'nameless' ? componentName : ''} `} */}
98+
{`displayName: ${displayName}`}
9599
</div>
96100
<button
97101
className="time-button"

src/app/components/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const initialState:{port: null|number,
1212
};
1313

1414
function App(): JSX.Element {
15+
console.log("window")
1516
return (
1617
<StoreContext.Provider value={useReducer(mainReducer, initialState)}>
1718
<MainContainer />

src/app/components/BarGraphComparison.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ const BarGraphComparison = (props) => {
7474
const [maxRender, setMaxRender] = React.useState(data.maxTotalRender);
7575

7676
function titleFilter(comparisonArray) {
77+
console.log("titleFilter comparison array", comparisonArray)
7778
return comparisonArray.filter(
78-
(elem) => elem.title === tabs[currentTab].title
79+
(elem) => elem.title.split('-')[1] === tabs[currentTab].title.split('-')[1]
7980
);
8081
}
8182

@@ -165,18 +166,22 @@ const BarGraphComparison = (props) => {
165166
const classes = useStyles();
166167

167168
const handleChange = (event) => {
169+
console.log('in handlechange function')
170+
console.log('event.target.value', event.target.value)
168171
setSeries(event.target.value);
169-
setXpoints();
172+
// setXpoints();
170173
};
171174

172175
const handleClose = () => {
176+
console.log('in handleclose function')
173177
setOpen(false);
174-
setXpoints();
178+
// setXpoints();
175179
};
176180

177181
const handleOpen = () => {
182+
console.log('in handleopen function')
178183
setOpen(true);
179-
setXpoints();
184+
// setXpoints();
180185
};
181186

182187
//manually assignin X -axis points with tab ID.

src/app/components/Diff.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ function Diff(props: DiffProps) {
6161
// diff function returns a comparison of two objects, one has an updated change
6262
// just displays stateful data
6363
const delta = diff(previousDisplay, snapshot);
64+
// nathan test
65+
console.log('delta', delta);
6466
// returns html in string
6567
// just displays stateful data
6668
const html = formatters.html.format(delta, previousDisplay);

src/app/components/PerformanceVisx.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,13 @@ const allStorage = () => {
8181
const values = [];
8282
const keys = Object.keys(localStorage);
8383
let i = keys.length;
84+
console.log('allstorage keys', keys)
8485

8586
while (i--) {
8687
const series = localStorage.getItem(keys[i]);
8788
values.push(JSON.parse(series));
8889
}
90+
console.log('allstorage values', values)
8991
return values;
9092
};
9193

src/app/containers/ActionContainer.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ function ActionContainer(props) {
2020
let actionsArr = [];
2121
const hierarchyArr: any[] = [];
2222

23+
24+
2325
// function to traverse state from hiararchy and also getting information on display name and component name
2426
const displayArray = (obj: {
2527
stateSnapshot: { children: any[] };
@@ -38,7 +40,9 @@ function ActionContainer(props) {
3840
index: obj.index,
3941
displayName: `${obj.name}.${obj.branch}`,
4042
state: obj.stateSnapshot.children[0].state,
41-
componentName: obj.stateSnapshot.children[0].name,
43+
// componentName: obj.stateSnapshot.children[0].name,
44+
// nathan testing new entries for component name, original above
45+
componentName: obj.stateSnapshot,
4246
componentData:
4347
JSON.stringify(obj.stateSnapshot.children[0].componentData) === '{}'
4448
? ''
@@ -60,7 +64,7 @@ function ActionContainer(props) {
6064
// handles keyboard presses, function passes an event and index of each action-component
6165
function handleOnKeyDown(e: KeyboardEvent, i: number) {
6266
let currIndex = i;
63-
// up array key pressed
67+
// up arrow key pressed
6468
if (e.keyCode === 38) {
6569
currIndex -= 1;
6670
if (currIndex < 0) return;
@@ -109,14 +113,14 @@ function ActionContainer(props) {
109113
viewIndex={viewIndex}
110114
/>
111115
);
112-
}
116+
},
113117
);
114118
useEffect(() => {
115119
setActionView(true);
116120
}, []);
117121

118-
//the conditional logic below will cause ActionContainer.test.tsx to fail as it cannot find the Empty button
119-
//UNLESS actionView={true} is passed into <ActionContainer /> in the beforeEach() call in ActionContainer.test.tsx
122+
// the conditional logic below will cause ActionContainer.test.tsx to fail as it cannot find the Empty button
123+
// UNLESS actionView={true} is passed into <ActionContainer /> in the beforeEach() call in ActionContainer.test.tsx
120124
return (
121125
<div id='action-id' className='action-container'>
122126
<div id='arrow'>

src/backend/linkFiber.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ let recoilDomNode = {};
5252
if (window[`$recoilDebugStates`]) {
5353
isRecoil = true;
5454
}
55+
console.log('window', window);
56+
console.log('isrecoil', isRecoil)
57+
5558

5659
// This is deprecated Recoil code. Recoil as of 01-03-2021
5760
// does not work well with Reactime. Leaving any Recoil
@@ -89,6 +92,9 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
8992
if (!snap.tree) {
9093
snap.tree = new Tree('root', 'root');
9194
}
95+
// nathan test breakpoint
96+
console.log('snap: ', snap);
97+
9298
const payload = snap.tree.cleanTreeCopy();
9399
// if it's Recoil - run different actions?
94100
if (isRecoil) {
@@ -105,6 +111,7 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
105111
// the postMessage action will be received on the content script to later update the tabsObj
106112
// this will fire off everytime there is a change in test application
107113
window.postMessage(
114+
108115
{
109116
action: 'recordSnap',
110117
payload,
@@ -218,7 +225,7 @@ function createTree(
218225
tree: Tree = new Tree('root', 'root'),
219226
fromSibling = false
220227
) {
221-
console.log('currentFiber: ', currentFiber);
228+
222229
// Base case: child or sibling pointed to null
223230
if (!currentFiber) return null;
224231
if (!tree) return tree;
@@ -239,6 +246,9 @@ function createTree(
239246
treeBaseDuration,
240247
} = currentFiber;
241248

249+
// console.log('currentFiber: ', currentFiber);
250+
// console.log('tag', tag);
251+
242252
//Checks Recoil Atom and Selector Relationships
243253
if (
244254
currentFiber.memoizedState &&
@@ -498,9 +508,16 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
498508
console.log("exporting LinkFiber!")
499509
// react devtools global hook is a global object that was injected by the React Devtools content script, allows access to fiber nodes and react version
500510
const devTools = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
511+
// nathan test
512+
console.log('devTools', devTools);
501513
const reactInstance = devTools ? devTools.renderers.get(1) : null;
514+
// nathan test
515+
console.log('reactInstance', reactInstance);
502516
fiberRoot = devTools.getFiberRoots(1).values().next().value;
503-
517+
// nathan test
518+
console.log('devTools.getFiberRoots(1)', devTools.getFiberRoots(1));
519+
console.log('devTools.getFiberRoots(1).values()', devTools.getFiberRoots(1).values());
520+
console.log('fiberRoot: ', fiberRoot);
504521
const throttledUpdateSnapshot = throttle(
505522
() => updateSnapShotTree(snap, mode),
506523
70
@@ -510,6 +527,8 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
510527
if (reactInstance && reactInstance.version) {
511528
devTools.onCommitFiberRoot = (function (original) {
512529
return function (...args) {
530+
// nathan test
531+
console.log('args', args);
513532
// eslint-disable-next-line prefer-destructuring
514533
fiberRoot = args[1];
515534
if (doWork) {

src/extension/background.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const metrics = {};
1212

1313
// This function will create the first instance of the test app's tabs object
1414
// which will hold test app's snapshots, link fiber tree info, chrome tab info, etc.
15-
//console.log("hello from background.js");
15+
// console.log("hello from background.js");
1616
function createTabObj(title) {
1717
// TO-DO for save button
1818
// Save State
@@ -135,6 +135,8 @@ chrome.runtime.onConnect.addListener((port) => {
135135
port.onMessage.addListener((msg) => {
136136
// msg is action denoting a time jump in devtools
137137

138+
// nathan tests below
139+
console.log('msg: ', msg);
138140
// ---------------------------------------------------------------
139141
// message incoming from devTools should look like this:
140142
// {
@@ -195,8 +197,13 @@ chrome.runtime.onConnect.addListener((port) => {
195197
});
196198
});
197199

200+
// nathan test
201+
console.log('top level log in background.js');
198202
// background.js listening for a message from contentScript.js
199203
chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
204+
// nathan test
205+
console.log('request: ', request);
206+
console.log('sender: ', sender);
200207
// IGNORE THE AUTOMATIC MESSAGE SENT BY CHROME WHEN CONTENT SCRIPT IS FIRST LOADED
201208
if (request.type === 'SIGN_CONNECT') {
202209
return true;
@@ -437,6 +444,7 @@ chrome.runtime.onInstalled.addListener(() => {
437444
// when context menu is clicked, listen for the menuItemId,
438445
// if user clicked on reactime, open the devtools window
439446
chrome.contextMenus.onClicked.addListener(({ menuItemId }) => {
447+
console.log('this is the menuItemId: ', menuItemId);
440448
const options = {
441449
type: 'panel',
442450
left: 0,

0 commit comments

Comments
 (0)