Skip to content

Commit 93b1c6f

Browse files
authored
ref(browser): Remove unnecessary CLS web vital check (#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 daf2133 commit 93b1c6f

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)