-
Notifications
You must be signed in to change notification settings - Fork 224
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
Upgrade web-vitals to v4 #1411
Comments
Hi Barry - thanks for filing this issue! Is there a rough timeline on when v5 might be available (I can see there was an RC last year)? If so we might wait for v5 to become available and then update the plugin, though it looks like upgrading to 4.2.4 also wouldn't be too difficult. @matus-tomlein @igneel64 @jethron for visibility. |
At the moment we only use the types exported from this library; for any actual functional changes, users should already be able to switch to v4 using the v5 will break for us however since we assume all those metrics are available and if So probably need to:
We already capture INP and it's included in the schema so no changes there, and FID is already an optional field. This can probably fit in the next minor release. Thanks for reporting! |
Yeah it's taken a little longer than we hoped. I think it's still a little way off and we'll want to do another release candidate and let people try that out. It also has it's own breaking changes (including a move to modern JavaScript that might require extra testing from users of the librarly like yourselves), so my recommendation would be to upgrade to v4 now, and then I can ping you later about v5 when I think it's ready.
That sounds good to me! Though I'm not sure you can make One other thing is that we've deprecated export function webVitalsListener(webVitalsObject: Record<string, unknown>) {
- function addWebVitalsMeasurement(metricSchemaName: string): ReportCallback {
+ function addWebVitalsMeasurement(metricSchemaName: string): (metric: MetricType) => void { |
From ~3 to ~4. Also make the metric interfaces optional in preparation for v5, which will remove the (deprecated in v4) `onFID` method. The FID metric is already optional in the [schema](https://iglucentral.com/?q=web_vitals), so there should be no breaking change here when this metric becomes unavailable. We assume if the user is using the library themselves they would be manually loading it and telling us not to via: - `loadVitalsScript: false` - `webVitalsSource` override So we don't consider this a breaking change unless a user is relying on us to load v3 and with this update we start loading v4 (which has some [breaking changes](https://github.com/GoogleChrome/web-vitals/blob/main/docs/upgrading-to-v4.md)). Users in this situation can set `webVitalsSource` to continue loading v3. When v5 is released, users can opt-in to using it by specifying a v5 source for `webVitalsSource`, which should work as expected with these changes until we update the plugin's default source to be v5. Closes snowplow#1411
Is your feature request related to a problem? Please describe.
The version of web-vitals used by this library (3.3.2) is quite old (May 2023) and unsupported. The latest version is 4.2.4 and we're even working on a v5.
v4 includes a number of improvements, particular for INP tracking.
Describe the solution you'd like
It might be a good idea to upgrade to v4.2.4 now to get the latest, and minimise issues when upgrading to v5 later.
FID has also been deprecated and replaced by INP (already being tracked). So might be good idea to remove that since it it's deprecated in v4 and removed in v5.
Describe alternatives you've considered
Leave as is, or wait for v5. Or upgraxde to v4, but still collect FID for now.
Additional context
I'm the maintainer of web-vitals so happy to answer any questions you might have!
I'm also happy to add a PR for this as looks fairly simple. However, there are some breaking changes in v4, which may affect users of this so not sure what the best way is of communicating this (of it it needs to wait for a major upgrade of Snowplow?)
The text was updated successfully, but these errors were encountered: