-
Notifications
You must be signed in to change notification settings - Fork 222
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
Add browser-plugin-web-vitals to track Web Vitals metrics #1190
Add browser-plugin-web-vitals to track Web Vitals metrics #1190
Conversation
f61254a
to
e233ea6
Compare
BundleMonFiles added (6)
Total files change +94.92KB 0% Final result: ✅ View report in BundleMon website ➡️ |
f6285c4
to
d8957fe
Compare
* @remarks | ||
*/ | ||
export function WebVitalsPlugin(pluginOptions: WebVitalsPluginOptions = defaultPluginOptions): BrowserPlugin { | ||
const webVitalsObject: Record<string, unknown> = {}; |
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.
Should the type of this be more explicit, like at least Record<string, string | number>
?
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.
Slightly funkier, but probably not worth it:
export type WebVitalsPayload = {
navigationType: Metric["navigationType"];
} & {
[f in Lowercase<Metric["name"]>]: Metric["value"];
};
5c029d1
to
9706ad2
Compare
9706ad2
to
ea0556a
Compare
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.
Thanks! Looks better with multiple trackers now I think. Some minor quibbles but LGTM even without them.
* @remarks | ||
*/ | ||
export function WebVitalsPlugin(pluginOptions: WebVitalsPluginOptions = defaultPluginOptions): BrowserPlugin { | ||
const webVitalsObject: Record<string, unknown> = {}; |
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.
Slightly funkier, but probably not worth it:
export type WebVitalsPayload = {
navigationType: Metric["navigationType"];
} & {
[f in Lowercase<Metric["name"]>]: Metric["value"];
};
c2a527d
to
23ce30e
Compare
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.
LGTM!
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.
LGTM!
23ce30e
to
d474283
Compare
d474283
to
6aa80b8
Compare
Add a new Web Vitals plugin!
close #1189