From 9a2a93e217962e8976712e047cb752438da4c80d Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Wed, 21 Aug 2024 11:59:57 -0500 Subject: [PATCH] speed insights --- package-lock.json | 41 ++++++++++++++++++++++++++++++++++++++--- package.json | 1 + pages/_app.tsx | 5 +++++ 3 files changed, 44 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index aa556089..6ae1745b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,6 +12,7 @@ "@mui/icons-material": "^5.4.4", "@mui/material": "^5.4.2", "@vercel/analytics": "^1.0.0", + "@vercel/speed-insights": "^1.0.12", "apexcharts": "^3.33.2", "autoprefixer": "^10.4.2", "autosuggest-highlight": "^3.3.4", @@ -3314,6 +3315,40 @@ "react": "^16.8||^17||^18" } }, + "node_modules/@vercel/speed-insights": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-1.0.12.tgz", + "integrity": "sha512-ZGQ+a7bcfWJD2VYEp2R1LHvRAMyyaFBYytZXsfnbOMkeOvzGNVxUL7aVUvisIrTZjXTSsxG45DKX7yiw6nq2Jw==", + "hasInstallScript": true, + "peerDependencies": { + "@sveltejs/kit": "^1 || ^2", + "next": ">= 13", + "react": "^18 || ^19", + "svelte": "^4", + "vue": "^3", + "vue-router": "^4" + }, + "peerDependenciesMeta": { + "@sveltejs/kit": { + "optional": true + }, + "next": { + "optional": true + }, + "react": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vue": { + "optional": true + }, + "vue-router": { + "optional": true + } + } + }, "node_modules/@vxna/mini-html-webpack-template": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@vxna/mini-html-webpack-template/-/mini-html-webpack-template-2.0.0.tgz", @@ -4407,9 +4442,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001561", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001561.tgz", - "integrity": "sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "funding": [ { "type": "opencollective", diff --git a/package.json b/package.json index d41986e7..75aaa340 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "@mui/icons-material": "^5.4.4", "@mui/material": "^5.4.2", "@vercel/analytics": "^1.0.0", + "@vercel/speed-insights": "^1.0.12", "apexcharts": "^3.33.2", "autoprefixer": "^10.4.2", "autosuggest-highlight": "^3.3.4", diff --git a/pages/_app.tsx b/pages/_app.tsx index d057f78c..dbd7a373 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,10 +4,12 @@ import GitHub from '@mui/icons-material/GitHub'; import { Card, IconButton, Tooltip, useMediaQuery } from '@mui/material'; import { createTheme, ThemeProvider } from '@mui/material/styles'; import { Analytics } from '@vercel/analytics/react'; +import { SpeedInsights } from '@vercel/speed-insights/react'; import type { AppProps } from 'next/app'; import { Inter } from 'next/font/google'; import localFont from 'next/font/local'; import Head from 'next/head'; +import { useRouter } from 'next/router'; import React from 'react'; const inter = Inter({ @@ -92,6 +94,8 @@ function MyApp({ Component, pageProps }: AppProps) { }, }); + const router = useRouter(); + return ( <> @@ -122,6 +126,7 @@ function MyApp({ Component, pageProps }: AppProps) { + {showGitInfo ? ( <>