-
Notifications
You must be signed in to change notification settings - Fork 30
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
Convert from/to native streams? #1
Comments
Some more thoughts on this... Right now, the polyfill always replaces the global stream implementations. However, if the native implementation were fully spec-compliant, the polyfill should detect this and simply use the native implementation. (At the moment, Chrome 68 is the closest to full compliance, supporting everything except for readable byte streams.) If the polyfill would re-export the native implementation, then we can't provide |
Looks like the spec is planing on adding It could serve as a grate utility to convert the polyfill stream to/from a native one (until you are using native streams - #20) maybe could have two implementation in the meanwhile?
all doe the later one would quickly be obsolete when you are using native streams. |
Good idea! 👍 Indeed, if I'll keep it in mind when I (eventually) get to this. Right now, I'm keeping an eye on the ongoing work for converting the spec to WebIDL, in particular on the functional changes that will be needed for the polyfill... 👀 |
Hi, any progress on implementing using NodeJS specific things makes my code less cross env compatible with other runtimes. |
@jimmywarting Sorry for the long delay! I finally implemented As for the So I came up with a new plan:
Hopefully I should get that out of the door in a shorter timeframe. 😅 |
Right now, this project is just a polyfill: it implements the streams specification, and that's it. In reality though, you may need to inter-operate with non-polyfilled streams, e.g. when using web APIs that consume or produce native streams. In that case, you need a way to convert between native streams and polyfilled streams.
web-streams-adapter
provides a low-level API to do such conversions between any stream implementation. For this polyfill, it might be interesting to provide an easier way to convert from/to a polyfilled stream.These could be provided as static utility methods:
or exported separately:
Any thoughts on this API?
The text was updated successfully, but these errors were encountered: