Skip to content

Commit c25a7a8

Browse files
hoverFeature comments and console.log testing
1 parent 2f5c1f2 commit c25a7a8

File tree

7 files changed

+24
-3
lines changed

7 files changed

+24
-3
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,11 @@ const ComponentMap = (props: componentMapProps) => {
145145

146146
//TODO -> Alter incoming snapshots so there is useful data to show on hover.
147147
nodeEnter.on('mouseover', function (d: any, i: number): any {
148-
148+
console.log('mousing over')
149149
d3.select(this)
150150
.append('text')
151151
.text(() => {
152+
//i want to return to the node in d3 the values listed in a more readable way. Right now it's just a horizontal line of text
152153
return JSON.stringify(d.data.state);
153154
})
154155
.attr('x', -25)
@@ -158,6 +159,8 @@ const ComponentMap = (props: componentMapProps) => {
158159
.attr('stroke', 'white')
159160
.attr('stroke-width', .5)
160161
.attr('id', `popup${i}`);
162+
163+
161164

162165
});
163166
nodeEnter.on('mouseout', function (d: any, i: number): any {

src/app/components/StateRoute.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import Tree from './Tree';
1515
import ComponentMap from './ComponentMap';
1616
import PerfView from './PerfView';
1717
import AtomsRelationship from './AtomsRelationship.jsx';
18+
import { Console } from 'console';
1819

1920
const History = require('./History').default;
2021

@@ -53,6 +54,7 @@ const StateRoute = (props: StateRouteProps) => {
5354

5455
// Map
5556
const renderComponentMap = () => {
57+
console.log('inside renderComponenetMap, inside State.Route.tsx')
5658
if (hierarchy) {
5759
return (
5860
<ComponentMap

src/app/containers/MainContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const mixpanel = require("mixpanel").init("12fa2800ccbf44a5c36c37bc9776e4c0", {
2323
function MainContainer(): any {
2424
const [store, dispatch] = useStoreContext();
2525
const { tabs, currentTab, port: currentPort } = store;
26-
26+
console.log('inside MainContainer');
2727
// add event listeners to background script
2828
useEffect(() => {
2929
// only open port once

src/backend/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,13 @@ function getRouteURL(node: SnapshotNode): string {
4545
// * Event listener for time-travel actions
4646
window.addEventListener('message', ({ data: { action, payload } }: MsgData) => {
4747
switch (action) {
48+
49+
4850
case 'jumpToSnap':
51+
// console.log('action:', action);
52+
// console.log('payload', payload);
53+
// console.log('payload.name:', payload.name)
54+
// console.log(test)
4955
timeJump(payload, true); // * This sets state with given payload
5056
// Get the pathname from payload and add new entry to browser history
5157
// MORE: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState

src/backend/linkFiber.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ function createTree(
170170
fromSibling = false
171171
) {
172172
// Base case: child or sibling pointed to null
173+
if (currentFiber.tag === 5) {
174+
console.log(currentFiber.stateNode)
175+
}
173176
if (!currentFiber) return null;
174177
if (!tree) return tree;
175178

@@ -226,6 +229,8 @@ function createTree(
226229
stateNode.state,
227230
stateNode
228231
);
232+
console.log(componentData)
233+
// console.log('stateNode inside of line 232:', stateNode)
229234
newState = stateNode.state;
230235
componentFound = true;
231236
}
@@ -342,6 +347,7 @@ function createTree(
342347
// so attach children to the newly appended child.
343348
// Otherwise, attach children to this same node.
344349
circularComponentTable.add(child);
350+
// console.log(createTree(child, newNode))
345351
createTree(child, newNode);
346352
}
347353
// Recurse on siblings
@@ -369,7 +375,7 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
369375
const devTools = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
370376
const reactInstance = devTools ? devTools.renderers.get(1) : null;
371377
fiberRoot = devTools.getFiberRoots(1).values().next().value;
372-
378+
console.log(fiberRoot);
373379
const throttledUpdateSnapshot = throttle(() => updateSnapShotTree(snap, mode), 70);
374380
document.addEventListener('visibilitychange', onVisibilityChange);
375381
if (reactInstance && reactInstance.version) {

src/backend/masterState.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ let index = 0;
1616

1717
export default {
1818
saveNew: (state, component): number => {
19+
console.log('this is creating our snapshots of state, INSIDE MASTERSTATE, COMPONENTACTIONS RECORD:', componentActionsRecord)
1920
componentActionsRecord[index] = { state, component };
2021
index++;
2122
return index - 1;

src/backend/timeJump.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Console } from 'console';
12
/* eslint-disable @typescript-eslint/no-unused-vars */
23
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
34
/* eslint-disable max-len */
@@ -25,12 +26,14 @@ export default (origin, mode) => {
2526
// Recursively change state of tree
2627
// Set the state of the origin tree if the component is stateful
2728
function jump(target, firstCall = false) {
29+
// console.log('INSIDE JUMP FUNCTION, TARGET', target)
2830
if (!target) return;
2931

3032
if (target.state === 'stateless') {
3133
target.children.forEach(child => jump(child));
3234
return;
3335
}
36+
console.log('COMPONENT ACTION RECORD:', circularComponentTable)
3437
const component = componentActionsRecord.getComponentByIndex(
3538
target.componentData.index,
3639
);

0 commit comments

Comments
 (0)