diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md new file mode 100644 index 000000000..2163e7bd0 --- /dev/null +++ b/.changeset/tasty-mayflies-flash.md @@ -0,0 +1,11 @@ +--- +'@guardian/core-web-vitals': major +--- + +Update to use web-vitals v3.0.0. + +* Add a config object param to all metric functions ([#​225](https://togithub.com/GoogleChrome/web-vitals/pull/225)) +* Report TTFB after a bfcache restore ([#​220](https://togithub.com/GoogleChrome/web-vitals/pull/220)) +* Only include last LCP entry in metric entries ([#​218](https://togithub.com/GoogleChrome/web-vitals/pull/218)) + +The changelog for web-vitals 3.0.0 is [here](https://github.com/GoogleChrome/web-vitals/blob/HEAD/CHANGELOG.md#v300-2022-08-24) diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index 8c7c74013..8894b90bf 100644 --- a/libs/@guardian/core-web-vitals/package.json +++ b/libs/@guardian/core-web-vitals/package.json @@ -8,13 +8,13 @@ "@guardian/libs": "12.0.0", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.0.0" }, "peerDependencies": { "@guardian/libs": "^12.0.0", "tslib": "^2.4.1", "typescript": "^4.3.2", - "web-vitals": "^2.0.0" + "web-vitals": "^3.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/libs/@guardian/core-web-vitals/src/index.ts b/libs/@guardian/core-web-vitals/src/index.ts index d4c49a085..d21d41d5c 100644 --- a/libs/@guardian/core-web-vitals/src/index.ts +++ b/libs/@guardian/core-web-vitals/src/index.ts @@ -89,7 +89,7 @@ const getCoreWebVitals = async (): Promise => { const webVitals = await import('web-vitals'); const { getCLS, getFCP, getFID, getLCP, getTTFB } = webVitals; - getCLS(onReport, false); + getCLS(onReport, { reportAllChanges: false }); getFID(onReport); getLCP(onReport); getFCP(onReport); diff --git a/libs/@guardian/eslint-plugin-source-foundations/package.json b/libs/@guardian/eslint-plugin-source-foundations/package.json index 2acb0d0fa..a5e57165a 100644 --- a/libs/@guardian/eslint-plugin-source-foundations/package.json +++ b/libs/@guardian/eslint-plugin-source-foundations/package.json @@ -14,8 +14,7 @@ "@types/estree": "0.0.51", "eslint": "8.0.0", "tslib": "2.4.1", - "typescript": "4.3.2", - "web-vitals": "2.0.0" + "typescript": "4.3.2" }, "peerDependencies": { "@guardian/libs": "^12.0.0", diff --git a/libs/@guardian/eslint-plugin-source-react-components/package.json b/libs/@guardian/eslint-plugin-source-react-components/package.json index 45ed6beef..0dcc7d932 100644 --- a/libs/@guardian/eslint-plugin-source-react-components/package.json +++ b/libs/@guardian/eslint-plugin-source-react-components/package.json @@ -16,8 +16,7 @@ "eslint": "8.0.0", "react": "17.0.1", "tslib": "2.4.1", - "typescript": "4.3.2", - "web-vitals": "2.0.0" + "typescript": "4.3.2" }, "peerDependencies": { "@guardian/libs": "^12.0.0", diff --git a/libs/@guardian/source-react-components-development-kitchen/package.json b/libs/@guardian/source-react-components-development-kitchen/package.json index 38a918bf9..3bb0ea4a7 100644 --- a/libs/@guardian/source-react-components-development-kitchen/package.json +++ b/libs/@guardian/source-react-components-development-kitchen/package.json @@ -11,8 +11,7 @@ "@types/react": "17.0.1", "react": "17.0.1", "tslib": "2.4.1", - "typescript": "4.3.2", - "web-vitals": "2.0.0" + "typescript": "4.3.2" }, "peerDependencies": { "@emotion/react": "^11.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a8f773a75..31314c615 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -216,12 +216,12 @@ importers: '@guardian/libs': 12.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.0.0 devDependencies: '@guardian/libs': 12.0.0_gi2bhhty2ppzrovi5hjhpgztzq tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.0.0 libs/@guardian/eslint-config: specifiers: @@ -267,7 +267,6 @@ importers: eslint-plugin-import: 2.26.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -280,7 +279,6 @@ importers: eslint: 8.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 libs/@guardian/eslint-plugin-source-react-components: specifiers: @@ -296,7 +294,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -311,7 +308,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 libs/@guardian/libs: specifiers: @@ -403,7 +399,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 devDependencies: '@babel/core': 7.20.5 '@emotion/react': 11.0.0_6j7527pt6xlln2hks56p7acusi @@ -414,7 +409,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 libs/@guardian/tsconfig: specifiers: {} @@ -7288,6 +7282,7 @@ packages: /bindings/1.5.0: resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + requiresBuild: true dependencies: file-uri-to-path: 1.0.0 dev: true @@ -9906,6 +9901,7 @@ packages: /file-uri-to-path/1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + requiresBuild: true dev: true optional: true @@ -13396,6 +13392,7 @@ packages: /nan/2.17.0: resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} + requiresBuild: true dev: true optional: true @@ -17042,8 +17039,8 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /web-vitals/2.0.0: - resolution: {integrity: sha512-aCB1sYxt2eeBufybFRrDQNBg2cOcq2f6Q1He7T+qPHAwpodDXhAoWwBUavwppQQ4kfUcT5eIAfjPc9PdqAxPEw==} + /web-vitals/3.0.0: + resolution: {integrity: sha512-3Gh6rH5aetFYqfkl9V59KCvjj9vp9U2Tkaep9MO+xpAVg+JULmQfi5zEkcPLkE6iU8pNYVwdjHvIU8RFAchYyQ==} dev: true /webidl-conversions/3.0.1: