-
Notifications
You must be signed in to change notification settings - Fork 900
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.
🦋 Changeset detectedLatest commit: 22a8ae5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1Affected Products
Test Logs |
fe72ce1
to
4b4d9ad
Compare
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
…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.
… often updates the values at unload time, and os queuing this until the end means those latest values get captured.
8ca7c35
to
721fcbf
Compare
Changeset File Check ✅
|