-
Notifications
You must be signed in to change notification settings - Fork 898
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
Fireperf web vitals #8644
base: main
Are you sure you want to change the base?
Fireperf web vitals #8644
Conversation
bryanatkinson
commented
Nov 18, 2024
- Add support for capturing web vitals metrics in Firebase performance for Web (Largest Contentful Paint, Interaction to Next Paint, Cumulative Layout Shift)
- Modifies export to use sendBeacon instead of fetch API, and shifts the upload time to the first time the page is hidden or unloaded.
|
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (123,441 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
…for Web. Modifies export to use sendBeacon instead of fetch API, and shifts the upload time to the first time the page is hidden or unloaded.
…load now, so no need to add additional timeouts.
fe72ce1
to
4b4d9ad
Compare
… often updates the values at unload time, and os queuing this until the end means those latest values get captured.
let getEntriesByTypeStub: SinonStub<[EntryType], PerformanceEntry[]>; | ||
let setupObserverStub: SinonStub< | ||
[EntryType, (entry: PerformanceEntry) => void], | ||
void | ||
>; | ||
let createOobTraceStub: SinonStub< | ||
let createOobTraceStub: SinonSpy< |
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: createOobTraceStub -> createOobTraceSpy
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.
Done
method: 'POST', | ||
body: JSON.stringify(data) | ||
}); | ||
return navigator.sendBeacon(flTransportFullUrl, JSON.stringify(data)); |
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.
We should have a fall back to fetch if sendBeacon fails (eg. payload is > then the ~64KB limit)
(navigator.sendBeacon && navigator.sendBeacon(flTransportFullUrl, JSON.stringify(data))) ||
fetch(flTransportFullUrl, {
method: 'POST',
body: JSON.stringify(data),
keepalive: true
}
);
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.
Done