Skip to content

Add compiled web-vitals types#93255

Open
hiradary wants to merge 1 commit into
vercel:canaryfrom
hiradary:hirad/fix-web-vitals-types
Open

Add compiled web-vitals types#93255
hiradary wants to merge 1 commit into
vercel:canaryfrom
hiradary:hirad/fix-web-vitals-types

Conversation

@hiradary

Copy link
Copy Markdown

What?

Adds TypeScript declaration files for the compiled web-vitals package bundled in Next.js.

Why?

next/web-vitals imports the Metric type from next/dist/compiled/web-vitals, but the compiled package did not include .d.ts files. This caused useReportWebVitals callback metrics to lose their proper type information.

How?

  • Copies web-vitals declaration files into packages/next/src/compiled/web-vitals
  • Adds a types entry to the compiled package metadata
  • Updates the ncc_web_vitals task so regenerated compiled output includes the declarations
  • Adds a production TypeScript typechecking regression test for useReportWebVitals

Fixes #59903

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing Metric type in useReportWebVitals

1 participant