@@ -9,7 +9,6 @@ import { msToSec } from '../utils';
99import { getCLS , LayoutShift } from './web-vitals/getCLS' ;
1010import { getFID } from './web-vitals/getFID' ;
1111import { getLCP , LargestContentfulPaint } from './web-vitals/getLCP' ;
12- import { getUpdatedCLS } from './web-vitals/getUpdatedCLS' ;
1312import { getVisibilityWatcher } from './web-vitals/lib/getVisibilityWatcher' ;
1413import { NavigatorDeviceMemory , NavigatorNetworkInformation } from './web-vitals/types' ;
1514
@@ -22,7 +21,6 @@ export class MetricsInstrumentation {
2221 private _performanceCursor : number = 0 ;
2322 private _lcpEntry : LargestContentfulPaint | undefined ;
2423 private _clsEntry : LayoutShift | undefined ;
25- private _updatedClsEntry : LayoutShift | undefined ;
2624
2725 public constructor ( ) {
2826 if ( ! isNodeEnv ( ) && global ?. performance ) {
@@ -189,10 +187,10 @@ export class MetricsInstrumentation {
189187 } ) ;
190188 }
191189
192- // If FCP is not recorded we should not record the updated cls value
190+ // If FCP is not recorded we should not record the cls value
193191 // according to the new definition of CLS.
194192 if ( ! ( 'fcp' in this . _measurements ) ) {
195- delete this . _measurements [ 'updated- cls' ] ;
193+ delete this . _measurements . cls ;
196194 }
197195
198196 transaction . setMeasurements ( this . _measurements ) ;
@@ -229,17 +227,13 @@ export class MetricsInstrumentation {
229227 transaction . setTag ( `cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
230228 ) ;
231229 }
232-
233- if ( this . _updatedClsEntry && this . _updatedClsEntry . sources ) {
234- logger . log ( '[Measurements] Adding Updated CLS Data' ) ;
235- this . _updatedClsEntry . sources . forEach ( ( source , index ) =>
236- transaction . setTag ( `updated-cls.source.${ index + 1 } ` , htmlTreeAsString ( source . node ) ) ,
237- ) ;
238- }
239230 }
240231
241232 /** Starts tracking the Cumulative Layout Shift on the current page. */
242233 private _trackCLS ( ) : void {
234+ // See:
235+ // https://web.dev/evolving-cls/
236+ // https://web.dev/cls-web-tooling/
243237 getCLS ( metric => {
244238 const entry = metric . entries . pop ( ) ;
245239 if ( ! entry ) {
@@ -250,20 +244,6 @@ export class MetricsInstrumentation {
250244 this . _measurements [ 'cls' ] = { value : metric . value } ;
251245 this . _clsEntry = entry as LayoutShift ;
252246 } ) ;
253-
254- // See:
255- // https://web.dev/evolving-cls/
256- // https://web.dev/cls-web-tooling/
257- getUpdatedCLS ( metric => {
258- const entry = metric . entries . pop ( ) ;
259- if ( ! entry ) {
260- return ;
261- }
262-
263- logger . log ( '[Measurements] Adding Updated CLS' ) ;
264- this . _measurements [ 'updated-cls' ] = { value : metric . value } ;
265- this . _updatedClsEntry = entry as LayoutShift ;
266- } ) ;
267247 }
268248
269249 /**
0 commit comments