-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReadableStreamReadResult interface is private #42970
Comments
Looking at the PR microsoft/TypeScript-DOM-lib-generator#890, it looks like the name changed to ReadableStreamDefaultReadResult. Does that work for you @johnBartos? |
@sandersn Not sure about @johnBartos ' case. But your above hint helped around here: Renaming the type occurence to Am I correct in understanding this would actually be a breaking change from a minor version bump of EDIT: Just being curious checked the web spec status, which however is inline with this change in the type-name, see https://streams.spec.whatwg.org/#dictdef-readablestreamdefaultreadresult However I don't understand why on a minor version bump the compiler doesn't provide a backward compatibility alias type here ... Even if you could deprecate the prior name somehow, adding a warning or so? |
First off all: I'm sorry for the inconvenience. I was the one who contributed this change to TypeScript 4.2. In earlier versions of the Streams standard, many types didn't have "official" definitions with standardized names. So when I wrote these type definitions, I took a best-effort guess to name them based on what we had earlier in
As far as I know, TypeScript doesn't follow semantic versioning. If you want to stay on the same minor version, you should use a tilde constraint like It's definitely not unusual for TypeScript to make breaking changes in the DOM types between minor releases. Pretty much every release notes article has a "lib.d.ts updates" section, giving a (non-exhaustive) list of changed types. The changes to the Streams types fit in that scheme. |
@MattiasBuelens Thx for the context |
Bug Report
π Search Terms
ReadableStream, ReadableStreamReadResult
π Version & Regression Information
β― Playground Link
Playground link with the bug (4.2.x)
Playground link without the bug (4.1.5)
π» Code
π Actual behavior
π Expected behavior
No type error
The text was updated successfully, but these errors were encountered: