Skip to content

chore: switch deferred promise with Promise.withResolvers()#4972

Merged
mcollina merged 1 commit intonodejs:mainfrom
trivikr:promise-with-resolvers
Apr 5, 2026
Merged

chore: switch deferred promise with Promise.withResolvers()#4972
mcollina merged 1 commit intonodejs:mainfrom
trivikr:promise-with-resolvers

Conversation

@trivikr
Copy link
Copy Markdown
Member

@trivikr trivikr commented Apr 4, 2026

This relates to...

N/A

Rationale

The package engine is already >=22.19.0, so Promise.withResolvers() is available in all supported runtimes. This removes an internal deferred helper that is no longer needed and simplifies the affected code paths.

Changes

  • Replace createDeferredPromise() call sites with Promise.withResolvers()
  • Remove the unused lib/util/promise.js helper
  • Update WebSocketStream JSDoc to reflect the built-in deferred return shape
  • Update WPT runner code to use Promise.withResolvers() directly

Features

N/A

Bug Fixes

N/A

Breaking Changes and Deprecations

N/A

Status

Signed-off-by: Kamat, Trivikram <16024985+trivikr@users.noreply.github.com>
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.92308% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.95%. Comparing base (48c7cf3) to head (2867c38).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
lib/web/cache/cache.js 50.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4972      +/-   ##
==========================================
- Coverage   92.96%   92.95%   -0.02%     
==========================================
  Files         111      110       -1     
  Lines       35864    35809      -55     
==========================================
- Hits        33342    33287      -55     
  Misses       2522     2522              

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

🚀 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.

Copy link
Copy Markdown
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

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

lgtm

@mcollina mcollina merged commit a0291b9 into nodejs:main Apr 5, 2026
36 checks passed
@trivikr trivikr deleted the promise-with-resolvers branch April 5, 2026 14:57
@github-actions github-actions bot mentioned this pull request Apr 12, 2026
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.

4 participants