From bae027375a23caad688354748b247c64cf8a635d Mon Sep 17 00:00:00 2001 From: Paul Richardson Date: Thu, 3 Oct 2024 11:04:27 +0100 Subject: [PATCH] fix: Upgrade api of web-vitals to reflect to version of 4.2.3 --- .../kubernetes-api-app/src/reportWebVitals.ts | 16 ++++++++-------- .../management-api-app/src/reportWebVitals.ts | 16 ++++++++-------- packages/oauth-app/src/reportWebVitals.ts | 16 ++++++++-------- packages/online-shell/src/reportWebVitals.ts | 16 ++++++++-------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/kubernetes-api-app/src/reportWebVitals.ts b/packages/kubernetes-api-app/src/reportWebVitals.ts index d90fcb0e..240a8e65 100644 --- a/packages/kubernetes-api-app/src/reportWebVitals.ts +++ b/packages/kubernetes-api-app/src/reportWebVitals.ts @@ -1,13 +1,13 @@ -import { ReportHandler } from 'web-vitals' +import { MetricType } from 'web-vitals' -export const reportWebVitals = (onPerfEntry?: ReportHandler) => { +export const reportWebVitals = (onPerfEntry?: (metric: MetricType) => void) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry) - getFID(onPerfEntry) - getFCP(onPerfEntry) - getLCP(onPerfEntry) - getTTFB(onPerfEntry) + import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry) + onFID(onPerfEntry) + onFCP(onPerfEntry) + onLCP(onPerfEntry) + onTTFB(onPerfEntry) }) } } diff --git a/packages/management-api-app/src/reportWebVitals.ts b/packages/management-api-app/src/reportWebVitals.ts index d90fcb0e..240a8e65 100644 --- a/packages/management-api-app/src/reportWebVitals.ts +++ b/packages/management-api-app/src/reportWebVitals.ts @@ -1,13 +1,13 @@ -import { ReportHandler } from 'web-vitals' +import { MetricType } from 'web-vitals' -export const reportWebVitals = (onPerfEntry?: ReportHandler) => { +export const reportWebVitals = (onPerfEntry?: (metric: MetricType) => void) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry) - getFID(onPerfEntry) - getFCP(onPerfEntry) - getLCP(onPerfEntry) - getTTFB(onPerfEntry) + import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry) + onFID(onPerfEntry) + onFCP(onPerfEntry) + onLCP(onPerfEntry) + onTTFB(onPerfEntry) }) } } diff --git a/packages/oauth-app/src/reportWebVitals.ts b/packages/oauth-app/src/reportWebVitals.ts index d90fcb0e..240a8e65 100644 --- a/packages/oauth-app/src/reportWebVitals.ts +++ b/packages/oauth-app/src/reportWebVitals.ts @@ -1,13 +1,13 @@ -import { ReportHandler } from 'web-vitals' +import { MetricType } from 'web-vitals' -export const reportWebVitals = (onPerfEntry?: ReportHandler) => { +export const reportWebVitals = (onPerfEntry?: (metric: MetricType) => void) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry) - getFID(onPerfEntry) - getFCP(onPerfEntry) - getLCP(onPerfEntry) - getTTFB(onPerfEntry) + import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry) + onFID(onPerfEntry) + onFCP(onPerfEntry) + onLCP(onPerfEntry) + onTTFB(onPerfEntry) }) } } diff --git a/packages/online-shell/src/reportWebVitals.ts b/packages/online-shell/src/reportWebVitals.ts index d90fcb0e..240a8e65 100644 --- a/packages/online-shell/src/reportWebVitals.ts +++ b/packages/online-shell/src/reportWebVitals.ts @@ -1,13 +1,13 @@ -import { ReportHandler } from 'web-vitals' +import { MetricType } from 'web-vitals' -export const reportWebVitals = (onPerfEntry?: ReportHandler) => { +export const reportWebVitals = (onPerfEntry?: (metric: MetricType) => void) => { if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry) - getFID(onPerfEntry) - getFCP(onPerfEntry) - getLCP(onPerfEntry) - getTTFB(onPerfEntry) + import('web-vitals').then(({ onCLS, onFID, onFCP, onLCP, onTTFB }) => { + onCLS(onPerfEntry) + onFID(onPerfEntry) + onFCP(onPerfEntry) + onLCP(onPerfEntry) + onTTFB(onPerfEntry) }) } }