Skip to content

💥 Remove FID (First Input Delay) tracking#4223

Merged
allspain merged 3 commits intov7from
richard.klein/remove-fid
Mar 2, 2026
Merged

💥 Remove FID (First Input Delay) tracking#4223
allspain merged 3 commits intov7from
richard.klein/remove-fid

Conversation

@allspain
Copy link
Copy Markdown
Collaborator

Motivation

FID (First Input Delay) was deprecated as a Core Web Vital in March 2024, replaced by INP (Interaction to Next Paint). Since v7 allows breaking changes, this is the right time to remove FID tracking, its polyfill, and all related event fields.

Changes

  • Deleted: trackFirstInput.ts, trackFirstInput.spec.ts, firstInputPolyfill.ts
  • Schema: Removed fid from _view-performance-schema.json, removed first_input_delay, first_input_time, first_input_target_selector from view-schema.json
  • Samples: Removed FID fields from view.json and stream.json
  • Types: Regenerated rumEvent.types.ts; removed FID fields from rawRumEvent.types.ts and ViewPerformanceData
  • performanceObservable.ts: Removed polyfill import and fallback block. Preserved FIRST_INPUT enum, RumFirstInputTiming interface, and EntryTypeToReturnType mapping (used by INP)
  • trackInitialViewMetrics.ts: Removed trackFirstInput call and firstInput from metrics
  • viewCollection.ts: Removed FID field assignments and fid from performance data
  • E2E: Removed "send performance first input delay" test
  • BROWSER_SUPPORT.md: Updated web vitals row (Firefox/Safari no longer have FID-only support), removed FID footnote

Test instructions

  • yarn typecheck — passes
  • yarn lint — passes (1 pre-existing warning)
  • yarn format — passes
  • yarn test:unit — 3199/3200 pass (1 pre-existing skip)
  • INP tests (trackInteractionToNextPaint.spec.ts) — all 18 pass, confirming FIRST_INPUT entries still work

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

🤖 Generated with Claude Code

@allspain allspain requested a review from a team as a code owner February 23, 2026 12:37
@github-actions
Copy link
Copy Markdown


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Feb 23, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 170.35 KiB 168.91 KiB -1.45 KiB -0.85%
Rum Profiler 4.69 KiB 4.69 KiB 0 B 0.00%
Rum Recorder 24.91 KiB 24.91 KiB 0 B 0.00%
Logs 56.38 KiB 56.38 KiB 0 B 0.00%
Flagging 944 B 944 B 0 B 0.00%
Rum Slim 127.63 KiB 126.25 KiB -1.38 KiB -1.08%
Worker 23.63 KiB 23.63 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0063 0.0066 +4.76%
RUM - add action 0.0136 0.0187 +37.50%
RUM - add error 0.0142 0.0168 +18.31%
RUM - add timing 0.0029 0.0039 +34.48%
RUM - start view 0.0124 0.0206 +66.13%
RUM - start/stop session replay recording 0.0007 0.0013 +85.71%
Logs - log message 0.0146 0.0232 +58.90%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 26.93 KiB 27.13 KiB +204 B
RUM - add action 115.44 KiB 111.16 KiB -4.27 KiB
RUM - add timing 25.89 KiB 26.09 KiB +211 B
RUM - add error 120.19 KiB 117.99 KiB -2.20 KiB
RUM - start/stop session replay recording 25.57 KiB 26.33 KiB +786 B
RUM - start view 506.11 KiB 507.74 KiB +1.63 KiB
Logs - log message 45.61 KiB 46.60 KiB +1009 B

🔗 RealWorld

@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Feb 23, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.16% (+0.19%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 364a494 | Docs | Datadog PR Page | Was this helpful? Give us feedback!

@allspain allspain force-pushed the richard.klein/remove-fid branch from 8e3aa75 to ca33516 Compare February 26, 2026 09:50
@allspain
Copy link
Copy Markdown
Collaborator Author

allspain commented Feb 26, 2026

RFC: Remove FID (First Input Delay) Tracking

Status: Complete

Branch: richard.klein/remove-fid

Last updated: 2026-02-26

PR: PR #4223

Summary

This change removes First Input Delay (FID) tracking from the Browser SDK. FID was deprecated as a Core Web Vital by Google in March 2024, replaced by Interaction to Next Paint (INP). Since the v7 branch allows breaking changes, this is the appropriate time to remove the FID implementation, its polyfill for older browsers, and all code that populates FID-related event fields.

The event format schema is preserved for backwards compatibility — FID fields remain defined in the schema but the SDK no longer populates them.

Motivation

FID measured the delay between a user's first interaction and the browser's response. Google deprecated FID as a Core Web Vital in March 2024, replacing it with INP which measures responsiveness across all interactions, not just the first one.

The SDK already tracks INP via trackInteractionToNextPaint.ts. Continuing to track FID adds dead code, an unnecessary polyfill (firstInputPolyfill.ts) for browsers that don't support the first-input performance entry natively, and event fields that are no longer meaningful.

Important constraint: INP tracking (trackInteractionToNextPaint.ts) subscribes to FIRST_INPUT performance entries and uses the RumFirstInputTiming interface. The FIRST_INPUT enum value, RumFirstInputTiming interface, and related type mappings in performanceObservable.ts must be preserved.

Solution

Approach

Remove the FID tracking implementation and polyfill while preserving the shared performance entry infrastructure used by INP. The event format schema retains FID fields for backwards compatibility — the SDK simply stops populating them.

Architecture

The FID tracking pipeline was:

  1. performanceObservable.ts — observed first-input performance entries (with polyfill fallback)
  2. trackFirstInput.ts — subscribed to the observable, computed delay, extracted target selector
  3. trackInitialViewMetrics.ts — wired trackFirstInput into the initial view metrics collection
  4. viewCollection.ts — serialized firstInput metrics into first_input_delay, first_input_time, first_input_target_selector, and performance.fid

This change removes steps 2-4 entirely, and removes the polyfill fallback from step 1. The FIRST_INPUT performance entry observation itself remains because INP uses it.

Schema

The RumFirstInputTiming interface in performanceObservable.ts (preserved for INP):

export interface RumFirstInputTiming {
  entryType: RumPerformanceEntryType.FIRST_INPUT
  startTime: RelativeTime
  processingStart: RelativeTime
  processingEnd: RelativeTime
  duration: Duration
  target?: Node
  interactionId?: number
  toJSON(): Omit<RumFirstInputTiming, 'toJSON'>
}

The FIRST_INPUT enum value and EntryTypeToReturnType mapping are also preserved.

Types removed from RawRumViewEvent.view in rawRumEvent.types.ts:

first_input_delay?: ServerDuration
first_input_time?: ServerDuration
first_input_target_selector?: string

Types removed from ViewPerformanceData in rawRumEvent.types.ts:

fid?: {
  duration: ServerDuration
  timestamp: ServerDuration
  target_selector?: string
}

Testing

  • yarn typecheck — passes
  • yarn lint — passes (1 pre-existing warning)
  • yarn format — passes
  • yarn test:unit — 3199/3200 pass (1 pre-existing skip)
  • INP tests (trackInteractionToNextPaint.spec.ts) — all 18 pass, confirming FIRST_INPUT performance entries still work correctly
  • viewCollection.spec.ts — 9/9 pass with FID fields removed from fixtures and assertions
  • performanceObservable.spec.ts — 7/7 pass

References

@allspain allspain force-pushed the richard.klein/remove-fid branch from cef6ff0 to ca33516 Compare February 26, 2026 12:15
allspain and others added 3 commits February 26, 2026 13:18
Remove trackFirstInput.ts, trackFirstInput.spec.ts, and
firstInputPolyfill.ts. FID was deprecated as a Core Web Vital
in March 2024, replaced by INP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove FID fields from RawRumViewEvent and ViewPerformanceData types,
FID wiring from trackInitialViewMetrics and viewCollection, and the
polyfill fallback from performanceObservable. The FIRST_INPUT enum,
RumFirstInputTiming interface, and EntryTypeToReturnType mapping are
preserved for INP.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove FID fields from view collection and initial view metrics test
fixtures and assertions, delete the FID E2E test scenario, and update
BROWSER_SUPPORT.md to remove FID-only footnotes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@allspain allspain force-pushed the richard.klein/remove-fid branch from ca33516 to 364a494 Compare February 26, 2026 12:19
Copy link
Copy Markdown
Contributor

@BeltranBulbarellaDD BeltranBulbarellaDD left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Some format things we can discuss:

  1. In Changes part, I will see the changes in the modified files, I think I would prefer to see a general idea of the changes in a paragraph more than bullet points of each change.
  2. Same for Test instructions. This part is for me to know how to test it. That the CI passes I can see it below. Maybe in this case that is removing code you can say: typecheck passes. Since it's the relevant test.
  3. The RFC part sort of repeats what is in the description. I would prefer it all to be in the description since it's the first thing someone reads.
  4. I like the RFC, I think it's a little bit long. Specially around the Architecture part.

Overall IMO, it's nice to read all this info. I completely understand what you try to do and I have sufficient context to review!

@allspain allspain merged commit eb43449 into v7 Mar 2, 2026
18 of 19 checks passed
@allspain allspain deleted the richard.klein/remove-fid branch March 2, 2026 10:09
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 2, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants