-
Notifications
You must be signed in to change notification settings - Fork 142
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
✨ Discard long FCP and LCP #1045
Conversation
bd90dc2
to
dd79696
Compare
dd79696
to
f9ef3d1
Compare
Codecov Report
@@ Coverage Diff @@
## main #1045 +/- ##
=======================================
Coverage 89.01% 89.02%
=======================================
Files 87 87
Lines 4134 4135 +1
Branches 950 952 +2
=======================================
+ Hits 3680 3681 +1
Misses 454 454
Continue to review full report at Codecov.
|
@@ -136,6 +136,16 @@ describe('trackFirstContentfulPaint', () => { | |||
lifeCycle.notify(LifeCycleEventType.PERFORMANCE_ENTRY_COLLECTED, FAKE_PAINT_ENTRY) | |||
expect(fcpCallback).not.toHaveBeenCalled() | |||
}) | |||
|
|||
it('should not be present if it happens after 10 minutes', () => { |
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.
why?
it could be more interesting to indicate what we are trying to achieve, meaning discarding timings reported after a long time.
@@ -76,7 +77,8 @@ export function trackFirstContentfulPaint(lifeCycle: LifeCycle, callback: (fcp: | |||
if ( | |||
entry.entryType === 'paint' && | |||
entry.name === 'first-contentful-paint' && | |||
entry.startTime < firstHidden.timeStamp | |||
entry.startTime < firstHidden.timeStamp && | |||
entry.startTime < 10 * ONE_MINUTE |
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 extract this constant, explain its purpose and how it was chosen
Motivation
LCP and FCP reported after 10 minutes are meaningless therefore we discard them
Changes
Discard LCP and FCP reported after 10 min
Testing
Unit, Locally
I have gone over the contributing documentation.