Skip to content

Commit

Permalink
chore: update web-vitals to ^4.2.4 and update API usage (#1259)
Browse files Browse the repository at this point in the history
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
devin-ai-integration[bot] and whitphx authored Jan 12, 2025
1 parent 3f36537 commit f6bca44
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"codedent": "^0.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"web-vitals": "^3.5.2"
"web-vitals": "^4.2.4"
},
"devDependencies": {
"@emotion/babel-plugin": "^11.13.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/sharing-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"react-router-dom": "^7.1.1",
"superstruct": "^2.0.2",
"usehooks-ts": "^3.1.0",
"web-vitals": "^3.5.2"
"web-vitals": "^4.2.4"
},
"scripts": {
"start:web": "vite",
Expand Down
16 changes: 8 additions & 8 deletions packages/sharing-editor/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ReportHandler } from "web-vitals";
import type { Metric } from "web-vitals";

const reportWebVitals = (onPerfEntry?: ReportHandler) => {
const reportWebVitals = (onPerfEntry?: (metric: Metric) => 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);
});
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/sharing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@types/react-dom": "^18.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"web-vitals": "^3.5.2"
"web-vitals": "^4.2.4"
},
"devDependencies": {
"@emotion/babel-plugin": "^11.13.5",
Expand Down
16 changes: 8 additions & 8 deletions packages/sharing/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ReportHandler } from "web-vitals";
import type { Metric } from "web-vitals";

const reportWebVitals = (onPerfEntry?: ReportHandler) => {
const reportWebVitals = (onPerfEntry?: (metric: Metric) => 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);
});
}
};
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19412,10 +19412,10 @@ web-streams-polyfill@^3.0.3:
resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz"
integrity sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==

web-vitals@^3.5.2:
version "3.5.2"
resolved "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz"
integrity sha512-c0rhqNcHXRkY/ogGDJQxZ9Im9D19hDihbzSQJrsioex+KnFgmMzBiy57Z1EjkhX/+OjyBpclDCzz2ITtjokFmg==
web-vitals@^4.2.4:
version "4.2.4"
resolved "https://registry.yarnpkg.com/web-vitals/-/web-vitals-4.2.4.tgz#1d20bc8590a37769bd0902b289550936069184b7"
integrity sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==

webgl-context@^2.2.0:
version "2.2.0"
Expand Down

0 comments on commit f6bca44

Please sign in to comment.