Skip to content

perf_hooks: add missing resource timing attributes - #65017

Open
greenheadHQ wants to merge 3 commits into
nodejs:mainfrom
greenheadHQ:resource-timing-missing-getters
Open

perf_hooks: add missing resource timing attributes#65017
greenheadHQ wants to merge 3 commits into
nodejs:mainfrom
greenheadHQ:resource-timing-missing-getters

Conversation

@greenheadHQ

@greenheadHQ greenheadHQ commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Add the PerformanceResourceTiming attributes still missing from the Resource Timing spec: finalResponseHeadersStart, firstInterimResponseStart, renderBlockingStatus, contentType and contentEncoding. The getters follow the existing pattern in the file, and the WPT status file drops the ten idlharness subtests this makes pass.

Current values:

  • finalResponseHeadersStart: same timing info field as responseStart
  • contentType: '' (undici computes it in its report timing steps, but that path is currently unreachable since the request's initiator type is never set, and the reporting path that actually runs doesn't pass body info at all)
  • contentEncoding: '' (spec default, not populated by the fetch side yet)
  • firstInterimResponseStart: 0 (same)
  • renderBlockingStatus: 'non-blocking' (same)

The getters pick up real values automatically once the producer side fills them in. Precedent: #51589 added deliveryType and responseStatus the same way.

responseStart now returns firstInterimResponseStart when it is non-zero, per the spec (no observable change, since nothing records interim response timings yet).

Refs: #51589

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/web-standards

@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Aug 4, 2026
@greenheadHQ
greenheadHQ force-pushed the resource-timing-missing-getters branch from 74a9a8a to 2ebef57 Compare August 4, 2026 14:28
Add the finalResponseHeadersStart, firstInterimResponseStart,
renderBlockingStatus, contentType and contentEncoding getters to
PerformanceResourceTiming and update the WPT status accordingly.

Signed-off-by: greenhead <shren0812@gmail.com>
@greenheadHQ
greenheadHQ force-pushed the resource-timing-missing-getters branch from 2ebef57 to 94dca40 Compare August 4, 2026 14:47
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (31cde9f) to head (1037870).
⚠️ Report is 382 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65017      +/-   ##
==========================================
- Coverage   90.30%   90.07%   -0.24%     
==========================================
  Files         759      751       -8     
  Lines      247621   254817    +7196     
  Branches    46672    48095    +1423     
==========================================
+ Hits       223603   229514    +5911     
- Misses      15473    16487    +1014     
- Partials     8545     8816     +271     
Files with missing lines Coverage Δ
lib/internal/perf/resource_timing.js 99.67% <100.00%> (+0.04%) ⬆️

... and 254 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@greenheadHQ

Copy link
Copy Markdown
Contributor Author

Hello @legendecas @jasnell 🖐️

Thank you for all the work that goes into reviewing contributions here! Just a gentle ping in case this PR slipped through the cracks. I would appreciate any feedback whenever you have time, no rush at all. Thanks!

The spec defines responseStart as firstInterimResponseStart when that
is not 0, and finalResponseHeadersStart otherwise.

Signed-off-by: greenhead <greenheadhq@gmail.com>
Document the five getters PerformanceResourceTiming gained:
finalResponseHeadersStart, firstInterimResponseStart,
renderBlockingStatus, contentType and contentEncoding, add the missing
responseStart entry, and record its new interim-aware behavior.

Signed-off-by: greenhead <greenheadhq@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants