Skip to content

lib: narrow ReadableStreamBYOBRequest.view return type to Uint8Array#63017

Open
Jah-yee wants to merge 1 commit intonodejs:mainfrom
Jah-yee:fix-uint8array-type-v2
Open

lib: narrow ReadableStreamBYOBRequest.view return type to Uint8Array#63017
Jah-yee wants to merge 1 commit intonodejs:mainfrom
Jah-yee:fix-uint8array-type-v2

Conversation

@Jah-yee
Copy link
Copy Markdown

@Jah-yee Jah-yee commented Apr 28, 2026

Description

Follow WHATWG streams spec update: whatwg/streams#1367

ReadableStreamBYOBRequest.view is always constructed as a Uint8Array, and the specification will be updated to enforce this. This changes the documented return type from ArrayBufferView to Uint8Array.

Fix

Changed the JSDoc type annotation for view getter from @type {ArrayBufferView} to @type {Uint8Array} in lib/internal/webstreams/readablestream.js.

Relation to #62958

This PR replaces #62958, which was closed after the commit message lint check failed. The commit message was corrected (per feedback from @MattiasBuelens) and resubmitted as this new PR with the fix already applied.

Fixes #62952

Follow WHATWG streams spec update: whatwg/streams#1367

ReadableStreamBYOBRequest.view is always constructed as a Uint8Array.

This changes the documented return type from ArrayBufferView to

Uint8Array per the updated spec.

Fixes: nodejs#62952
@Jah-yee
Copy link
Copy Markdown
Author

Jah-yee commented Apr 29, 2026

Hi @MattiasBuelens, thank you for your review on #62958! πŸ‘‹

This PR replaces #62958 with the corrected commit message (per your feedback on the line-length lint issue β€” the commit message was adjusted accordingly).

The change is identical: a 1-line JSDoc type narrowing from ArrayBufferView to Uint8Array, following the WHATWG streams spec update.

The CI checks were cancelled (not failed) and appear to be pending. Could you please review this PR when you have a moment? Happy to address any feedback.

Also tagging @gurgunday β€” thank you for the earlier feedback on #62958 as well! πŸ™

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

βœ… All modified and coverable lines are covered by tests.
βœ… Project coverage is 89.65%. Comparing base (2a601eb) to head (e6b5c86).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #63017      +/-   ##
==========================================
- Coverage   89.65%   89.65%   -0.01%     
==========================================
  Files         708      708              
  Lines      220374   220374              
  Branches    42264    42265       +1     
==========================================
- Hits       197584   197570      -14     
+ Misses      14656    14651       -5     
- Partials     8134     8153      +19     
Files with missing lines Coverage Ξ”
lib/internal/webstreams/readablestream.js 98.54% <100.00%> (ΓΈ)

... and 27 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.

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.

webstreams: narrow ReadableStreamBYOBRequest.view to Uint8Array

1 participant