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
IndeterminateComponent,// Before we know whether it is function or class
29
+
HostRoot,// Root of a host tree. Could be nested inside another node.
30
+
HostPortal,// A subtree. Could be an entry point to a different renderer.
31
+
/**
32
+
* Host Component: a type of component that represents a native DOM element in the browser environment, such as div, span, input, h1 etc.
33
+
*/
34
+
HostComponent,// has stateNode of html elements
35
+
HostText,
36
+
Fragment,
37
+
Mode,
38
+
ContextConsumer,
39
+
ContextProvider,
40
+
ForwardRef,
41
+
Profiler,
42
+
SuspenseComponent,
43
+
MemoComponent,
44
+
SimpleMemoComponent,// A higher order component where if the component renders the same result given the same props, react skips rendering the component and uses last rendered result. Has memoizedProps/memoizedState but no stateNode
45
+
LazyComponent,
46
+
IncompleteClassComponent,
47
+
DehydratedFragment,
48
+
SuspenseListComponent,
49
+
FundamentalComponent,
50
+
ScopeComponent,
51
+
Block,
52
+
OffscreenComponent,
53
+
LegacyHiddenComponent,
54
+
}from'./types/backendTypes';
25
55
// import function that creates a tree
26
56
importTreefrom'./tree';
27
57
// passes the data down to its components
@@ -54,7 +84,7 @@ let rtid = null;
54
84
*
55
85
* Middleware: Gets a copy of the current snap.tree and posts a recordSnap message to the window
// Skip keys that are in exclude list OR if there is no value at key
205
-
if(exclude.has(key)||!newObj[key]){
237
+
// -----------------TRIMMING PASSED IN FIBER ROOT DATA--------------------------
238
+
/**
239
+
* This recursive function is used to grab the state of children components
240
+
and push them into the parent componenent react elements throw errors on client side of application - convert react/functions into string
241
+
*
242
+
* @param reactDevData - The data object obtained from React Devtool. Ex: memoizedProps, memoizedState
243
+
* @param reactimeData - The updated data object to send to front end of Reactime.
244
+
* @param depth - reactDevData is nested object. The value in reactDevData can be another object. Depth is use to keep track the depth during the unraveling of nested object
245
+
* @returns reactimeData - the updated data object to send to front end of ReactTime
// -------------------------CREATE TREE TO SEND TO FRONT END--------------------
227
279
/**
228
280
* Every time a state change is made in the accompanying app, the extension creates a Tree “snapshot” of the current state, and adds it to the current “cache” of snapshots in the extension
281
+
*
282
+
* @param currentFiber
283
+
* @param tree
284
+
* @param fromSibling
285
+
* @returns
229
286
*/
230
287
functioncreateTree(
231
288
currentFiber: Fiber,
@@ -262,10 +319,12 @@ function createTree(
262
319
elementType,
263
320
memoizedProps,
264
321
memoizedState,
322
+
dependencies,
323
+
_debugHookTypes,
265
324
});
266
325
267
-
// Tag === 5 signify this is a React Fragment. Each JSX component return a React fragment => The parent of a React Fragment could be a JSX component
268
-
if(tag===5){
326
+
// TODO: Understand this if statement
327
+
if(tag===HostComponent){
269
328
try{
270
329
// Ensure parent component has memoizedProps property
271
330
if(
@@ -302,15 +361,24 @@ function createTree(
302
361
}={};
303
362
letcomponentFound=false;
304
363
364
+
/**
365
+
* In addition to React Component JSX from user input, there are other components that user would be using under the hood without needing to see it. For example, if Redux is used, a ContextProvider, called ReactRedux.Provider is created under the hood to manage the context store.
366
+
* @variable filteredComponents is boolean value, used to filter out 'under-the-hood' components
367
+
*/
368
+
// const filteredComponents = tag != ContextProvider;
369
+
constfilteredComponents=true;
305
370
// check to see if the parent component has any state/props
0 commit comments