@paulirish/trace_engine 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# Trace Model (NOT FOR PUBLIC CONSUMPTION)
|
|
2
2
|
|
|
3
|
-
This
|
|
3
|
+
This package contains the trace engine implementation used by the DevTools Performance Panel.
|
|
4
|
+
|
|
5
|
+
⚠️ The API is not stable and it's fairly likely that upgrades will break you (at some point).
|
|
6
|
+
But the breakages should be obvious exceptions or type failures.
|
|
4
7
|
|
|
5
8
|
## API quickstart
|
|
6
9
|
|
|
@@ -8,16 +11,23 @@ This folder contains the new trace engine that was first implemented for the Per
|
|
|
8
11
|
import * as TraceModel from '@paulirish/trace_engine';
|
|
9
12
|
|
|
10
13
|
polyfillDOMRect();
|
|
11
|
-
const
|
|
14
|
+
const engine = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
|
|
12
15
|
|
|
13
|
-
await
|
|
14
|
-
console.log(
|
|
16
|
+
await engine.parse(traceEvents);
|
|
17
|
+
console.log(engine.data) // TraceParseData
|
|
15
18
|
```
|
|
16
19
|
|
|
17
|
-
**Note:**
|
|
20
|
+
**Note:** To run in Node, you'll need to polyfill `window.DOMRect`. 😜
|
|
18
21
|
|
|
19
22
|
See the included `analyze-trace.mjs` a runnable invocation.
|
|
20
23
|
|
|
24
|
+
### Types
|
|
25
|
+
|
|
26
|
+
You'll probably use something like…
|
|
27
|
+
|
|
28
|
+
@type {import('@paulirish/trace_engine').Types.TraceEvents.TraceEventData[]
|
|
29
|
+
@type {import('@paulirish/trace_engine').Handlers.Types.TraceParseData
|
|
30
|
+
|
|
21
31
|
## Maintainer cheatsheet
|
|
22
32
|
|
|
23
33
|
See also http://go/btlax
|