Skip to content

Commit

Permalink
fix(cwv): lcp and cls collection feature parity with 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ekremney committed Dec 3, 2024
1 parent 102f76d commit e80fb5b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 0 additions & 1 deletion modules/fflags.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
5 changes: 1 addition & 4 deletions modules/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check warning on line 96 in modules/index.js

View check run for this annotation

Codecov / codecov/patch

modules/index.js#L96

Added line #L96 was not covered by tests
metricFn(storeCWV, opts);
}
});
Expand Down

0 comments on commit e80fb5b

Please sign in to comment.