You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 1. Check for ReactDev installation, valid target React App
33
-
* 2. Obtain the intial ReactFiber Tree from target React App
33
+
* 2. Obtain the initial ReactFiber Tree from target React App
34
34
* 3. Send a snapshot of ReactFiber Tree to frontend/Chrome Extension
35
35
*/
36
36
linkFiber();
37
37
38
-
// -----------------SET UP EVENT LISTENER FOR TIME TRAVEL-----------------------
38
+
// --------------INITIALIZE EVENT LISTENER FOR TIME TRAVEL----------------------
39
39
/**
40
-
* On the chrome extension, if user click left/right arrow or the play button (a.k.a time travel functionality), frontend will send a message jumpToSnap with payload of the cached snapShot tree at the current step
40
+
* On the chrome extension, if user click left/right arrow or the play button (a.k.a time travel functionality), frontend will send a message `jumpToSnap` with payload of the cached snapShot tree at the current step
41
41
* 1. Set jumping mode to true => dictate we are jumping => no new snapshot will be sent to frontend
42
42
* 2. If navigate to a new route during jumping => cache timeJump in navigate.
43
-
* Otherwise, invoke timeJump to update ReactFiber tree with cached data from the snapshot payload
43
+
* 3. If not navigate during jumping => invoke timeJump to update ReactFiber tree with cached data from the snapshot payload
// 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
6
-
// getHooksNames - helper function to grab the getters/setters from `elementType`
* @constant MIN_TIME_BETWEEN_UPDATE - The minimum time (ms) between each re-render/update of the snapShot tree being displayed on the Chrome Extension.
21
18
*/
22
-
constMIN_TIME_BETWEEN_UPDATE=10;
19
+
constMIN_TIME_BETWEEN_UPDATE=70;
23
20
/**
24
21
* @function throttledUpdateSnapshot - a function that will wait for at least MIN_TIME_BETWEEN_UPDATE ms, before updating the tree snapShot being displayed on the Chrome Extension.
22
+
* @param fiberRoot - the root of ReactFiber Tree
23
+
* @param mode - mode is jumping/not jumping or navigating during jumping
24
+
* @param snapShot - the tree snapshot to send to Front End or obtained from Front End during timeJump
// 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
0 commit comments