Fyrd / caniuse

Raw browser/feature support data from caniuse.com
https://caniuse.com
Creative Commons Attribution 4.0 International
5.64k stars 1.38k forks source link

Streams API #2042

Closed pcad closed 7 years ago

pcad commented 9 years ago

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/

Ugoku commented 9 years ago

+1

friedemannsommer commented 9 years ago

+1

brettz9 commented 8 years ago

"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.

Schweinepriester commented 8 years ago

+1

https://jakearchibald.com/2016/streams-ftw/

jimmywarting commented 8 years ago

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

jimmywarting commented 7 years ago

3175

lpd-au commented 7 years ago

+1

ksm2 commented 7 years ago

+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') 
  }
});
lpd-au commented 7 years ago

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>
Fyrd commented 7 years ago

Now available at https://caniuse.com/#feat=streams

ksm2 commented 7 years ago

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