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
// getStateAndContextData, //COMMENT OUT SINCE EXTRACTING CONTEXT IS STILL IN EXPERIMENT
21
-
filterAndFormatData,
22
-
}from'./statePropExtractors';
23
19
import{
24
20
nextJSDefaultComponent,
25
21
remixDefaultComponents,
@@ -54,7 +50,6 @@ export default function createTree(currentFiberNode: Fiber): Tree {
54
50
sibling,
55
51
stateNode,
56
52
child,
57
-
// with memoizedState we can grab the root type and construct an Abstract Syntax Tree from the hooks structure using Acorn in order to extract the hook getters and match them with their corresponding setters in an object
58
53
memoizedState,
59
54
memoizedProps,
60
55
elementType,
@@ -63,33 +58,17 @@ export default function createTree(currentFiberNode: Fiber): Tree {
63
58
actualStartTime,
64
59
selfBaseDuration,
65
60
treeBaseDuration,
66
-
_debugHookTypes,
61
+
// _debugHookTypes, //COMMENT OUT SINCE EXTRACTING CONTEXT IS STILL IN EXPERIMENT
@@ -193,13 +172,11 @@ export default function createTree(currentFiberNode: Fiber): Tree {
193
172
// If user use setState to define/manage state, the state object will be stored in stateNode.state => grab the state object stored in the stateNode.state
194
173
// Example: for tic-tac-toe demo-app: Board is a stateful component that use setState to store state data.
// Save component's state and setState() function to our record for future
197
-
// time-travel state changing. Add record index to snapshot so we can retrieve.
175
+
// Save component's state and setState() function to our record for future time-travel state changing. Add record index to snapshot so we can retrieve.
* @member actualDuration - The time taken to render the current Fiber node and its descendants during the previous render cycle. This value is used to optimize the rendering of components and to provide performance metrics to developers.
143
145
* @member actualStartTime - The time at which the rendering of the current Fiber node started during the previous render cycle.
144
146
* @member child - Pointer to the first child.
145
-
* @member dependencies - An array of values (such as state or props) that the current Fiber node depends on. This is used to determine whether the node needs to be re-rendered.
146
-
* @member elementType - The type of the current Fiber node's element (e.g. the component function or class, or the DOM element type). Example: div, h1,
147
-
* @member index - Index of the current Fiber node. Ex: if a div has 3 headings. The first child is heading with index = 0. The next sibling is a heading with index = 1 & the last sibling is a heading with index = 2.
148
-
* @member key - Unique identifier of this child, used to identify the node when rendering lists of components.
147
+
* @member elementType - The type of the current Fiber node's element (e.g. the component function or class, or the DOM element type). For class/functional component, elmementType stores the function definition.
149
148
* @member memoizedProps - The current props of the component associated with the current Fiber node.
150
149
* @member memoizedState - The current state of the component associated with the current Fiber node.
151
150
* @member selfBaseDuration - The base duration of the current Fiber node's render phase (excluding the time taken to render its children). This field is only set when the enableProfilerTimer flag is enabled.
152
151
* @member sibling - Pointer to next sibling
153
-
* @member stateNode - The local state associated with this fiber.
152
+
* @member stateNode - The local state associated with this fiber. For classComponent, stateNode contains current state and the bound update methods of the component
154
153
* @member tag - The type of the current Fiber node, such as FunctionComponent, ClassComponent, or HostComponent (for DOM elements).
155
154
* @member treeBaseDuration - The total base duration of the current Fiber node's subtree. This field is only set when the enableProfilerTimer flag is enabled.
156
-
* @member type - Same as elementType.
157
155
* @member _debugHookTypes - An array of hooks used for debugging purposes.
158
156
*/
159
157
exporttypeFiber={
160
-
// Tag identifying the type of fiber.
161
-
tag: WorkTag;
162
-
163
-
// Unique identifier of this child.
164
-
// key: null | string;
165
-
166
-
// The value of element.type which is used to preserve the identity during
167
-
// reconciliation of this child.
168
-
elementType: any;
169
-
170
-
// The resolved function/class/ associated with this fiber.
171
-
// type: any;
172
-
173
-
// The local state associated with this fiber.
174
-
stateNode: any;
175
-
176
-
// Conceptual aliases
177
-
// parent : Instance -> return The parent happens to be the same as the
178
-
// return fiber since we've merged the fiber and instance.
179
-
180
-
// Remaining fields belong to Fiber
158
+
/**
159
+
* Time spent rendering this Fiber and its descendants for the current update.
160
+
*
161
+
* This tells us how well the tree makes use of sCU for memoization. It is reset to 0 each time we render and only updated when we don't bailout.
162
+
*
163
+
* This field is only set when the enableProfilerTimer flag is enabled.
164
+
*/
165
+
actualDuration?: number;
181
166
182
-
// The Fiber to return to after finishing processing this one.
183
-
// This is effectively the parent, but there can be multiple parents (two)
184
-
// so this is only the parent of the thing we're currently processing.
185
-
// It is conceptually the same as the return address of a stack frame.
186
-
// return: Fiber | null,
167
+
/**
168
+
* If the Fiber is currently active in the "render" phase, this marks the time at which the work began.
169
+
*
170
+
* This field is only set when the enableProfilerTimer flag is enabled.
171
+
*/
172
+
actualStartTime?: number;
187
173
188
174
// Singly Linked List Tree Structure.
175
+
/** Pointer to the first child. */
189
176
child: Fiber|null;
190
-
sibling: Fiber|null;
191
-
// index: number;
192
177
193
-
// Input is the data coming into process this fiber. Arguments. Props.
194
-
// pendingProps: any, // This type will be more specific once we overload the tag.
195
-
// memoizedProps: any, // The props used to create the output.
178
+
/**
179
+
* The type of the current Fiber node's element (e.g. the component function or class, or the DOM element type).
180
+
*
181
+
* For class/functional component, elmementType stores the function definition.
182
+
*/
183
+
elementType: any;
196
184
197
-
// The state used to create the output
185
+
/** The current props of the component associated with the current Fiber node. */
198
186
memoizedState: any;
199
187
188
+
/** The current state of the component associated with the current Fiber node. */
200
189
memoizedProps: any;
201
190
202
-
// Singly linked list fast path to the next fiber with side-effects.
203
-
// nextEffect: Fiber | null,
204
-
205
-
// This is a pooled version of a Fiber. Every fiber that gets updated will
206
-
// eventually have a pair. There are cases when we can clean up pairs to save
207
-
// memory if we need to.
208
-
// alternate: Fiber | null,
191
+
/**
192
+
* Duration of the most recent render time for this Fiber. This value is not updated when we bailout for memoization purposes.
193
+
*
194
+
* This field is only set when the enableProfilerTimer flag is enabled.
195
+
*/
196
+
selfBaseDuration?: number;
209
197
210
-
// Time spent rendering this Fiber and its descendants for the current update.
211
-
// This tells us how well the tree makes use of sCU for memoization.
212
-
// It is reset to 0 each time we render and only updated when we don't bailout.
213
-
// This field is only set when the enableProfilerTimer flag is enabled.
214
-
actualDuration?: number;
198
+
// Singly Linked List Tree Structure.
199
+
/** Pointer to next sibling */
200
+
sibling: Fiber|null;
215
201
216
-
// If the Fiber is currently active in the "render" phase,
217
-
// This marks the time at which the work began.
218
-
// This field is only set when the enableProfilerTimer flag is enabled.
219
-
actualStartTime?: number;
202
+
/**
203
+
* The local state associated with this fiber.
204
+
*
205
+
* For classComponent, stateNode contains current state and the bound update methods of the component.
206
+
*/
207
+
stateNode: any;
220
208
221
-
// Duration of the most recent render time for this Fiber.
222
-
// This value is not updated when we bailout for memoization purposes.
223
-
// This field is only set when the enableProfilerTimer flag is enabled.
224
-
selfBaseDuration?: number;
209
+
/** The type of the current Fiber node, such as FunctionComponent, ClassComponent, or HostComponent (for DOM elements). */
210
+
tag: WorkTag;
225
211
226
-
// Sum of base times for all descendants of this Fiber.
227
-
// This value bubbles up during the "complete" phase.
228
-
// This field is only set when the enableProfilerTimer flag is enabled.
212
+
/**
213
+
* Sum of base times for all descendants of this Fiber. This value bubbles up during the "complete" phase.
214
+
*
215
+
* This field is only set when the enableProfilerTimer flag is enabled.
216
+
*/
229
217
treeBaseDuration?: number;
230
218
231
-
// dependencies: any;
232
-
219
+
/** An array of hooks used for debugging purposes. */
0 commit comments