-
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
Rewrite TransformStream using the public API #105
Conversation
I'm seeing all this |
I still ship a build for ES5, so I have to be very careful with what syntax features I can or cannot use. The down-level emit for private fields uses I could move everything into a semi-private |
I'm not sure if typescript can handle that down leveling for you, don't use typescript... |
I could throw Babel into the mix and use the It would make the brand checks nicer though, since you can do Anyway, I'll leave that for another time. 😛 |
This re-implements
TransformStream
to use the public API ofReadableStream
andWritableStream
, rather than using internal abstract ops. The idea is that, in the future, we could construct a polyfillTransformStream
on top of a nativeReadableStream
and/orWritableStream
.This also adds partial support for
WritableStreamDefaultController.signal.reason
, which we use to detect whenwritable.abort(reason)
is called. We do have to "cheat" a bit here, sinceAbortSignal.reason
may not yet be supported everywhere andweb-streams-polyfill
does not attempt to polyfill this API by itself.