Skip to content

fix(types): fix ponyfill TypeScript issues#107

Merged
Sec-ant merged 1 commit into
mainfrom
fix/ponyfill
May 4, 2026
Merged

fix(types): fix ponyfill TypeScript issues#107
Sec-ant merged 1 commit into
mainfrom
fix/ponyfill

Conversation

@Sec-ant
Copy link
Copy Markdown
Owner

@Sec-ant Sec-ant commented May 4, 2026

  • asyncIterator now returns ReadableStreamAsyncIterator and no longer exposes an internal branded generic; removed the unused TReturn generic from the public signature (breaking type change).
  • Add top-level "types" and a typesVersions map mirroring exports so type resolution works with classic node moduleResolution and node16/nodenext.
  • Polyfill installs ReadableStream.prototype.values and ReadableStream.prototype[Symbol.asyncIterator] with Web IDL-conformant descriptors (values enumerable, @@asynciterator non-enumerable) and guarantees both slots reference the same function object.
  • Update tests to cover descriptor behavior and runtime iterator shape.

Fixes #66

- asyncIterator now returns ReadableStreamAsyncIterator<T> and no longer
  exposes an internal branded generic; removed the unused TReturn
  generic
  from the public signature (breaking type change).
- Add top-level "types" and a typesVersions map mirroring exports so
  type
  resolution works with classic node moduleResolution and
  node16/nodenext.
- Polyfill installs ReadableStream.prototype.values and
  ReadableStream.prototype[Symbol.asyncIterator] with Web IDL-conformant
  descriptors (values enumerable, @@asynciterator non-enumerable) and
  guarantees both slots reference the same function object.
- Update tests to cover descriptor behavior and runtime iterator shape.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 4, 2026

🦋 Changeset detected

Latest commit: 87bee9d

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 4, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@sec-ant/readable-stream@107

commit: 87bee9d

@Sec-ant Sec-ant merged commit bf594cf into main May 4, 2026
4 checks passed
@Sec-ant Sec-ant deleted the fix/ponyfill branch May 4, 2026 12:19
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.

Typescript issues with ponyfill

1 participant