From 39a3996f8d61eec680fe486c5be6a62f83331cf4 Mon Sep 17 00:00:00 2001 From: Ting-Hong Shieh <32212900+ting-hong-shieh@users.noreply.github.com> Date: Thu, 20 Aug 2026 01:52:02 +0800 Subject: [PATCH] docs: next/web-vitals is implemented, not a no-op stub Both the README API coverage table and the shipped migrate-to-vinext skill list `next/web-vitals` as an intentional stub. The shim is a real implementation: `useReportWebVitals` subscribes to CLS, FID, LCP, INP, FCP, and TTFB via the `web-vitals` package and forwards each metric to the caller's callback. `check.ts` already reports the module as supported, so a user running `vinext check` and a user reading the README were told opposite things, and the README's advice to "use the `web-vitals` library directly" steered people away from a working API. The `_app`-based `reportWebVitals` export is a separate Pages Router API and is still not wired up, so the note says so. --- .agents/skills/migrate-to-vinext/references/compatibility.md | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.agents/skills/migrate-to-vinext/references/compatibility.md b/.agents/skills/migrate-to-vinext/references/compatibility.md index 610ee7960..cff7dda7a 100644 --- a/.agents/skills/migrate-to-vinext/references/compatibility.md +++ b/.agents/skills/migrate-to-vinext/references/compatibility.md @@ -26,7 +26,7 @@ All of these resolve automatically to vinext shims. Do not rewrite imports in ap | `next/document` | Full | Pages Router | | `next/constants` | Full | | | `next/amp` | Stub | No-op; AMP deprecated since Next.js 13 | -| `next/web-vitals` | Stub | No-op | +| `next/web-vitals` | Full | `useReportWebVitals`; not the `_app` export | | `server-only` | Full | | | `client-only` | Full | | diff --git a/README.md b/README.md index 7c9bc29ed..09d4478d4 100644 --- a/README.md +++ b/README.md @@ -553,7 +553,7 @@ Every `next/*` import is shimmed to a Vite-compatible implementation. | `next/document` | ✅ | `Html`, `Head`, `Main`, `NextScript` | | `next/constants` | ✅ | All phase constants | | `next/amp` | ⬜ | No-op (AMP is deprecated) | -| `next/web-vitals` | ⬜ | No-op (use the `web-vitals` library directly) | +| `next/web-vitals` | ✅ | `useReportWebVitals` reports CLS, FCP, FID, INP, LCP, TTFB via the `web-vitals` library | ### Routing