-
Notifications
You must be signed in to change notification settings - Fork 91
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
Split streams into more features #2491
base: main
Are you sure you want to change the base?
Split streams into more features #2491
Conversation
@jcscottiii FYI |
bd80ddb
to
eaa23a5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the differences in browser support and ship dates, I agree that it makes sense to split Streams into multiple sub-features. These seem separate enough to me.
That said, I don't have enough experience with streams to know whether that's also how developers think of them.
The key aspect we use to define features on this repo is developer perception.
Some of the questions we try to answer to split things up might be:
- Do web developers think of these features independently from each other?
- Can they use streams already without these later additions?
- Are these later additions improvements over the base feature?
- Is there evidence of these additions being talked about on the web (StackOverflow, blogs, etc.)?
Let us know your thoughts. I'm not saying this isn't the right way to split, merely just leaving thought to provoke conversation.
Beyond that, I made a few tiny description proposals. Also, this should probably be merged again on the latest main branch and dist files should be re-generated.
Yes, streams have been usable for quite a while, even before these recent additions.
Yes, these are all additive features. Generally, the objective has been to make streams easier to use, and better integrated with various parts of the Web Platform:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. Thank you for providing the detailed rationale about these sub-features.
I don't think this needs to block this PR, but I do have one follow-up question: should the parent streams feature be Baseline Widely Available then?
Looking at that feature, it uses compute_from
with the api.ReadableStreamBYOBReader
BCD key, which makes it not available on Safari. But, reading the Streams guide you provided, it feels like the streams feature should be baseline if the base use cases have been available for a while already.
Personally, I would like to see BYOB become a separate feature. It's a bit weird how e.g. Compression Streams (which builds upon Streams) is Baseline Newly Available, while Streams is only Baseline Limited Available. There was a discussion regarding BYOB as part of #2358. The decision there was to keep BYOB as part of the base feature, in order to match the status quo on https://caniuse.com/streams. We could consider splitting up the feature in both Baseline and caniuse, but I don't know what the impact of such a split would be on developers using this feature data today. 🤷♂️ |
Prompted by the discussion in web-platform-tests/wpt#49829, I had a look at the current list of features in the streams group. Currently, there's only the "base"
streams
feature and a singleasync-iterable-streams
extension for async iteration. However, there have been several additions over the years since we shipped BYOB support:ReadableStream.from(asyncIterable)
, added to the standard in June 2023 and shipped in Firefox 117Transformer.cancel()
, added to the standard in September 2023 but not yet shipping in any browserReadableStreamBYOBReader.read(view, {min})
, added to the standard in November 2023 and shipped in Firefox 134I suggest we add the following new features, and move them out of the base
streams
feature:transferable-streams
readablestream-from
transformstream-transformer-cancel
transformer.cancel
method toTransformStream
constructor mdn/browser-compat-data#25519readablestreambyobreader-read-min