Closed pcad closed 7 years ago
+1
+1
"Stream API" currently shows up along with getUserMedia
so if implemented independently (e.g., for the sake of indicating Ajax support of streams), it seems to me that that reference also ought to be tweaked.
I think ms-stream is faaaar from the specification that it would not earn the title of just being only prefix with ms.
they made there own api. Also worth mentioning that it isn't really streaming, when you buffer up the hole memory
+1
+1 I added a PR for a feature JSON. Maybe someone can help me with the tests. I think primarily we would have to check the following:
// Test exposed globals
typeof window.ReadableStream !== 'undefined';
typeof window.WritableStream !== 'undefined';
typeof window.ByteLengthQueuingStrategy !== 'undefined';
typeof window.CountQueuingStrategy !== 'undefined';
// Test ReadableStreamDefaultReader
Object.getPrototypeOf((new window.ReadableStream).getReader({ mode: undefined })).constructor.name === 'ReadableStreamDefaultReader';
// Test ReadableStreamBYOBReader
Object.getPrototypeOf((new window.ReadableStream).getReader({ mode: 'byob' })).constructor.name === 'ReadableStreamBYOBReader';
// Test ReadableStreamDefaultController
new window.ReadableStream({
start(controller) {
console.log(Object.getPrototypeOf(controller).constructor.name === 'ReadableStreamDefaultController')
}
});
// Test ReadableByteStreamController
new window.ReadableStream({
type: 'bytes',
start(controller) {
console.log(Object.getPrototypeOf(controller).constructor.name === 'ReadableByteStreamController')
}
});
There's more info about the test suite here: https://tests.caniuse.com/submit.html
The fetch test only checks the relevant object exist, so I think your approach should be fine:
<script>
setResult('fetch0', 'fetch' in window);
</script>
Now available at https://caniuse.com/#feat=streams
Hey @Fyrd, I guess that we have to adjust the tests for pipeTo
/ pipeThrough
.
Actually, Firefox is not supporting the functionality, but there are already dummy functions which just throw a type error, so typeof ... === "function"
equals true. 🙄
Could you add the following checks within the try/catch block to fix it?
const rs1 = new ReadableStream();
rs1.pipeTo(new WritableStream());
const rs2 = new ReadableStream();
rs2.pipeThrough({ writable: new WritableStream(), readable: new ReadableStream() });
I also updated my gist, https://gist.github.com/ksm2/890bf989629e1afe6b704fdfae3f97aa#file-streams-test-html-L47-L63
Thanks a lot, Konstantin
A Streams API is available as a working draft specification through whatwg:
https://streams.spec.whatwg.org/
Some user agents also have implementations:
https://dev.modern.ie/platform/status/streamsapi/