npm / web-vitals
web-vitals
What changed in web-vitals 1 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
20 breaking1 deprecations12 new APIs and options4 behavior and defaults2 tooling14 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initweb-vitals 617 changes
Breaking changes 2
Types are now exported as explicit types, so code importing them may need to use import type.
includeProcessedEventEntries now defaults to false; set it to true to include the extra attribution details.
New APIs and options 1
Adds a Resource Timing buffer for LCP attribution, supporting attribution data collection.
Behavior and default changes 3
Small INP interactions are reported with bfcache support.
The default for includeProcessedEventEntries changes to false in v6.
Web Vitals metrics support Soft Navigation when supported by the browser.
Tooling 2
Source maps are added, helping developers trace generated code.
Sourcemaps are now supported.
Fixes and other changes 9
Fixes an INP clean-up bug that caused a memory leak.
Fixes negative resourceLoadDuration values in LCP attribution.
Caps pending LoAFs to avoid a memory leak.
Fixes negative inputDelay in INP attribution.
Prevents a spurious CLS report of 0 after bfcache restore.
Guards supportedEntryTypes for older browsers.
Navigation interaction counts are scoped to each InteractionManager.
Prevents a JavaScript error when PerformanceObserver is unavailable.
RequestIdleCallback is capped at 1 second so metrics report even when the browser is busy.
web-vitals 513 changes
Breaking changes 5
Removed getFirstHiddenTimePolyfill.
Removes obsolete FID polyfill types.
Classes in attribution selectors are sorted to reduce cardinality, which may cause short-term reporting differences but should make selectors easier to group over time.
Removed interactionTargetElement by default; it can be generated when creating custom targets in the attribution build.
First Input Delay support and onFID() were removed; FID has been replaced by INP.
New APIs and options 3
Adds the includeProcessedEventEntries option.
The attribution build supports generating custom targets.
INP attribution now includes extra LoAF information: the longest script and buckets.
Fixes and other changes 5
Fixed errors that could occur when passing the same configuration object to multiple metric functions.
Made the INP interactionTarget setting more robust.
Uses LargestContentfulPaint.id as a fallback when the element is removed from the DOM.
Fixes a bug when onLCP is attached late.
Handles initially hidden pages and onLCP registered on visibility change.
web-vitals 421 changes
Breaking changes 12
The build that included the FID and Navigation Timing polyfills for legacy Safari browsers was removed.
Renamed the TTFBAttribution property from connectionTime.
Renamed the TTFBAttribution property from dnsTime.
Removed in favor of processedEventEntries, which includes event entries processed in the same animation frame as the INP candidate interaction.
All getXXX() functions that were deprecated in v3 were removed.
entries now includes only entries with a matching interactionId processed within the same animation frame, excluding entries that do not impact INP.
Renamed the INPAttribution property from eventTarget.
Renamed the INPAttribution property from eventTime.
Renamed the property from eventType; its value is now always either "pointer" or "keyboard".
Renamed the TTFBAttribution property from requestTime.
Renamed the LCPAttribution property from resourceLoadTime.
Renamed the TTFBAttribution property from waitingTime; the duration spent checking the HTTP cache is separately available as cacheDuration.
Deprecations 1
Deprecated in favor of explicit callback types for each metric function.
New APIs and options 8
Added to TTFBAttribution to mark the total time spent checking the HTTP cache for a match.
Added to INPAttribution to measure the time from user interaction until the browser can start processing its event listeners.
Added to INPAttribution.
Added to include long-animation-frame entries that overlap with the INP candidate interaction.
Added to INPAttribution to mark the timestamp of the next paint after the interaction.
Added to INPAttribution to measure the time from event-listener processing finishing until the next frame is presented and visible.
Added an array of event entries processed within the same animation frame as the INP candidate interaction.
Added to INPAttribution to measure the time from the first event listener running until all event listener processing has finished.
web-vitals 12 changes
Breaking changes 1
The isFinal flag was removed from the Metric interface.
Behavior and default changes 1
Metrics are now reported when a page is restored from the back/forward cache.