core: update cumulative-layout-shift#12554
Merged
Merged
Conversation
adamraine
reviewed
May 25, 2021
Comment on lines
+118
to
+120
| // The original Cumulative Layout Shift metric, the sum of main-frame shift events from the entire trace. | ||
| const oldCumulativeLayoutShift = mainFrameShiftEvents | ||
| .reduce((sum, e) => sum += e.weightedScore, 0); |
Contributor
There was a problem hiding this comment.
calculateOldCumulativeLayoutShift?
Contributor
Author
There was a problem hiding this comment.
ah yeah, thanks
Contributor
Author
ok, we're going with |
connorjclark
approved these changes
May 25, 2021
adamraine
approved these changes
May 25, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12350, part of #11866
As discussed in that issue, CLS is being switched to the
max-session-gap1s-limit5svariant with LayoutShift events from the whole frame tree ("all frames") to align with the broader web-vitals CLS change.The new version will result in unchanging or better CLS values for all users by design, but since Lighthouse currently only measures CLS during page load, most users won't see much meaningful change in their CLS (we currently estimate that about 5% of sites will go from a poor to average rating, and about 3% of sites will move from average to passing).
This PR touches a lot of files, but the primary change is moving the winning variant in
layout-shift-variantsto thecumulative-layout-shiftcomputed artifact (with much oflayout-shift-variants-testmaking a similar journey) and then updating a ton of test expectations.The computed artifact also exposes a
cumulativeLayoutShiftMainFramefor a only-main-frame version of the metric, and an(edit: we went witholdCumulativeLayoutShifttotalCumulativeLayoutShift) which is the original CLS for developers who still want to track it.I can't remember what we finally decided to call that and #12350 isn't clear, so that'll be the first thing we can fix in review :)