From 21ab3223a2682c90ec9943c5b251030ff21557a1 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 15 Dec 2022 14:50:00 +0000 Subject: [PATCH 01/14] Update dependency web-vitals to v3 --- libs/@guardian/core-web-vitals/package.json | 4 ++-- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- pnpm-lock.yaml | 20 +++++++++++-------- 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index 04cd0a6dd..a9749714c 100644 --- a/libs/@guardian/core-web-vitals/package.json +++ b/libs/@guardian/core-web-vitals/package.json @@ -8,13 +8,13 @@ "@guardian/libs": "10.0.0", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.0" }, "peerDependencies": { "@guardian/libs": "^10.0.0", "tslib": "^2.4.1", "typescript": "^4.3.2", - "web-vitals": "^2.0.0" + "web-vitals": "^2.0.0 || ^3.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/libs/@guardian/eslint-plugin-source-foundations/package.json b/libs/@guardian/eslint-plugin-source-foundations/package.json index be2caa139..6d6f1a8d2 100644 --- a/libs/@guardian/eslint-plugin-source-foundations/package.json +++ b/libs/@guardian/eslint-plugin-source-foundations/package.json @@ -15,7 +15,7 @@ "eslint": "8.0.0", "tslib": "2.4.0", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.0" }, "peerDependencies": { "@guardian/libs": "^9.0.0 || ^10.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 6c7b7b440..b5fdfdc65 100644 --- a/libs/@guardian/eslint-plugin-source-react-components/package.json +++ b/libs/@guardian/eslint-plugin-source-react-components/package.json @@ -17,7 +17,7 @@ "react": "17.0.1", "tslib": "2.4.0", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.0" }, "peerDependencies": { "@guardian/libs": "^9.0.0 || ^10.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 b2003c59b..c46e9cc1b 100644 --- a/libs/@guardian/source-react-components-development-kitchen/package.json +++ b/libs/@guardian/source-react-components-development-kitchen/package.json @@ -12,7 +12,7 @@ "react": "17.0.1", "tslib": "2.4.0", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.0" }, "peerDependencies": { "@emotion/react": "^11.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 52d442170..b0c3437c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -125,12 +125,12 @@ importers: '@guardian/libs': 10.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 devDependencies: '@guardian/libs': 10.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 libs/@guardian/eslint-config: specifiers: @@ -176,7 +176,7 @@ importers: eslint-plugin-import: 2.26.0 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 dependencies: '@typescript-eslint/eslint-plugin': 5.45.0_vnkj7iz2gqaw3majdcouuifx4q '@typescript-eslint/parser': 5.45.0_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -189,7 +189,7 @@ importers: eslint: 8.0.0 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 libs/@guardian/eslint-plugin-source-react-components: specifiers: @@ -205,7 +205,7 @@ importers: react: 17.0.1 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 dependencies: '@typescript-eslint/eslint-plugin': 5.45.0_vnkj7iz2gqaw3majdcouuifx4q '@typescript-eslint/parser': 5.45.0_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -220,7 +220,7 @@ importers: react: 17.0.1 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 libs/@guardian/libs: specifiers: @@ -308,7 +308,7 @@ importers: react: 17.0.1 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 devDependencies: '@babel/core': 7.20.5 '@emotion/react': 11.0.0_6j7527pt6xlln2hks56p7acusi @@ -319,7 +319,7 @@ importers: react: 17.0.1 tslib: 2.4.0 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.0 libs/@guardian/tsconfig: specifiers: {} @@ -16340,6 +16340,10 @@ packages: resolution: {integrity: sha512-aCB1sYxt2eeBufybFRrDQNBg2cOcq2f6Q1He7T+qPHAwpodDXhAoWwBUavwppQQ4kfUcT5eIAfjPc9PdqAxPEw==} dev: true + /web-vitals/3.1.0: + resolution: {integrity: sha512-zCeQ+bOjWjJbXv5ZL0r8Py3XP2doCQMZXNKlBGfUjPAVZWokApdeF/kFlK1peuKlCt8sL9TFkKzyXE9/cmNJQA==} + dev: true + /webidl-conversions/3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true From 57adc74fa47376d426e4e4bb58334d23e53c552a Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:10:40 +0000 Subject: [PATCH 02/14] Update dependency web-vitals to v3 --- libs/@guardian/core-web-vitals/package.json | 4 ++-- .../package.json | 2 +- .../package.json | 2 +- .../package.json | 2 +- pnpm-lock.yaml | 23 +++++++++++-------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index 8c7c74013..0337dd36e 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.1.1" }, "peerDependencies": { "@guardian/libs": "^12.0.0", "tslib": "^2.4.1", "typescript": "^4.3.2", - "web-vitals": "^2.0.0" + "web-vitals": "^2.0.0 || ^3.0.0" }, "peerDependenciesMeta": { "typescript": { diff --git a/libs/@guardian/eslint-plugin-source-foundations/package.json b/libs/@guardian/eslint-plugin-source-foundations/package.json index 2acb0d0fa..5fe606b70 100644 --- a/libs/@guardian/eslint-plugin-source-foundations/package.json +++ b/libs/@guardian/eslint-plugin-source-foundations/package.json @@ -15,7 +15,7 @@ "eslint": "8.0.0", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.1" }, "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..b73227658 100644 --- a/libs/@guardian/eslint-plugin-source-react-components/package.json +++ b/libs/@guardian/eslint-plugin-source-react-components/package.json @@ -17,7 +17,7 @@ "react": "17.0.1", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.1" }, "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 1fbd3c79f..4607eedb8 100644 --- a/libs/@guardian/source-react-components-development-kitchen/package.json +++ b/libs/@guardian/source-react-components-development-kitchen/package.json @@ -12,7 +12,7 @@ "react": "17.0.1", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "2.0.0" + "web-vitals": "3.1.1" }, "peerDependencies": { "@emotion/react": "^11.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e6b31f994..0f94e2bfc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,12 +210,12 @@ importers: '@guardian/libs': 12.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 devDependencies: '@guardian/libs': 12.0.0_gi2bhhty2ppzrovi5hjhpgztzq tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 libs/@guardian/eslint-config: specifiers: @@ -261,7 +261,7 @@ importers: eslint-plugin-import: 2.26.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -274,7 +274,7 @@ importers: eslint: 8.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 libs/@guardian/eslint-plugin-source-react-components: specifiers: @@ -290,7 +290,7 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -305,7 +305,7 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 libs/@guardian/libs: specifiers: @@ -397,7 +397,7 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 devDependencies: '@babel/core': 7.20.5 '@emotion/react': 11.0.0_6j7527pt6xlln2hks56p7acusi @@ -408,7 +408,7 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 2.0.0 + web-vitals: 3.1.1 libs/@guardian/tsconfig: specifiers: {} @@ -7254,6 +7254,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 @@ -9826,6 +9827,7 @@ packages: /file-uri-to-path/1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + requiresBuild: true dev: true optional: true @@ -13327,6 +13329,7 @@ packages: /nan/2.17.0: resolution: {integrity: sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==} + requiresBuild: true dev: true optional: true @@ -16984,8 +16987,8 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /web-vitals/2.0.0: - resolution: {integrity: sha512-aCB1sYxt2eeBufybFRrDQNBg2cOcq2f6Q1He7T+qPHAwpodDXhAoWwBUavwppQQ4kfUcT5eIAfjPc9PdqAxPEw==} + /web-vitals/3.1.1: + resolution: {integrity: sha512-qvllU+ZeQChqzBhZ1oyXmWsjJ8a2jHYpH8AMaVuf29yscOPZfTQTjQFRX6+eADTdsDE8IanOZ0cetweHMs8/2A==} dev: true /webidl-conversions/3.0.1: From e8e67ff9a10dd860b29afc0d6a82c5702aae1e5b Mon Sep 17 00:00:00 2001 From: Joe Cowton Date: Thu, 2 Feb 2023 09:15:59 +0000 Subject: [PATCH 03/14] Add report config object --- libs/@guardian/core-web-vitals/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From 33692245dfc721c11af0128063610dbbe95efbb2 Mon Sep 17 00:00:00 2001 From: Joe Cowton Date: Thu, 2 Feb 2023 09:25:26 +0000 Subject: [PATCH 04/14] add changeset --- .changeset/tasty-mayflies-flash.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tasty-mayflies-flash.md diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md new file mode 100644 index 000000000..2e8ef87d3 --- /dev/null +++ b/.changeset/tasty-mayflies-flash.md @@ -0,0 +1,5 @@ +--- +'@guardian/core-web-vitals': major +--- + +Update to use web-vitals v3 From 7cf6de52c9300c2e9d3445c47efd5aa037d197ee Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:50:58 +0000 Subject: [PATCH 05/14] Update libs/@guardian/core-web-vitals/package.json --- libs/@guardian/core-web-vitals/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index 0337dd36e..b700f4128 100644 --- a/libs/@guardian/core-web-vitals/package.json +++ b/libs/@guardian/core-web-vitals/package.json @@ -14,7 +14,7 @@ "@guardian/libs": "^12.0.0", "tslib": "^2.4.1", "typescript": "^4.3.2", - "web-vitals": "^2.0.0 || ^3.0.0" + "web-vitals": "^3.0.0" }, "peerDependenciesMeta": { "typescript": { From 6b6c72d099a3ba0f604f9574e3fe2d3d1926ef6f Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 09:58:08 +0000 Subject: [PATCH 06/14] Update libs/@guardian/core-web-vitals/package.json Co-authored-by: Alex Sanders --- libs/@guardian/core-web-vitals/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/@guardian/core-web-vitals/package.json b/libs/@guardian/core-web-vitals/package.json index b700f4128..8894b90bf 100644 --- a/libs/@guardian/core-web-vitals/package.json +++ b/libs/@guardian/core-web-vitals/package.json @@ -8,7 +8,7 @@ "@guardian/libs": "12.0.0", "tslib": "2.4.1", "typescript": "4.3.2", - "web-vitals": "3.1.1" + "web-vitals": "3.0.0" }, "peerDependencies": { "@guardian/libs": "^12.0.0", From 8a7ffa66f8211380d87454e85fbda5d8f2668281 Mon Sep 17 00:00:00 2001 From: Joe Cowton Date: Thu, 2 Feb 2023 10:00:52 +0000 Subject: [PATCH 07/14] remove cwv from source packages --- libs/@guardian/eslint-plugin-source-foundations/package.json | 3 +-- .../eslint-plugin-source-react-components/package.json | 3 +-- .../source-react-components-development-kitchen/package.json | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/@guardian/eslint-plugin-source-foundations/package.json b/libs/@guardian/eslint-plugin-source-foundations/package.json index 5fe606b70..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": "3.1.1" + "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 b73227658..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": "3.1.1" + "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 4607eedb8..9975a4566 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": "3.1.1" + "typescript": "4.3.2" }, "peerDependencies": { "@emotion/react": "^11.0.0", From 5af5ba4fa7ac6ee02eff90f45610b139d2a85750 Mon Sep 17 00:00:00 2001 From: Joe Cowton Date: Thu, 2 Feb 2023 10:06:18 +0000 Subject: [PATCH 08/14] Update pnpm.lock --- pnpm-lock.yaml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0f94e2bfc..88c5f5ec0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,12 +210,12 @@ importers: '@guardian/libs': 12.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 + web-vitals: 3.0.0 devDependencies: '@guardian/libs': 12.0.0_gi2bhhty2ppzrovi5hjhpgztzq tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 + web-vitals: 3.0.0 libs/@guardian/eslint-config: specifiers: @@ -261,7 +261,6 @@ importers: eslint-plugin-import: 2.26.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -274,7 +273,6 @@ importers: eslint: 8.0.0 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 libs/@guardian/eslint-plugin-source-react-components: specifiers: @@ -290,7 +288,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 dependencies: '@typescript-eslint/eslint-plugin': 5.46.1_d743tgwdclnksgoxgljshoql5y '@typescript-eslint/parser': 5.46.1_mg2zsw3hlxbb4bt7pdw7kbeopm @@ -305,7 +302,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 libs/@guardian/libs: specifiers: @@ -397,7 +393,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 devDependencies: '@babel/core': 7.20.5 '@emotion/react': 11.0.0_6j7527pt6xlln2hks56p7acusi @@ -408,7 +403,6 @@ importers: react: 17.0.1 tslib: 2.4.1 typescript: 4.3.2 - web-vitals: 3.1.1 libs/@guardian/tsconfig: specifiers: {} @@ -16987,8 +16981,8 @@ packages: resolution: {integrity: sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==} dev: true - /web-vitals/3.1.1: - resolution: {integrity: sha512-qvllU+ZeQChqzBhZ1oyXmWsjJ8a2jHYpH8AMaVuf29yscOPZfTQTjQFRX6+eADTdsDE8IanOZ0cetweHMs8/2A==} + /web-vitals/3.0.0: + resolution: {integrity: sha512-3Gh6rH5aetFYqfkl9V59KCvjj9vp9U2Tkaep9MO+xpAVg+JULmQfi5zEkcPLkE6iU8pNYVwdjHvIU8RFAchYyQ==} dev: true /webidl-conversions/3.0.1: From 18d30d633cce18b5faa03660bcc1e70b345e962a Mon Sep 17 00:00:00 2001 From: Max Duval Date: Thu, 2 Feb 2023 10:25:47 +0000 Subject: [PATCH 09/14] Use `onXXX` method names from `web-vitals` (#397) --- libs/@guardian/core-web-vitals/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/@guardian/core-web-vitals/src/index.ts b/libs/@guardian/core-web-vitals/src/index.ts index d21d41d5c..f7bfb22ce 100644 --- a/libs/@guardian/core-web-vitals/src/index.ts +++ b/libs/@guardian/core-web-vitals/src/index.ts @@ -87,13 +87,13 @@ const listener = (e: Event): void => { const getCoreWebVitals = async (): Promise => { const webVitals = await import('web-vitals'); - const { getCLS, getFCP, getFID, getLCP, getTTFB } = webVitals; + const { onCLS, onFCP, onFID, onLCP, onTTFB } = webVitals; - getCLS(onReport, { reportAllChanges: false }); - getFID(onReport); - getLCP(onReport); - getFCP(onReport); - getTTFB(onReport); + onCLS(onReport, { reportAllChanges: false }); + onFID(onReport); + onLCP(onReport); + onFCP(onReport); + onTTFB(onReport); // Report all available metrics when the page is unloaded or in background. addEventListener('visibilitychange', listener); From ebd7e17cf164c9f3fbbe6127e294227e868a9bf5 Mon Sep 17 00:00:00 2001 From: Joe Cowton Date: Thu, 2 Feb 2023 10:32:19 +0000 Subject: [PATCH 10/14] Revert method names --- libs/@guardian/core-web-vitals/src/index.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libs/@guardian/core-web-vitals/src/index.ts b/libs/@guardian/core-web-vitals/src/index.ts index f7bfb22ce..d21d41d5c 100644 --- a/libs/@guardian/core-web-vitals/src/index.ts +++ b/libs/@guardian/core-web-vitals/src/index.ts @@ -87,13 +87,13 @@ const listener = (e: Event): void => { const getCoreWebVitals = async (): Promise => { const webVitals = await import('web-vitals'); - const { onCLS, onFCP, onFID, onLCP, onTTFB } = webVitals; + const { getCLS, getFCP, getFID, getLCP, getTTFB } = webVitals; - onCLS(onReport, { reportAllChanges: false }); - onFID(onReport); - onLCP(onReport); - onFCP(onReport); - onTTFB(onReport); + getCLS(onReport, { reportAllChanges: false }); + getFID(onReport); + getLCP(onReport); + getFCP(onReport); + getTTFB(onReport); // Report all available metrics when the page is unloaded or in background. addEventListener('visibilitychange', listener); From 6b2280ad09fc638d817f13bbed380615bd82b914 Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 13:56:18 +0000 Subject: [PATCH 11/14] Update .changeset/tasty-mayflies-flash.md --- .changeset/tasty-mayflies-flash.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md index 2e8ef87d3..14647da14 100644 --- a/.changeset/tasty-mayflies-flash.md +++ b/.changeset/tasty-mayflies-flash.md @@ -2,4 +2,6 @@ '@guardian/core-web-vitals': major --- -Update to use web-vitals v3 +Update to use web-vitals v3.0.0 + +The changelog for web-vitals 3.0.0 is here: https://github.com/GoogleChrome/web-vitals/blob/HEAD/CHANGELOG.md#v300-2022-08-24 From 879e13824b33694bbd86dff445c2511a4043b137 Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 13:57:27 +0000 Subject: [PATCH 12/14] Update tasty-mayflies-flash.md --- .changeset/tasty-mayflies-flash.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md index 14647da14..7d44ae7ff 100644 --- a/.changeset/tasty-mayflies-flash.md +++ b/.changeset/tasty-mayflies-flash.md @@ -2,6 +2,10 @@ '@guardian/core-web-vitals': major --- -Update to use web-vitals v3.0.0 +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 From c0a1c78b01ae9fc3c55a78205febf8ee578d841a Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 13:58:15 +0000 Subject: [PATCH 13/14] Update tasty-mayflies-flash.md --- .changeset/tasty-mayflies-flash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md index 7d44ae7ff..d42db3ddb 100644 --- a/.changeset/tasty-mayflies-flash.md +++ b/.changeset/tasty-mayflies-flash.md @@ -8,4 +8,4 @@ Update to use web-vitals v3.0.0. * 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 +The changelog for web-vitals 3.0.0 is ([here](https://github.com/GoogleChrome/web-vitals/blob/HEAD/CHANGELOG.md#v300-2022-08-24)) From a897bfc72f5953da853d528ab30f7e135301834b Mon Sep 17 00:00:00 2001 From: Joe Cowton <77005274+joecowton1@users.noreply.github.com> Date: Thu, 2 Feb 2023 13:58:38 +0000 Subject: [PATCH 14/14] Update tasty-mayflies-flash.md --- .changeset/tasty-mayflies-flash.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/tasty-mayflies-flash.md b/.changeset/tasty-mayflies-flash.md index d42db3ddb..2163e7bd0 100644 --- a/.changeset/tasty-mayflies-flash.md +++ b/.changeset/tasty-mayflies-flash.md @@ -8,4 +8,4 @@ Update to use web-vitals v3.0.0. * 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)) +The changelog for web-vitals 3.0.0 is [here](https://github.com/GoogleChrome/web-vitals/blob/HEAD/CHANGELOG.md#v300-2022-08-24)