From e80fb5b94ef3ae78c07feaea36803d613d2c6429 Mon Sep 17 00:00:00 2001 From: ekremney Date: Tue, 3 Dec 2024 10:26:39 +0100 Subject: [PATCH] fix(cwv): lcp and cls collection feature parity with 1.x --- modules/fflags.js | 1 - modules/index.js | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/modules/fflags.js b/modules/fflags.js index 1dfa36d..a236add 100644 --- a/modules/fflags.js +++ b/modules/fflags.js @@ -17,7 +17,6 @@ export const fflags = { enabled: (flag, callback) => fflags.has(flag) && callback(), /* c8 ignore next */ disabled: (flag, callback) => !fflags.has(flag) && callback(), - eagercwv: [683], redirect: [620, 1139], example: [543, 770, 1136], language: [543, 959, 1139, 620], diff --git a/modules/index.js b/modules/index.js index 09735e9..307d278 100644 --- a/modules/index.js +++ b/modules/index.js @@ -93,10 +93,7 @@ function addCWVTracking() { ['FID', 'INP', 'TTFB', 'CLS', 'LCP'].forEach((metric) => { const metricFn = window.webVitals[`on${metric}`]; if (typeof metricFn === 'function') { - let opts = {}; - fflags.enabled('eagercwv', () => { - opts = { reportAllChanges: isEager(metric) }; - }); + const opts = isEager(metric) ? { reportAllChanges: true } : undefined; metricFn(storeCWV, opts); } });