From 29029ae9c4d793dbd7794c4bc8948bb097cd1dde Mon Sep 17 00:00:00 2001 From: ErickCReis Date: Sun, 28 Apr 2024 22:05:56 -0300 Subject: [PATCH] feat: Analytics e SpeedInsights --- apps/nextjs/package.json | 1 + apps/nextjs/src/app/layout.tsx | 9 ++++++--- pnpm-lock.yaml | 31 +++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/apps/nextjs/package.json b/apps/nextjs/package.json index 032cc46..ecd7f82 100644 --- a/apps/nextjs/package.json +++ b/apps/nextjs/package.json @@ -27,6 +27,7 @@ "@trpc/server": "11.0.0-rc.334", "@ts-react/form": "^1.1.3", "@vercel/analytics": "^1.2.2", + "@vercel/speed-insights": "^1.0.10", "clsx": "^2.1.1", "dayjs": "^1.11.7", "geist": "^1.3.0", diff --git a/apps/nextjs/src/app/layout.tsx b/apps/nextjs/src/app/layout.tsx index c7ecf51..7ced031 100644 --- a/apps/nextjs/src/app/layout.tsx +++ b/apps/nextjs/src/app/layout.tsx @@ -1,4 +1,6 @@ import type { Metadata, Viewport } from "next"; +import { Analytics } from "@vercel/analytics/next"; +import { SpeedInsights } from "@vercel/speed-insights/next"; import { GeistMono } from "geist/font/mono"; import { GeistSans } from "geist/font/sans"; @@ -6,13 +8,12 @@ import { cn } from "@acme/ui"; import { ThemeProvider, ThemeToggle } from "@acme/ui/theme"; import { Toaster } from "@acme/ui/toast"; +import { env } from "~/env"; import { TRPCReactProvider } from "~/trpc/react"; +import { Header } from "./_components/header"; import "~/app/globals.css"; -import { env } from "~/env"; -import { Header } from "./_components/header"; - export const runtime = "edge"; export const preferredRegion = ["iad1"]; @@ -67,6 +68,8 @@ export default function RootLayout(props: { children: React.ReactNode }) { + + ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4b16c93..617e230 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,6 +65,9 @@ importers: '@vercel/analytics': specifier: ^1.2.2 version: 1.2.2(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) + '@vercel/speed-insights': + specifier: ^1.0.10 + version: 1.0.10(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1) clsx: specifier: ^2.1.1 version: 2.1.1 @@ -1612,6 +1615,29 @@ packages: react: optional: true + '@vercel/speed-insights@1.0.10': + resolution: {integrity: sha512-4uzdKB0RW6Ff2FkzshzjZ+RlJfLPxgm/00i0XXgxfMPhwnnsk92YgtqsxT9OcPLdJUyVU1DqFlSWWjIQMPkh0g==} + 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 + acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -5259,6 +5285,11 @@ snapshots: next: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) react: 18.3.1 + '@vercel/speed-insights@1.0.10(next@14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(react@18.3.1)': + optionalDependencies: + next: 14.2.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 + acorn-jsx@5.3.2(acorn@8.11.3): dependencies: acorn: 8.11.3