Skip to content

Commit 3f2828b

Browse files
(added) various console.logs, found KEY property on Fibernode, will use for connection between D3 and fiberNode
1 parent d3616b0 commit 3f2828b

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

src/app/components/ComponentMap.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,12 @@ const ComponentMap = (props: componentMapProps) => {
2525
if (viewIndex < 0) lastSnap = snapshots.length - 1;
2626
else lastSnap = viewIndex;
2727
console.log('inside ComnponentMap, snapshots:', snapshots)
28+
console.log('lastSnap:', lastSnap)
2829
//external constants
2930
const width: any = '100vw';
3031
const height: any = '100vh';
3132
let data: Object = snapshots[lastSnap];
32-
console.log('inside ComponentMap, data', data)
33+
console.log('INSIDE OF COMPONENTMAP, data:', data);
3334
useEffect(() => {
3435
document.getElementById('canvas').innerHTML = '_';
3536
setZoomState(d3.zoomTransform(d3.select('#canvas').node()));

src/app/reducers/mainReducer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable prefer-const */
33
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
44
/* eslint-disable no-param-reassign */
5-
import produce from 'immer';
5+
import {produce, original} from 'immer';
66
import * as types from '../constants/actionTypes.ts';
77

88
export default (state, action) => produce(state, draft => {
@@ -202,6 +202,7 @@ export default (state, action) => produce(state, draft => {
202202
}
203203
case types.INITIAL_CONNECT: {
204204
const { payload } = action;
205+
console.log('inside reducer INITIAL_CONNECT, payload:', payload);
205206
Object.keys(payload).forEach(tab => {
206207
// check if tab exists in memory
207208
// add new tab

src/backend/linkFiber.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ function getRecoilState(): any {
6363
function sendSnapshot(snap: Snapshot, mode: Mode): void {
6464
// Don't send messages while jumping or while paused
6565
if (mode.jumping || mode.paused) return;
66-
6766
if (!snap.tree) {
6867
snap.tree = new Tree('root', 'root');
6968
}
70-
69+
// console.log('inside of inside of linkFiber.ts, before cleanTreeCopy(), snap:', snap);
7170
const payload = snap.tree.cleanTreeCopy();
71+
// console.log('inside of linkFiber.ts, after cleanTreeCopy() payload:', payload);
7272
if (isRecoil) {
7373
getRecoilState();
7474
payload.AtomsRelationship = allAtomsRelationship;
@@ -96,6 +96,7 @@ function updateSnapShotTree(snap: Snapshot, mode: Mode): void {
9696
circularComponentTable.clear();
9797
snap.tree = createTree(current);
9898
}
99+
console.log('SNAP.TREE:', snap.tree)
99100
sendSnapshot(snap, mode);
100101
}
101102

@@ -171,7 +172,7 @@ function createTree(
171172
) {
172173
// Base case: child or sibling pointed to null
173174
// if (currentFiber.tag === 5) {
174-
// console.log(currentFiber.stateNode)
175+
// console.log(currentFiber)
175176
// }
176177

177178
if (!currentFiber) return null;
@@ -230,6 +231,7 @@ function createTree(
230231
stateNode.state,
231232
stateNode
232233
);
234+
233235
// console.log(componentData)
234236
// console.log('stateNode inside of line 232:', stateNode)
235237
newState = stateNode.state;
@@ -325,6 +327,7 @@ function createTree(
325327
let newNode = null;
326328
// We want to add this fiber node to the snapshot
327329
if (componentFound || newState === 'stateless') {
330+
console.log('INSIDE LINKFIBER, CURRENTFIBER:', currentFiber);
328331
if (fromSibling) {
329332
newNode = tree.addSibling(
330333
newState,
@@ -341,17 +344,21 @@ function createTree(
341344
} else {
342345
newNode = tree;
343346
}
344-
console.log('inside LinkFiber, circularComponentTable:', circularComponentTable);
347+
// console.log('inside LinkFiber, circularComponentTable:', circularComponentTable);
345348
// Recurse on children
346349
if (child && !circularComponentTable.has(child)) {
350+
// if (currentFiber.tag === 5) console.log('inside recursive call in linkFiber', currentFiber);
347351
// If this node had state we appended to the children array,
348352
// so attach children to the newly appended child.
349353
// Otherwise, attach children to this same node.
354+
350355
circularComponentTable.add(child);
356+
// console.log(createTree(child, newNode))
351357
createTree(child, newNode);
352358
}
353359
// Recurse on siblings
354360
if (sibling && !circularComponentTable.has(sibling)) {
361+
// if (currentFiber.tag === 5) console.log('inside recursive call in linkFiber', currentFiber);
355362
circularComponentTable.add(sibling);
356363
createTree(sibling, newNode, true);
357364
}

src/extension/background.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ chrome.runtime.onMessage.addListener((request, sender) => {
324324
default:
325325
break;
326326
}
327+
console.log('inside background.js, tabsObj:', tabsObj);
327328
return true; // attempt to fix close port error
328329
});
329330

0 commit comments

Comments
 (0)