Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CLS reporter #10

Open
voronianski opened this issue Jun 15, 2021 · 0 comments
Open

Update CLS reporter #10

voronianski opened this issue Jun 15, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@voronianski
Copy link
Member

voronianski commented Jun 15, 2021

Summarize the feature

Recently Google CLS doc was updated with adjustment in CLS tracking - https://web.dev/cls/#measure-cls-in-javascript. We need to update our reporter too.

Basic example

Taken from the doc above -

      // If the entry occurred less than 1 second after the previous entry and
      // less than 5 seconds after the first entry in the session, include the
      // entry in the current session. Otherwise, start a new session.
      if (sessionValue &&
          entry.startTime - lastSessionEntry.startTime < 1000 &&
          entry.startTime - firstSessionEntry.startTime < 5000) {
        sessionValue += entry.value;
        sessionEntries.push(entry);
      } else {
        sessionValue = entry.value;
        sessionEntries = [entry];
      }

Motivation

Allows more precise tracking.

@voronianski voronianski changed the title Update CLS reported Update CLS reporter Jun 15, 2021
@voronianski voronianski added enhancement New feature or request good first issue Good for newcomers labels Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant