Skip to content

Comments

Add INP as Core Web Vital for Playwright probes and deprecate FID#21

Open
m0nkey wants to merge 1 commit intobasecamp:mainfrom
m0nkey:jesse/perf/playwright-cwv-inp-fid
Open

Add INP as Core Web Vital for Playwright probes and deprecate FID#21
m0nkey wants to merge 1 commit intobasecamp:mainfrom
m0nkey:jesse/perf/playwright-cwv-inp-fid

Conversation

@m0nkey
Copy link

@m0nkey m0nkey commented Feb 18, 2026

Adopt INP as Core Web Vital and deprecate FID

INP (introduced May 2023) replaced FID as the responsiveness Core Web Vital (March 2024; FID removed from Chrome tools Sept 2024). This adds INP collection for Playwright probes and keeps FID as a deprecated, backward-compatible metric for now. FID should be considered for complete removal.

Changes

  • lib/upright/playwright/inp_observer.js (new)
    • Init script that observes event and first-input via PerformanceObserver, tracks worst interaction by interactionId, stores value in window.upright.inp.
  • app/models/concerns/upright/playwright/lifecycle.rb
    • Calls context.add_init_script(script: inp_observer_script) before new_page; script loaded with File.read(Engine.root.join(...)) like OtelTracing.
  • lib/upright/playwright/collect_performance_metrics.js
    • Reads window.upright?.inp, assigns metrics.inp with Math.round (same pattern as other metrics). FID still collected; JSDoc @deprecated Use INP for responsiveness.
  • README
    • OpenTelemetry: new “Browser performance (Playwright)” note that spans get browser.performance.* (ttfb, fcp, lcp, inp, fid), INP is responsiveness metric, FID deprecated.
  • CHANGELOG
    • [Unreleased]: INP added, FID deprecated.

Tests

  • inp observer script is injected into context
    • Stub config_for(:playwright) and connect_to_browser_server → MockBrowser/MockContext; assert init script contains window.upright, inp, PerformanceObserver.
  • browser performance metrics including inp are attached to document span
    • Stub page.evaluate to return hash with inp/ttfb/fcp; assert span receives set_attribute("browser.performance.inp", …) etc.
  • MockPlaywrightHelper
    • MockContext: add_init_script + init_script; MockPage: wait_for_load_state, evaluate.
  • FID remains on spans as browser.performance.fid; Playwright probe tests pass.

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