Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

[Infrastructure] Fix TypeScript build error for npm package update

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Fix TypeScript 5.9.3 build error in StreamingInterop.ts

Description

TypeScript 5.9.3 introduced stricter type checking for Uint8Array. The subarray() method now returns Uint8Array<ArrayBufferLike> which isn't assignable to ArrayBufferView<ArrayBuffer> expected by ReadableByteStreamController.enqueue().

Changes:

  • Changed ReadableStreamController<any>ReadableStreamDefaultController<Uint8Array> for precise typing
  • Added explicit ReadableStream<Uint8Array> type parameter
  • Replaced data.subarray(0, bytesRead) with new Uint8Array(data.buffer, data.byteOffset, bytesRead) for type compatibility

Both approaches create a view (not a copy) of the underlying buffer, so runtime behavior is unchanged.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@dotnet-policy-service
Copy link
Contributor

Greetings! You've submitted a PR that modifies code that is shared with https://github.com/dotnet/runtime . Please make sure you synchronize this code with the changes in that repo!

…ibility

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>
Copilot AI changed the title [WIP] Update npm packages for infrastructure [Infrastructure] Fix TypeScript build error for npm package update Dec 2, 2025
Copilot AI requested a review from javiercn December 2, 2025 15:30
Copilot finished work on behalf of javiercn December 2, 2025 15:30
@javiercn javiercn marked this pull request as ready for review December 2, 2025 15:32
@javiercn javiercn requested a review from a team as a code owner December 2, 2025 15:32
@javiercn javiercn merged commit 92a228b into infrastructure/update-npm-packages-2025-12-02 Dec 2, 2025
5 of 25 checks passed
@javiercn javiercn deleted the copilot/sub-pr-64592 branch December 2, 2025 15:33
javiercn added a commit that referenced this pull request Dec 2, 2025
* Updated npm packages 2025-12-02

* [Infrastructure] Fix TypeScript build error for npm package update (#64594)

* Initial plan

* Fix TypeScript build error in StreamingInterop.ts for TS 5.9.3 compatibility

Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: javiercn <6995051+javiercn@users.noreply.github.com>

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants