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

Rename getXXX functions to onXXX #222

Merged
merged 1 commit into from Apr 25, 2022
Merged

Rename getXXX functions to onXXX #222

merged 1 commit into from Apr 25, 2022

Conversation

philipwalton
Copy link
Member

This PR fixes #217 by renaming all of the getXXX() functions to onXXX(). It also includes a deprecations.ts file that aliases these so existing code using the old names won't break (I plan to keep this in for at least 1 major version).

While this rename will eventually require some work for any developer upgrading, the change is negligible and I believe the new names make it much clearer that these functions:

  1. Do not return immediately, and
  2. May be invoked more than once per page

Both of these are long-standing points of developer confusion (see #217 for more details), and I think it's worth the small name change to accomodate.

@philipwalton philipwalton merged commit f7cab01 into next Apr 25, 2022
@philipwalton philipwalton deleted the rename-methods branch April 25, 2022 23:01
mgrabovsky added a commit to fedora-ci/ciboard that referenced this pull request Nov 18, 2022
The `getXXX()` functions of the `web-vitals` library were renamed in
3.0.0 to `onXXX()` [1]. Fix our calls to reflect this.

[1]: GoogleChrome/web-vitals#222
mgrabovsky added a commit to fedora-ci/ciboard that referenced this pull request Nov 18, 2022
The `getXXX()` functions of the `web-vitals` library were renamed in
3.0.0 to `onXXX()` [1]. Fix our calls to reflect this.

[1]: GoogleChrome/web-vitals#222
akunzai added a commit to akunzai/GSS.Authentication.CAS that referenced this pull request Jul 7, 2023
akunzai added a commit to akunzai/react-boilerplate that referenced this pull request Jul 7, 2023
rupesh1 added a commit to rupesh1/core-web-vitals that referenced this pull request Feb 4, 2024
- to be compatible with future versions of webvitals which will drop `get` following deprecation in GoogleChrome/web-vitals#222 (I'm not sure when this will happen but as we're loading an unversioned copy of webvitals it feels safer to do it sooner)
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.

None yet

1 participant