File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
packages/tracing/src/browser Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -189,6 +189,12 @@ export class MetricsInstrumentation {
189189 } ) ;
190190 }
191191
192+ // If FCP is not recorded we should not record the updated cls value
193+ // according to the new definition of CLS.
194+ if ( ! ( 'fcp' in this . _measurements ) ) {
195+ delete this . _measurements [ 'updated-cls' ] ;
196+ }
197+
192198 transaction . setMeasurements ( this . _measurements ) ;
193199 this . _tagMetricInfo ( transaction ) ;
194200 }
@@ -245,6 +251,9 @@ export class MetricsInstrumentation {
245251 this . _clsEntry = entry as LayoutShift ;
246252 } ) ;
247253
254+ // See:
255+ // https://web.dev/evolving-cls/
256+ // https://web.dev/cls-web-tooling/
248257 getUpdatedCLS ( metric => {
249258 const entry = metric . entries . pop ( ) ;
250259 if ( ! entry ) {
Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ Current vendored web vitals are:
1212- FID (First Input Delay)
1313- CLS (Cumulative Layout Shift)
1414
15+ ## Notable Changes from web-vitals library
16+
17+ This vendored web-vitals library is meant to be used in conjugtion with the ` @sentry/tracing ` ` BrowserTracing ` integration.
18+ As such, logic around ` BFCache ` and multiple reports were removed from the library as our web-vitals only report once per pageload.
19+
1520## License
1621
1722[ Apache 2.0] ( https://github.com/GoogleChrome/web-vitals/blob/master/LICENSE )
You can’t perform that action at this time.
0 commit comments