@paulirish/trace_engine 0.0.1 → 0.0.2

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.
@@ -0,0 +1,6 @@
1
+
2
+
3
+ publish with
4
+
5
+
6
+ npm publish --access public --dry-run
package/README.md CHANGED
@@ -2,6 +2,21 @@
2
2
 
3
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.
4
4
 
5
+ ## API quickstart
6
+
7
+ ```js
8
+ loadBrowserPolyfills();
9
+ const TraceModel = await import('@paulirish/trace_engine');
10
+ const processor = TraceModel.Processor.TraceProcessor.createWithAllHandlers();
11
+
12
+ await processor.parse(traceEvents);
13
+ console.log(processor.data)
14
+ ```
15
+
16
+ **Note:** in reality to run in Node, you'll need to polyfill `window.location`, `window.navigator`, and `window.DOMRect`. 😜
17
+
18
+ See the included `analyze-trace.mjs` a runnable invocation and quick polyfills.
19
+
5
20
  ## High level architecture
6
21
 
7
22
  ```
package/analyze-trace.mjs CHANGED
@@ -10,7 +10,7 @@ import zlib from 'zlib';
10
10
 
11
11
  loadBrowserPolyfills(); // Must precede the import (for `location` and `navigator`)
12
12
 
13
- export const TraceModel = await import('././trace.mjs');
13
+ export const TraceModel = await import('./trace.mjs');
14
14
 
15
15
  // If run as CLI, parse the argv trace (or a fallback)
16
16
  if (import.meta.url.endsWith(process.argv[1])) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paulirish/trace_engine",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "",
5
5
  "main": "trace.mjs",
6
6
  "scripts": {
@@ -10,8 +10,7 @@
10
10
  "keywords": [],
11
11
  "author": "",
12
12
  "license": "BSD-3-Clause",
13
- "dependencies": {
14
- },
13
+ "dependencies": {},
15
14
  "devDependencies": {
16
15
  "zlib": "*"
17
16
  }
package/PAUL.readme.md DELETED
File without changes