-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core(responsiveness): use raw trace event #13970
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -1020,6 +1020,23 @@ export interface TraceEvent { | |||||||
}; | ||||||||
} | ||||||||
|
||||||||
declare module Trace { | ||||||||
/** | ||||||||
* Base event of a `ph: 'X'` 'complete' event. Extend with `name` and `args` as | ||||||||
* needed. | ||||||||
*/ | ||||||||
interface CompleteEvent { | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. kind of harkens back to your trace types, @connorjclark :) I kind of like this pattern of building up the event type compared to the lighthouse/lighthouse-core/lib/tracehouse/trace-processor.js Lines 21 to 23 in 0fcf4a7
(where you still have some random optional properties from the |
||||||||
ph: 'X'; | ||||||||
cat: string; | ||||||||
pid: number; | ||||||||
tid: number; | ||||||||
dur: number; | ||||||||
ts: number; | ||||||||
tdur: number; | ||||||||
tts: number; | ||||||||
} | ||||||||
} | ||||||||
|
||||||||
/** | ||||||||
* A record of DevTools Debugging Protocol events. | ||||||||
*/ | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: did you consider defining this in
.d.ts
(for ergonomic reasons)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe if it spreads, but so far it's really just needed in this one file and the two files that call it are fine with the implicit type from the function return.
There's also the multi-line jsdoc format, it's just unfortunate that vscode doesn't do better syntax highlighting for it (probably should file that as an issue at some point).