@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.
Files changed (2) hide show
  1. package/README.md +15 -5
  2. 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 folder contains the new trace engine that was first implemented for the Performance Insights panel and is now being repurposed as the primary trace engine that we use within DevTools.
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 processor = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
14
+ const engine = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
12
15
 
13
- await processor.parse(traceEvents);
14
- console.log(processor.data)
16
+ await engine.parse(traceEvents);
17
+ console.log(engine.data) // TraceParseData
15
18
  ```
16
19
 
17
- **Note:** in reality to run in Node, you'll need to polyfill `window.DOMRect`. 😜
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paulirish/trace_engine",
3
- "version": "0.0.16",
3
+ "version": "0.0.17",
4
4
  "description": "",
5
5
  "main": "models/trace/trace.js",
6
6
  "scripts": {