Skip to content

Commit

Permalink
feat: use Vercel Speed Insights (#1470)
Browse files Browse the repository at this point in the history
* feat: install `@vercel/speed-insights`

* feat: add the `SpeedInsights` component to `_app.tsx` & `layout.tsx`
  • Loading branch information
BrickheadJohnny authored Sep 9, 2024
1 parent bbb1e8a commit 0e0dd97
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
36 changes: 36 additions & 0 deletions package-lock.json

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

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"@tanstack/react-table": "^8.13.2",
"@tanstack/react-virtual": "^3.5.0",
"@vercel/kv": "^1.0.1",
"@vercel/speed-insights": "^1.0.12",
"@visx/curve": "^3.3.0",
"@visx/xychart": "^3.10.2",
"@web3inbox/core": "^1.1.0",
Expand Down
3 changes: 3 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { dystopian, inter } from "fonts"
import { type ReactNode, Suspense } from "react"
import "./globals.css"
import { cn } from "@/lib/utils"
import { SpeedInsights } from "@vercel/speed-insights/next"
import type { Metadata, Viewport } from "next"
import NextTopLoader from "nextjs-toploader"

Expand Down Expand Up @@ -56,6 +57,8 @@ export default function RootLayout({ children }: RootLayoutProps) {
pointerEvents: "none",
}}
/>

<SpeedInsights />
</body>
</html>
)
Expand Down
3 changes: 3 additions & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { FuelProvider } from "@fuels/react"
import { IconContext } from "@phosphor-icons/react"
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { SpeedInsights } from "@vercel/speed-insights/next"
import { bugsnagStart } from "bugsnag"
import Chakra from "components/_app/Chakra"
import ClientOnly from "components/common/ClientOnly"
Expand Down Expand Up @@ -101,6 +102,8 @@ const App = ({
</IconContext.Provider>
</TooltipProvider>
</Chakra>

<SpeedInsights />
</>
)
}
Expand Down

0 comments on commit 0e0dd97

Please sign in to comment.