diff --git a/frontend/.vade-report b/frontend/.vade-report new file mode 100644 index 0000000..c11a171 --- /dev/null +++ b/frontend/.vade-report @@ -0,0 +1,41 @@ +# Vercel Speed Insights Integration + +Successfully installed and configured Vercel Speed Insights for this React + Vite project. + +## Changes Made + +### 1. Package Installation +- Installed `@vercel/speed-insights` package using npm +- Updated `package.json` and `package-lock.json` with the new dependency + +### 2. Component Integration +- Added SpeedInsights component to `src/App.tsx` +- Imported `SpeedInsights` from `@vercel/speed-insights/react` +- Placed the component in the `AppWithErrorBoundary` wrapper to ensure it's included on all routes +- This ensures Speed Insights tracking works across all pages of the application + +### 3. Implementation Details +The SpeedInsights component was added to the root-level error boundary wrapper rather than individual route components. This approach: +- Ensures consistent tracking across all routes (landing page, dashboard, docs, checkout, etc.) +- Follows React best practices by keeping the component at the application root +- Maintains the existing code structure without invasive changes + +### 4. Verification +- Successfully built the project using `npm run build` +- TypeScript compilation passed without errors +- No linting or type errors introduced + +## Files Modified +- `frontend/package.json` - Added @vercel/speed-insights dependency +- `frontend/package-lock.json` - Updated with new dependency resolution +- `frontend/src/App.tsx` - Added SpeedInsights import and component + +## Next Steps +After deployment to Vercel: +1. Enable Speed Insights in the Vercel dashboard +2. View performance metrics after the first deployment and user visits +3. Access Speed Insights data through the Vercel dashboard sidebar + +## Documentation Reference +Implementation follows the official Vercel Speed Insights quickstart guide for React applications: +https://vercel.com/docs/speed-insights/quickstart diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 54ca981..5e6b2ec 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -22,6 +22,7 @@ "@rainbow-me/rainbowkit": "^2.2.10", "@supabase/supabase-js": "^2.95.1", "@tanstack/react-query": "^5.90.20", + "@vercel/speed-insights": "^2.0.0", "bs58": "^6.0.0", "buffer": "^6.0.3", "canvas-confetti": "^1.9.4", @@ -14027,6 +14028,44 @@ "url": "https://github.com/sponsors/colinhacks" } }, + "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/@vercel/static-config": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/@vercel/static-config/-/static-config-3.2.0.tgz", diff --git a/frontend/package.json b/frontend/package.json index 73b358e..080845d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -24,6 +24,7 @@ "@rainbow-me/rainbowkit": "^2.2.10", "@supabase/supabase-js": "^2.95.1", "@tanstack/react-query": "^5.90.20", + "@vercel/speed-insights": "^2.0.0", "bs58": "^6.0.0", "buffer": "^6.0.3", "canvas-confetti": "^1.9.4", diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 95fb340..b30fec8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,7 @@ import { Component, type ReactNode, useCallback, useEffect, useRef, useState } from 'react' + +import { SpeedInsights } from '@vercel/speed-insights/react' + /* RAINBOWKIT: was import { useConnectModal } from '@rainbow-me/rainbowkit' */ import { useConnectModal } from './contexts/ConnectModalContext' import { useAuth, useWallet, useRoute } from './hooks' @@ -346,6 +349,7 @@ export default function AppWithErrorBoundary() { return ( + ) }