@@ -52,10 +52,25 @@ let rtid = null;
52
52
let recoilDomNode = { } ;
53
53
54
54
// Simple check for whether our target app uses Recoil
55
- if ( window [ `$recoilDebugStates` ] ) {
55
+ if ( window [ '$recoilDebugStates' ] ) {
56
+ console . log ( 'this is a recoil app!' ) ;
56
57
isRecoil = true ;
57
58
}
58
59
60
+ // function getRecoilState(): any {
61
+ // const RecoilSnapshotsLength = window[`$recoilDebugStates`].length;
62
+ // const lastRecoilSnapshot =
63
+ // window[`$recoilDebugStates`][RecoilSnapshotsLength - 1];
64
+ // const nodeToNodeSubs = lastRecoilSnapshot.nodeToNodeSubscriptions;
65
+ // const nodeToNodeSubsKeys = lastRecoilSnapshot.nodeToNodeSubscriptions.keys();
66
+ // nodeToNodeSubsKeys.forEach((node) => {
67
+ // nodeToNodeSubs
68
+ // .get(node)
69
+ // .forEach((nodeSubs) =>
70
+ // allAtomsRelationship.push([node, nodeSubs, 'atoms and selectors'])
71
+ // );
72
+ // });
73
+ // }
59
74
60
75
/**
61
76
* @method sendSnapshot
@@ -75,6 +90,7 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
75
90
const payload = snap . tree . cleanTreeCopy ( ) ;
76
91
// if it's Recoil - run different actions?
77
92
if ( isRecoil ) {
93
+ // getRecoilState()
78
94
payload . atomsComponents = atomsComponents ;
79
95
payload . atomSelectors = atomsSelectors ;
80
96
payload . recoilDomNode = recoilDomNode
@@ -101,8 +117,8 @@ function sendSnapshot(snap: Snapshot, mode: Mode): void {
101
117
function updateSnapShotTree ( snap : Snapshot , mode : Mode ) : void {
102
118
// this is the currently active root fiber(the mutable root of the tree)
103
119
let fiberRootCurrent = fiberRoot . current ;
104
- console . log ( "fiber root props: " , Object . entries ( fiberRootCurrent ) ) ;
105
- console . log ( "fiberroot sibling:" , fiberRootCurrent . sibling , "fiberroot stateNode:" , fiberRootCurrent . stateNode , "fiberroot child:" , fiberRootCurrent . child , "fiberroot memoizedState:" , fiberRootCurrent . memoizedState , "fiberroot memoizedProps:" , fiberRootCurrent . memoizedProps , "fiberRootCurrent.elementType:" , fiberRootCurrent . elementType , "fiberRootCurrent.tag: " , fiberRootCurrent . tag , "fiberRootCurrent.actualDuration: " , fiberRootCurrent . actualDuration , "fiberRootCurrent.actualStartTime: " , fiberRootCurrent . actualStartTime , "fiberRootCurrent.selfBaseDuration: " , fiberRootCurrent . selfBaseDuration , "fiberRootCurrent.treeBaseDuration:" , fiberRootCurrent . treeBaseDuration ) ;
120
+ // console.log("fiber root props: ", Object.entries(fiberRootCurrent));
121
+ // console.log("fiberroot sibling:", fiberRootCurrent.sibling, "fiberroot stateNode:", fiberRootCurrent.stateNode, "fiberroot child:", fiberRootCurrent.child, "fiberroot memoizedState:", fiberRootCurrent.memoizedState, "fiberroot memoizedProps:", fiberRootCurrent.memoizedProps, "fiberRootCurrent.elementType:",fiberRootCurrent.elementType, "fiberRootCurrent.tag: ", fiberRootCurrent.tag, "fiberRootCurrent.actualDuration: ", fiberRootCurrent.actualDuration, "fiberRootCurrent.actualStartTime: ", fiberRootCurrent.actualStartTime, "fiberRootCurrent.selfBaseDuration: ", fiberRootCurrent.selfBaseDuration, "fiberRootCurrent.treeBaseDuration:", fiberRootCurrent.treeBaseDuration);
106
122
107
123
if ( fiberRoot ) {
108
124
const { current } = fiberRoot ;
@@ -486,14 +502,14 @@ export default (snap: Snapshot, mode: Mode): (() => void) => {
486
502
const devTools = window . __REACT_DEVTOOLS_GLOBAL_HOOK__ ;
487
503
const reactInstance = devTools ? devTools . renderers . get ( 1 ) : null ;
488
504
fiberRoot = devTools . getFiberRoots ( 1 ) . values ( ) . next ( ) . value ;
489
- console . log ( "fiberRoot in export default: " + Object . entries ( fiberRoot ) ) ;
505
+ // console.log("fiberRoot in export default: " + Object.entries(fiberRoot));
490
506
const throttledUpdateSnapshot = throttle ( ( ) => updateSnapShotTree ( snap , mode ) , 70 ) ;
491
507
document . addEventListener ( 'visibilitychange' , onVisibilityChange ) ;
492
508
493
509
if ( reactInstance && reactInstance . version ) {
494
510
devTools . onCommitFiberRoot = ( function ( original ) {
495
511
return function ( ...args ) {
496
- console . log ( "args in onCommitFiberRoot: " , args )
512
+ // console.log("args in onCommitFiberRoot: ", args)
497
513
// eslint-disable-next-line prefer-destructuring
498
514
fiberRoot = args [ 1 ] ;
499
515
if ( doWork ) {
0 commit comments