Skip to content

Commit 373af84

Browse files
committed
feat: bump webvitals to 5.0.3
1 parent 9482a02 commit 373af84

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

packages/browser-utils/src/metrics/web-vitals/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
> A modular library for measuring the [Web Vitals](https://web.dev/vitals/) metrics on real users.
44
5-
This was vendored from: https://github.com/GoogleChrome/web-vitals: v5.0.2
5+
This was vendored from: https://github.com/GoogleChrome/web-vitals: v5.0.3
66

77
The commit SHA used is:
8-
[463abbd425cda01ed65e0b5d18be9f559fe446cb](https://github.com/GoogleChrome/web-vitals/tree/463abbd425cda01ed65e0b5d18be9f559fe446cb)
8+
[e22d23b22c1440e69c5fc25a2f373b1a425cc940](https://github.com/GoogleChrome/web-vitals/tree/e22d23b22c1440e69c5fc25a2f373b1a425cc940)
99

1010
Current vendored web vitals are:
1111

packages/browser-utils/src/metrics/web-vitals/lib/whenIdleOrHidden.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ export const whenIdleOrHidden = (cb: () => void) => {
3232
} else {
3333
// eslint-disable-next-line no-param-reassign
3434
cb = runOnce(cb);
35-
rIC(cb);
35+
rIC(() => {
36+
cb();
37+
// Remove the above event listener since no longer required.
38+
// See: https://github.com/GoogleChrome/web-vitals/issues/622
39+
WINDOW.document?.removeEventListener('visibilitychange', cb);
40+
});
3641
// sentry: we use onHidden instead of directly listening to visibilitychange
3742
// because some browsers we still support (Safari <14.4) don't fully support
3843
// `visibilitychange` or have known bugs w.r.t the `visibilitychange` event.

0 commit comments

Comments
 (0)