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

Remove the isFinal flag from the Metric interface #86

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

philipwalton
Copy link
Member

This PR fixes #82 by removing the isFinal flag from the Metric interface.

The primary implication of this change is now when calling any of the metric functions with the reportAllChanges argument set to true, the callback will only be invoked if the metric value changes—i.e. the callback won't be invoked when the page is backgrounded or unloading, nor (in the case of getLCP()) will the callback be invoked after user input.

Prior to this change a callback could be invoked without its value changing, but the isFinal flag would flip from false to true.

cc: @addyosmani as this will affect the Web Vitals Extension.

@philipwalton philipwalton merged commit 6bef716 into v1 Nov 10, 2020
@philipwalton philipwalton deleted the remove-is-final branch November 10, 2020 07:57
@rviscomi
Copy link
Member

rviscomi commented Nov 10, 2020

Is this a breaking change, and if so are you planning to release it with a new major version number? (assume so, given the v1 branch, but just confirming)

@philipwalton
Copy link
Member Author

Yeah, this is a breaking change. Sorry if it's not clear from this PR, but the linked issue is part of the v1 milestone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants