-
Notifications
You must be signed in to change notification settings - Fork 8
Let's do this #1
Comments
What about https://github.com/MattiasBuelens/web-streams-polyfill ? CC @MattiasBuelens Some ideas:
Note that as far as I know ReadableStreams in Chrome don't have Symbol.asyncIterator yet. @devsnek was talking about adding support. If he doesn't have time it looks like a reasonably simple PR to make against ReadableStream.js |
@devsnek has a PR for Symbol.asyncIterator at whatwg/streams#954. There's also some in-progress tests linked from that PR. It shouldn't take much more to push it over the finish line. You could probably do something similar to https://github.com/whatwg/streams/blob/master/reference-implementation/run-web-platform-tests.js to run the web platform tests. |
if anyone wants to pick that spec change up, I'm probably not going to get around to it again until january. |
If anybody is interested...it should be fairly trivial to reuse |
We really should change all the streams tests to use .any.js. But, doing so would slow down our (the streams standard editors') development workflow unless we also fixed my https://github.com/domenic/wpt-runner project at the same time, since we use that for the whatwg/streams reference implementation development. If someone has the time to do those things, then the tests would be in the .any.js format that are friendly to @joyeecheung's tooling. |
I can probably help with the If needed, I could also help finish the async iterator tests afterwards. But if someone else wants to continue that effort, that's totally fine as well. 🙂 |
Would you like to schedule a quick call in the next two weeks to talk about the details on making this happen? Otherwise, let's open a few issues and start cracking them.
I agree with @benjamingr on the goals. We should really decide if we would like to write our own implementation, or start of from the Chrome one or the polyfill. I did reserve the name and added nodejs-foundation. Let me know if somebody else would like to have the publish bit. Overall let's time for that. |
Refactored streams tests have landed in web-platform-tests/wpt#14172. Hopefully these are now easier to adopt in Node. 🙂 |
What's the latest? |
No one has time/passion/money for building this apparently. |
I'd be willing to help, but I don't really know where we want to go with this. 🤷 I can give a quick status update on some of the previous ideas though:
As explained in my previous comment, these tests are now in
I believe Chrome has replaced their initial JavaScript implementation with a C++ one. I don't know if Node would want to adopt a C++ implementation, or prefer a JavaScript one? Other implementations which could be used as a starting point:
|
I think so, maybe @joyeecheung can help. Regarding the implementation of this spec, I think we can start by using your ponyfill. I guess the Chrome team moved the streams implementation to C++ for performance reasons: I think we might want to do that in the long run. I'll be happy to review a PR. |
I'm not sure I'm still +1 on this, I'm +0 or -0 on this. I am definitely +1 on experimenting and seeing what core whatwg-stream support looks like though. I'm honestly not sure that people have been asking for this (web stream support) often enough for it to be worth the maintenance burden in core rather than in userland (especially given Deno's negative experience). What about a blessed model based on the ponyfill ( I think it would make sense for Node utility methods to take whatwg streams if possible (as async iterables or otherwise) but I am personally not sure it makes sense in core given how complex streams are and given how hard maintaining streams has been traditionally in Node.js. This is true especially compared to alternative web APIs (like EventTarget, AbortController and URL) where the API is arguably a lot simpler and a lot easier to reason about. |
I've started experimenting in #3. 👨🔬
I agree, this should probably live in userland for now. Most browsers only implement a small part of the WHATWG streams spec, and even Chromium does not yet implement readable byte streams with BYOB readers. Maybe we should not even ship the entire ponyfill yet, but only what is supported by most browsers? 🤷
That could work. It's sort of what I'm aiming for with #3: first make the ponyfill and tests work in this (separate) package, so we can later on more easily move the tests or the whole package into Node core (if we want).
Indeed, async iterables provide a nice compatibility interface between Node We could look into adding additional adapter methods for the other streams, like |
now that core has whatwg streams, this repo can probably be decommissioned ye? |
I think so |
Yes, as I said earlier, this repo has become obsolete. |
Hi Folks,
I would like to get this initiative kicked off. How would you like to work on this? Should we go forward and lift the implementation from Chromium? Or should we do it from scratch? Would you like to set up a quick meeting?
I pushed in some bits and bobs for our boilerplate, feel free to send PRs - I definitely did not put in all the needed documents.
Of course, if there are more people that would like to help with this, you are welcome to join!
The text was updated successfully, but these errors were encountered: