From a1f49f505505d5546427389bee0f8ccf49005eb7 Mon Sep 17 00:00:00 2001 From: Vercel Date: Sat, 2 May 2026 17:54:58 +0000 Subject: [PATCH] Install Vercel Speed Insights MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implemented Vercel Speed Insights for the workout tracker project. ## Changes Made ### 1. Installed @vercel/speed-insights package - Added `@vercel/speed-insights@^2.0.0` to project dependencies - Used npm to install the package, which updated package.json and package-lock.json ### 2. Configured Speed Insights in src/main.jsx - Added import statement: `import { SpeedInsights } from '@vercel/speed-insights/react'` - Added `` component alongside the existing `` component - Placed within React.StrictMode for proper integration with the existing app structure ### 3. Files Modified - **package.json**: Added @vercel/speed-insights dependency - **package-lock.json**: Updated with new package and its dependencies - **src/main.jsx**: Added SpeedInsights import and component ## Implementation Details The implementation follows the official Vercel documentation from https://vercel.com/docs/speed-insights/quickstart: - For React/Vite projects, the SpeedInsights component is imported from `@vercel/speed-insights/react` - The component is added to the root render tree, similar to how Analytics is already configured - This is the recommended approach for React applications using Vite The project structure was preserved, and the SpeedInsights component was added in the same pattern as the existing Analytics integration, maintaining consistency with the codebase. ## Verification - ✅ Build completed successfully with `npm run build` - ✅ No build errors or warnings - ✅ Package installation completed without issues - ✅ Lock file properly updated ## Next Steps To see Speed Insights data: 1. Deploy the application to Vercel using `vercel deploy` 2. Enable Speed Insights in the Vercel dashboard for this project 3. After a few days of visitor traffic, metrics will be available in the dashboard Note: Speed Insights requires the application to be deployed on Vercel to collect and display performance metrics. Co-authored-by: Vercel --- package-lock.json | 39 +++++++++++++++++++++++++++++++++++++++ package.json | 1 + src/main.jsx | 2 ++ 3 files changed, 42 insertions(+) diff --git a/package-lock.json b/package-lock.json index faa0f45..208a00f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", "recharts": "^2.13.0" @@ -1410,6 +1411,44 @@ } } }, + "node_modules/@vercel/speed-insights": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@vercel/speed-insights/-/speed-insights-2.0.0.tgz", + "integrity": "sha512-jwkNcrTeafWxjmWq4AHBaptSqZiJkYU5adLC9QBSqeim0GcqDMgN5Ievh8OG1rJ6W3A4l1oiP7qr9CWxGuzu3w==", + "license": "Apache-2.0", + "peerDependencies": { + "@sveltejs/kit": "^1 || ^2", + "next": ">= 13", + "nuxt": ">= 3", + "react": "^18 || ^19 || ^19.0.0-rc", + "svelte": ">= 4", + "vue": "^3", + "vue-router": "^4" + }, + "peerDependenciesMeta": { + "@sveltejs/kit": { + "optional": true + }, + "next": { + "optional": true + }, + "nuxt": { + "optional": true + }, + "react": { + "optional": true + }, + "svelte": { + "optional": true + }, + "vue": { + "optional": true + }, + "vue-router": { + "optional": true + } + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", diff --git a/package.json b/package.json index 21e6b61..8a2031c 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "dependencies": { "@vercel/analytics": "^2.0.1", + "@vercel/speed-insights": "^2.0.0", "react": "^18.3.1", "react-dom": "^18.3.1", "recharts": "^2.13.0" diff --git a/src/main.jsx b/src/main.jsx index 9ab6d5d..e2ed89f 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -1,6 +1,7 @@ import React from 'react' import ReactDOM from 'react-dom/client' import { Analytics } from '@vercel/analytics/react' +import { SpeedInsights } from '@vercel/speed-insights/react' import App from './App.jsx' import './index.css' @@ -8,5 +9,6 @@ ReactDOM.createRoot(document.getElementById('root')).render( + , )