Skip to content

Commit

Permalink
Bump web-vitals from 3.5.2 to 4.0.0 in /app (#1048)
Browse files Browse the repository at this point in the history
* Bump web-vitals from 3.5.2 to 4.0.0 in /app

Bumps [web-vitals](https://github.com/GoogleChrome/web-vitals) from 3.5.2 to 4.0.0.
- [Changelog](https://github.com/GoogleChrome/web-vitals/blob/main/CHANGELOG.md)
- [Commits](GoogleChrome/web-vitals@v3.5.2...v4.0.0)

---
updated-dependencies:
- dependency-name: web-vitals
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* Rename types for new web-vitals major version.

* Further fixes for new major version.

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brandon Pitman <[email protected]>
  • Loading branch information
dependabot[bot] and branlwyd authored May 20, 2024
1 parent 3f10cb9 commit ca3e8c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"react-syntax-highlighter": "^15.5.0",
"swagger-ui-react": "=5.17.10",
"use-interval": "^1.4.0",
"web-vitals": "^3.5.2"
"web-vitals": "^4.0.0"
},
"scripts": {
"analyze": "source-map-explorer 'build/assets/*.js'",
Expand Down
16 changes: 8 additions & 8 deletions app/src/reportWebVitals.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ReportHandler } from "web-vitals";
import { MetricType } from "web-vitals";

const reportWebVitals = (onPerfEntry?: ReportHandler) => {
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);
});
}
};
Expand Down

0 comments on commit ca3e8c8

Please sign in to comment.