Skip to content

docs: add Vercel Analytics and Speed Insights to the VitePress site - #3

Merged
Alex-Dolid merged 1 commit into
mainfrom
docs/vercel-analytics
Aug 23, 2026
Merged

Alex-Dolid merged 1 commit into
mainfrom
docs/vercel-analytics

Conversation

@Alex-Dolid

Copy link
Copy Markdown
Contributor

Wire @vercel/analytics and @vercel/speed-insights into the docs theme via enhanceApp.

Uses the framework-agnostic inject() / injectSpeedInsights() entrypoints rather than the @vercel/*/vue components: those declare a vue-router peer, and VitePress ships its own router. Both imports are dynamic and guarded by import.meta.env.SSR so nothing reaches the SSR pass of docs:build — they land in their own client chunks.

Analytics picks up VitePress' pushState navigations by itself; Speed Insights does not, so its setRoute is chained onto router.onAfterRouteChange (chained, not replaced, to leave any existing handler intact).

Both are devDependencies — docs-only, like vitepress itself. The zero-dependency guarantee is about dependencies, which stays absent.

Data only flows once Web Analytics and Speed Insights are enabled on the Vercel project.

Wire @vercel/analytics and @vercel/speed-insights into the docs theme via
enhanceApp.

Uses the framework-agnostic inject() / injectSpeedInsights() entrypoints
rather than the @vercel/*/vue components: those declare a vue-router peer,
and VitePress ships its own router. Both imports are dynamic and guarded by
import.meta.env.SSR so nothing reaches the SSR pass of docs:build — they
land in their own client chunks.

Analytics picks up VitePress' pushState navigations by itself; Speed
Insights does not, so its setRoute is chained onto router.onAfterRouteChange
(chained, not replaced, to leave any existing handler intact).

Both are devDependencies — docs-only, like vitepress itself. The
zero-dependency guarantee is about `dependencies`, which stays absent.

Data only flows once Web Analytics and Speed Insights are enabled on the
Vercel project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
wrpc Ready Ready Preview Aug 23, 2026 3:28pm

@Alex-Dolid
Alex-Dolid merged commit 7dbdbf7 into main Aug 23, 2026
6 checks passed
@Alex-Dolid
Alex-Dolid deleted the docs/vercel-analytics branch August 23, 2026 15:29

This branch was successfully deployed

1 active deployment
Preview — cf55559b Deployed Aug 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant