Skip to content

Commit 6e8771f

Browse files
committed
removed console logs and unecessary comments
> > Co-authored-by: Nkmai <[email protected]> Co-authored-by: lind-tania <[email protected]> Co-authored-by: rtviner <[email protected]> Co-authored-by: caitlinchan23 <[email protected]>
1 parent 770bde9 commit 6e8771f

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

src/backend/linkFiber.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
//import typescript types
1313
import {
14-
1514
//tree
1615
Snapshot,
1716
//jump, pause
@@ -30,9 +29,7 @@ import componentActionsRecord from './masterState';
3029
// throttle returns a function that can be called any number of times (possibly in quick succession) but will only invoke the callback at most once every x ms
3130
//getHooksNames - helper function to grab the getters/setters from `elementType`
3231
import { throttle, getHooksNames } from './helpers';
33-
// import { Console } from 'console';
3432
import AtomsRelationship from '../app/components/AtomsRelationship';
35-
// import { isNull } from 'util';
3633

3734
// Set global variables to use in exported module and helper functions
3835
declare global {
@@ -116,7 +113,6 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
116113
//updating tree depending on current mode on the panel (pause, etc)
117114
function updateSnapShotTree(snap: Snapshot, mode: Mode): void {
118115
// this is the currently active root fiber(the mutable root of the tree)
119-
120116
if (fiberRoot) {
121117
const { current } = fiberRoot;
122118
//Clears circular component table
@@ -321,12 +317,10 @@ function createTree(
321317
componentData.hooksIndex = hooksIndex;
322318

323319
// Improves tree visualization but breaks jump ?
324-
// if (!newState) {
325-
326-
// }
320+
// if (!newState) {}
327321
// newState.push(state.state);
328322

329-
/* what is this supposed to do??? currently doesn't work?? and makes no sense, newState is an object, how can you push state.state into an object?? */
323+
/* what is this supposed to do? currently doesn't work? and makes no sense, newState is an object, how can you push state.state into an object? */
330324
// if (newState && newState.hooksState) {
331325
// newState.push(state.state);
332326
// } else if (newState) {
@@ -395,7 +389,7 @@ function createTree(
395389

396390
// We want to add this fiber node to the snapshot
397391
if (componentFound || newState === 'stateless') {
398-
// where does this get changed to true?
392+
399393
if (isRecoil) {
400394
// do this down below too
401395
if(currentFiber.elementType.name){
@@ -490,24 +484,19 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
490484
function onVisibilityChange(): void {
491485
doWork = !document.hidden;
492486
}
493-
// this code hasnt changed since reactime 4.0
494-
// https://medium.com/@aquinojardim/react-fiber-reactime-4-0-f200f02e7fa8
495487
return () => {
496488
// 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
497489
const devTools = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;
498490
const reactInstance = devTools ? devTools.renderers.get(1) : null;
499491
fiberRoot = devTools.getFiberRoots(1).values().next().value;
500-
// console.log("fiberRoot in export default: " + Object.entries(fiberRoot));
492+
501493
const throttledUpdateSnapshot = throttle(() => updateSnapShotTree(snap, mode), 70);
502494
document.addEventListener('visibilitychange', onVisibilityChange);
503495

504496
if (reactInstance && reactInstance.version) {
505-
// when is this being called...
506497
devTools.onCommitFiberRoot = (function (original) {
507498
return function (...args) {
508-
// console.log("args in onCommitFiberRoot: ", args)
509499
// eslint-disable-next-line prefer-destructuring
510-
511500
fiberRoot = args[1];
512501
if (doWork) {
513502
throttledUpdateSnapshot();

src/backend/timeJump.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,13 @@ export default (origin, mode) => {
3737
// check if it is a stateful class component
3838
// if yes, find the component by its index and assign it to a variable
3939
// call that components setState method to reset state to the state at the time of the jump snapshot
40-
// if (target.state && !target.state.hooksState)
4140
if (component && component.setState) {
4241
component.setState(
4342
prevState => {
44-
// console.log("prevState: ", prevState);
4543
Object.keys(prevState).forEach(key => {
46-
// console.log("target state object at key: ", target.state[key])
47-
// what is this edge case??
4844
if (!target.state[key] === undefined) {
4945
target.state[key] = undefined;
5046
}
51-
// does this do the same?
52-
// if (!target.state[key]) {
53-
// target.state[key];
54-
// }
5547
});
5648
return target.state;
5749
},
@@ -63,13 +55,11 @@ export default (origin, mode) => {
6355
// Check for hooks state and set it with dispatch()
6456
if (target.state && target.state.hooksState) {
6557
target.state.hooksState.forEach(hook => {
66-
// console.log("hook: ", hook);
6758
const hooksComponent = componentActionsRecord.getComponentByIndex(
6859
target.componentData.hooksIndex,
6960
);
70-
// console.log("hooksComponent: ", hooksComponent);
7161
const hookState = Object.values(hook);
72-
// console.log("hookstate in hooks if block: ", hookState);
62+
7363
if (hooksComponent && hooksComponent.dispatch) {
7464
hooksComponent.dispatch(hookState[0]);
7565
}

src/backend/tree.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class Tree {
6464
}
6565

6666
addChild(state: string | {}, name: string, componentData: {}, rtid: any, recoilDomNode:any): Tree {
67-
//console.log("arguments in addChild: "+ arguments.length)
6867
const newChild: Tree = new Tree(state, name, componentData, rtid, recoilDomNode);
6968
newChild.parent = this;
7069
this.children.push(newChild);

0 commit comments

Comments
 (0)