Add and export resetCLS to reset CLS metric - #778
Conversation
Adds and exports resetINP to reset INP metric
Export resetINP from attribution build
Mirrors resetINP: dispatches a reset-web-vitals-cls event that re-initializes the CLS metric (and session window state) while keeping existing callbacks, so consumers can report CLS in fixed intervals. Bumps version to 3.5.2-descript.3. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Apologies — opened against upstream by mistake; this is intended for Descript's fork. |
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Interesting! Have you considered the soft nav support added in v6? Though that would be Chromium-only whereas INP is available in Safari and Firefox so the manual reset would alow them to be supported for INP (they don't support CLS). |
|
Oh, TIL. But no, I don't think soft navs are sufficient for our use case, because the URL isn't changing. In our case, we are tracking these metrics for each 5 minute segment of an hours-long audio/video editing session. |
|
Oh gotcha. Yeah that is a different use case. |
Mirrors the resetINP change (#1, #2) for CLS: dispatching a
reset-web-vitals-clsevent re-initializes the CLS metric and its session-window state while keeping existing callbacks, so consumers can report CLS in fixed intervals (Descript reports the worst session burst per 5-minute window, like INP).Exported from both the standard and attribution builds, and bumps the version to
3.5.2-descript.3.Includes an e2e test mirroring 'resets INP metric'; I authored it to match the existing suite but have not run the test suite locally. After merge this needs an npm publish of
3.5.2-descript.3so the monorepo can pick it up (BIX-8613).🤖 Generated with Claude Code