Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Remove FID, replace first interaction detection with INP #1395

Merged
merged 10 commits into from
Mar 4, 2025

Conversation

ptang-nr
Copy link
Contributor

@ptang-nr ptang-nr commented Feb 24, 2025

First Input Delay (FID) has been deprecated and replaced by Interaction To Next Paint (INP). PageViewTiming events for first interactions are preserved by detecting the first INP event and will no longer output value for the firstInputDelay attribute. For more info on PageViewTiming, see https://docs.newrelic.com/docs/browser/new-relic-browser/page-load-timing-resources/pageviewtiming-async-or-dynamic-page-details/. For more info on INP and the FID deprecation, see https://web.dev/articles/inp.

Overview

In this PR, we are proceeding with the removal of FID related logic from the browser agent.

Notes:

The firstInteraction timing event should continue to be detected as-is, with the following differences:

  • the firstInputDelay attribute will no longer be generated
  • value is emitted when visibilityChange = hidden
  • dropped support in Firefox due to INP being yet to be supported
  • interactionType values:
Previous values To-be values
keyup, keydown keyboard
pointerup, pointerdown, click pointer

Supported in Chrome, Edge, and Android. Not supported on Firefox, Safari and iOS (see PerformanceEventTming browser compatibility)

Related Issue(s)

https://new-relic.atlassian.net/browse/NR-365650

Testing

Updated existing tests that dealt with FID.
Added unit tests for first interaction.
Manually tested

  • Detection of first input on Chrome
  • No first input detected when page is opened in background on Chrome

Preserve `firstInteraction` by detecting the first INP instead of FID event.
Copy link

github-actions bot commented Feb 24, 2025

Asset Size Report

Merging this pull request will result in the following asset size changes:

Agent Asset Previous Size New Size Diff
lite loader 29.86 kB / 10.83 kB (gzip) 29.86 kB / 10.83 kB (gzip) 0% / -0.03% (gzip)
lite async-chunk 52.76 kB / 17.13 kB (gzip) 51.22 kB / 16.75 kB (gzip) -2.93% / -2.19% (gzip)
pro loader 51.95 kB / 17.89 kB (gzip) 51.95 kB / 17.89 kB (gzip) 0% / -0.01% (gzip)
pro async-chunk 101.89 kB / 31.03 kB (gzip) 100.22 kB / 30.61 kB (gzip) -1.65% / -1.36% (gzip)
spa loader 59.56 kB / 20.21 kB (gzip) 59.56 kB / 20.21 kB (gzip) 0% / 0% (gzip)
spa async-chunk 116.61 kB / 35.36 kB (gzip) 114.93 kB / 34.94 kB (gzip) -1.44% / -1.19% (gzip)

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.67%. Comparing base (46b691b) to head (e303fa7).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1395      +/-   ##
==========================================
- Coverage   88.67%   88.67%   -0.01%     
==========================================
  Files         170      169       -1     
  Lines        7416     7406      -10     
  Branches     1503     1500       -3     
==========================================
- Hits         6576     6567       -9     
  Misses        732      732              
+ Partials      108      107       -1     
Flag Coverage Δ
integration-tests 90.88% <100.00%> (+0.03%) ⬆️
unit-tests 79.89% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Feb 24, 2025

Static Badge

Last ran on March 04, 2025 14:31:02 CST
Checking merge of (e303fa7) into main (46b691b)

@metal-messiah
Copy link
Member

Can you change the PR title to something more specific for the changelog/release notes

@ptang-nr ptang-nr changed the title feat: Remove FID, second attempt feat: Remove FID, replace first interaction detection with INP Feb 27, 2025
@metal-messiah
Copy link
Member

re-testing after branch updates, will approve with passing tests

@metal-messiah metal-messiah merged commit 436ce94 into main Mar 4, 2025
30 of 32 checks passed
@metal-messiah metal-messiah deleted the NR-365650-derive-fi-from-inp branch March 4, 2025 21:23
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.

2 participants