-
Notifications
You must be signed in to change notification settings - Fork 163
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
Add typed ReadableStream<type> and WritableStream<type> #951
Comments
I'm -1 on this, as comments (i.e. things which don't impact the binding generation) are best done as actual comments. You can write
or similar if you'd prefer brevity. In particular, the problem here is that you could write We're actually discussing perhaps removing the |
@domenic Except it would, because WebIDL is normative, whereas comments are (probably?) not. In a perfect world where every API is backed by a precise algorithm, this might not matter, but that's not always the case.
Verification in bindings seems harder to do for outputs than inputs, yet there's precedence for using WebIDL to normatively specify aspects of outputs even when they can't be enforced. Specifically, the webrtc-stats spec uses Limiting what we can declare in WebIDL based on tooling's ability to enforce it today seems backwards to me, because WebIDL would appear to have declarative value even without any bindings at all.
That seems unfortunate. |
Additionally, for streams, chunk types may vary unless otherwise specified, so for APIs where they never will, it would seem useful to declare that they don't (or maybe using |
The WebTransport spec is full of WebIDL with comments like this one (third line):
Without this comment, it'd be hard to reason about what
incomingUnidirectionalStreams
gives you.I think
ReadableStream
andWritableStream
deserve the same treatment asPromise
here:This would follow a tradition of making I/O types part of an API's code signature, helping readers reason about call sites.
The text was updated successfully, but these errors were encountered: