Skip to content

Commit 2f069f5

Browse files
authored
ref(v9/browser): Remove unnecessary CLS web vital check (#17096)
Backport of #17090: Just a minor cleanup from a TODO I left a while ago. We can safely remove this check because CLS isn't reported before FCP is reported.
1 parent f402dd2 commit 2f069f5

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/browser-utils/src/metrics/browserMetrics.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,10 +430,8 @@ export function addPerformanceEntries(span: Span, options: AddPerformanceEntries
430430
delete _measurements['mark.fid'];
431431
}
432432

433-
// If FCP is not recorded we should not record the cls value
434-
// according to the new definition of CLS.
435-
// TODO: Check if the first condition is still necessary: `onCLS` already only fires once `onFCP` was called.
436-
if (!('fcp' in _measurements) || !options.recordClsOnPageloadSpan) {
433+
// If CLS standalone spans are enabled, don't record CLS as a measurement
434+
if (!options.recordClsOnPageloadSpan) {
437435
delete _measurements.cls;
438436
}
439437

0 commit comments

Comments
 (0)