@@ -70,17 +70,13 @@ export default (snap, mode) => {
7070 alwaysLog ( 'sendSnapshot called' ) ;
7171 // Don't send messages while jumping or while paused
7272 circularComponentTable . clear ( ) ;
73- // console.log('sending snapshot');
7473 if ( mode . jumping || mode . paused ) return ;
75- // console.log('PAYLOAD: before cleaning', snap.tree);
7674
7775 if ( ! snap . tree ) {
78- // console.log('snapshot empty, sending root');
7976 snap . tree = new Tree ( 'root' , 'root' ) ;
8077 }
8178 const payload = snap . tree . cleanTreeCopy ( ) ; // snap.tree.getCopy();
8279
83- // console.log('PAYLOAD: after cleaning', payload);
8480 // try {
8581 // await window.postMessage({
8682 window . postMessage ( {
@@ -118,7 +114,6 @@ export default (snap, mode) => {
118114 let ctRunning = 0 ;
119115 function createTree ( currentFiber , tree = new Tree ( 'root' , 'root' ) , fromSibling = false ) {
120116 // Base case: child or sibling pointed to null
121- console . log ( 'createTree: creating tree' ) ;
122117 if ( ! currentFiber ) return null ;
123118 if ( ! tree ) return tree ;
124119
@@ -145,7 +140,6 @@ export default (snap, mode) => {
145140 if ( stateNode && stateNode . state && ( tag === 0 || tag === 1 || tag === 2 ) ) { // { || tag === 2)) {
146141 // Save component's state and setState() function to our record for future
147142 // time-travel state changing. Add record index to snapshot so we can retrieve.
148- console . log ( 'createTree() found setState component' ) ;
149143 componentData . index = componentActionsRecord . saveNew ( stateNode . state , stateNode ) ;
150144 newState = stateNode . state ;
151145 componentFound = true ;
@@ -155,7 +149,6 @@ export default (snap, mode) => {
155149 let hooksIndex ;
156150 if ( memoizedState && ( tag === 0 || tag === 1 || tag === 2 || tag === 10 ) ) {
157151 if ( memoizedState . queue ) {
158- console . log ( 'createTree() found hooks component' ) ;
159152 // Hooks states are stored as a linked list using memoizedState.next,
160153 // so we must traverse through the list and get the states.
161154 // We then store them along with the corresponding memoizedState.queue,
@@ -176,10 +169,9 @@ export default (snap, mode) => {
176169 }
177170
178171 // This grabs stateless components
179- /*
180172 if ( ! componentFound && ( tag === 0 || tag === 1 || tag === 2 ) ) {
181173 newState = 'stateless' ;
182- }*/
174+ }
183175
184176 // Adds performance metrics to the component data
185177 componentData = {
@@ -193,18 +185,15 @@ export default (snap, mode) => {
193185 let newNode = null ;
194186 if ( componentFound || newState === 'stateless' ) {
195187 if ( fromSibling ) {
196- console . log ( 'createTree(), relevant component found in sibling' ) ;
197188 newNode = tree . addSibling ( newState ,
198189 elementType ? elementType . name : 'nameless' ,
199190 componentData ) ;
200191 } else {
201- console . log ( 'createTree(), relevant component found in child' ) ;
202192 newNode = tree . addChild ( newState ,
203193 elementType ? elementType . name : 'nameless' ,
204194 componentData ) ;
205195 }
206196 } else {
207- console . log ( 'createTree(), no new relevant nodes, continuing from same node' )
208197 newNode = tree ;
209198 }
210199
@@ -214,13 +203,11 @@ export default (snap, mode) => {
214203 // If this node had state we appended to the children array,
215204 // so attach children to the newly appended child.
216205 // Otherwise, attach children to this same node.
217- console . log ( 'going into child' ) ;
218206 circularComponentTable . add ( child ) ;
219207 createTree ( child , newNode ) ;
220208 }
221209 // Recurse on siblings
222210 if ( sibling && ! circularComponentTable . has ( sibling ) ) {
223- console . log ( 'going into sibling' ) ;
224211 circularComponentTable . add ( sibling ) ;
225212 createTree ( sibling , newNode , true ) ;
226213 }
@@ -233,21 +220,17 @@ export default (snap, mode) => {
233220 console . log ( 'found circular sibling, exiting tree loop' ) ;
234221 }
235222
236- // // console.log('linkFiber.js: processed children and sibling, returning tree');
237223 return tree ;
238224 }
239225
240226 let updateSnapshotTreeCount = 0 ;
241227 function updateSnapShotTree ( ) {
242- // console.log('updateSnapshotTree(), checking if fiberRoot updated');
243228
244229 updateSnapshotTreeCount ++ ;
245230 if ( updateSnapshotTreeCount > 1 ) alwaysLog ( 'MULTIPLE SNAPSHOT TREE UPDATES:' , updateSnapshotTreeCount ) ;
246231 if ( fiberRoot ) {
247- console . log ( 'updateSnapshotTree(), updating snapshot' , snap . tree ) ;
248232 const { current } = fiberRoot ;
249233 snap . tree = createTree ( current ) ;
250- console . log ( 'updateSnapshotTree(), completed snapshot' , snap . tree ) ;
251234 }
252235 updateSnapshotTreeCount -- ;
253236 }
@@ -274,11 +257,8 @@ export default (snap, mode) => {
274257 devTools . onCommitFiberRoot = ( function ( original ) {
275258 return function ( ...args ) {
276259 fiberRoot = args [ 1 ] ;
277- //console.log('Fiber committed, updating snapshot tree with:', fiberRoot);
278260 updateSnapShotTree ( ) ;
279- console . log ( 'Fiber committed, sending latest snapshot' ) ;
280261 sendSnapshot ( ) ;
281- console . log ( 'Fiber committed, latest snapshot sent' ) ;
282262 return original ( ...args ) ;
283263 } ;
284264 } ( devTools . onCommitFiberRoot ) ) ;
0 commit comments