Skip to content

Commit

Permalink
Readme fixes for INP (#379)
Browse files Browse the repository at this point in the history
* Clarify INP callbacks on README

* Add CLS back in
  • Loading branch information
tunetheweb authored Sep 7, 2023
1 parent a948d3c commit 27db8a0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,12 @@ Note that some of these metrics will not report until the user has interacted wi

Also, in some cases a metric callback may never be called:

- FID is not reported if the user never interacts with the page.
- FID and INP are not reported if the user never interacts with the page.
- CLS, FCP, FID, and LCP are not reported if the page was loaded in the background.

In other cases, a metric callback may be called more than once:

- CLS should be reported any time the [page's `visibilityState` changes to hidden](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden).
- CLS and INP should be reported any time the [page's `visibilityState` changes to hidden](https://developer.chrome.com/blog/page-lifecycle-api/#advice-hidden).
- All metrics are reported again (with the above exceptions) after a page is restored from the [back/forward cache](https://web.dev/bfcache/).

_**Warning:** do not call any of the Web Vitals functions (e.g. `onCLS()`, `onFID()`, `onLCP()`) more than once per page load. Each of these functions creates a `PerformanceObserver` instance and registers event listeners for the lifetime of the page. While the overhead of calling these functions once is negligible, calling them repeatedly on the same page may eventually result in a memory leak._
Expand Down

0 comments on commit 27db8a0

Please sign in to comment.