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

Streams API #2042

Closed
pcad opened this Issue Oct 20, 2015 · 11 comments

Comments

Projects
None yet
9 participants
@pcad

pcad commented Oct 20, 2015

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

This comment has been minimized.

Show comment
Hide comment
@Ugoku

Ugoku Oct 21, 2015

Contributor

+1

Contributor

Ugoku commented Oct 21, 2015

+1

@friedemannsommer

This comment has been minimized.

Show comment
Hide comment
@brettz9

This comment has been minimized.

Show comment
Hide comment
@brettz9

brettz9 Dec 14, 2015

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

brettz9 commented Dec 14, 2015

"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

This comment has been minimized.

Show comment
Hide comment
@jimmywarting

This comment has been minimized.

Show comment
Hide comment
@jimmywarting

jimmywarting Jun 29, 2016

Contributor

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

Contributor

jimmywarting commented Jun 29, 2016

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

This comment has been minimized.

Show comment
Hide comment
Contributor

jimmywarting commented May 26, 2017

@lpd-au

This comment has been minimized.

Show comment
Hide comment
@lpd-au

lpd-au Sep 19, 2017

Contributor

+1

Contributor

lpd-au commented Sep 19, 2017

+1

@ksm2

This comment has been minimized.

Show comment
Hide comment
@ksm2

ksm2 Sep 30, 2017

Contributor

+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') 
  }
});
Contributor

ksm2 commented Sep 30, 2017

+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

This comment has been minimized.

Show comment
Hide comment
@lpd-au

lpd-au Oct 2, 2017

Contributor

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>
Contributor

lpd-au commented Oct 2, 2017

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

This comment has been minimized.

Show comment
Hide comment
Owner

Fyrd commented Oct 9, 2017

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

@Fyrd Fyrd closed this Oct 9, 2017

@ksm2

This comment has been minimized.

Show comment
Hide comment
@ksm2

ksm2 Oct 23, 2017

Contributor

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

Contributor

ksm2 commented Oct 23, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment