7
* @flow
8
*/
9
10
-import type {ReactDebugInfo, ReactComponentInfo} from 'shared/ReactTypes';
10
+import type {
11
+ ReactDebugInfo,
12
+ ReactComponentInfo,
13
+ ReactStackTrace,
14
+} from 'shared/ReactTypes';
15
16
export const IO_NODE = 0;
17
export const PROMISE_NODE = 1;
26
export type IONode = {
27
tag: 0,
28
owner: null | ReactComponentInfo,
25
- stack: Error, // callsite that spawned the I/O
29
+ stack: ReactStackTrace, // callsite that spawned the I/O
30
debugInfo: null, // not used on I/O
31
start: number, // start time when the first part of the I/O sequence started
32
end: number, // we typically don't use this. only when there's no promise intermediate.
38
tag: 1,
39
owner: null | ReactComponentInfo,
40
debugInfo: null | ReactDebugInfo, // forwarded debugInfo from the Promise
37
- stack: Error, // callsite that created the Promise
41
+ stack: ReactStackTrace, // callsite that created the Promise
42
start: number, // start time when the Promise was created
43
end: number, // end time when the Promise was resolved.
44
awaited: null | AsyncSequence, // the thing that ended up resolving this promise
49
tag: 2,
50
owner: null | ReactComponentInfo,
51
debugInfo: null | ReactDebugInfo, // forwarded debugInfo from the Promise
48
- stack: Error, // callsite that awaited (using await, .then(), Promise.all(), ...)
52
+ stack: ReactStackTrace, // callsite that awaited (using await, .then(), Promise.all(), ...)
53
start: number, // when we started blocking. This might be later than the I/O started.
54
end: number, // when we unblocked. This might be later than the I/O resolved if there's CPU time.
55
awaited: null | AsyncSequence, // the promise we were waiting on
60
tag: 3,
61
owner: null | ReactComponentInfo,
62
debugInfo: WeakRef<PromiseWithDebugInfo>, // holds onto the Promise until we can extract debugInfo when it resolves
59
- stack: Error, // callsite that created the Promise
63
+ stack: ReactStackTrace, // callsite that created the Promise
64
start: number, // start time when the Promise was created
65
end: -1.1, // set when we resolve.
66
awaited: null | AsyncSequence, // the thing that ended up resolving this promise
71
tag: 4,
72
owner: null | ReactComponentInfo,
73
debugInfo: WeakRef<PromiseWithDebugInfo>, // holds onto the Promise until we can extract debugInfo when it resolves
70
- stack: Error, // callsite that awaited (using await, .then(), Promise.all(), ...)
74
+ stack: ReactStackTrace, // callsite that awaited (using await, .then(), Promise.all(), ...)
75
start: number, // when we started blocking. This might be later than the I/O started.
76
end: -1.1, // set when we resolve.
77
awaited: null | AsyncSequence, // the promise we were waiting on