Skip to content

Bump web-vitals version#1412

Merged
Jethro Nederhof (jethron) merged 1 commit intosnowplow:release/4.3.2from
jethron:feat/web-vitals-bump
Mar 10, 2025
Merged

Bump web-vitals version#1412
Jethro Nederhof (jethron) merged 1 commit intosnowplow:release/4.3.2from
jethron:feat/web-vitals-bump

Conversation

@jethron
Copy link
Copy Markdown
Contributor

@jethron Jethro Nederhof (jethron) commented Mar 6, 2025

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, 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 I 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). Users in this situation can set webVitalsSource manually to continue loading v3 until they can support v4.

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.

v4 removes the IIFE-version of the library's global var type definitions (webVitals: WebVitalsGlobal), so we now declare it ourselves.

Closes #1411

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
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, but will defer to Peter Perlepes (@igneel64) as he is the expert here.

Also please run rush change.

@jethron Jethro Nederhof (jethron) merged commit 9853660 into snowplow:release/4.3.2 Mar 10, 2025
1 check failed
Greg Leonard (greg-el) pushed a commit that referenced this pull request Mar 20, 2025
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 #1411
@tunetheweb
Copy link
Copy Markdown

Thank you so much for this! Let us know if you run into any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants