polyfill-prototype-1 icon indicating copy to clipboard operation
polyfill-prototype-1 copied to clipboard

A question about decoding while downloading

Open steelbrain opened this issue 9 years ago • 2 comments

Decode while downloading (using HTTP Range requests or splitting into separate files)

Since WebAssembly is targeted at newer browsers, how about you guys use the new fetch API for this, you would be able to use the data as it's received and all that in a single http request, no more ranges.

Link: MDN fetch

steelbrain avatar Dec 18 '15 21:12 steelbrain

And exclude Edge? No way ;)

jdalton avatar Dec 18 '15 22:12 jdalton

Does the Fetch API provide the ability to stream in data before the Streams API has landed (which I didn't think was anywhere yet)?

Regardless, Fetch is pretty new and the polyfill would want to support as many browsers as it could so, realistically, it would use feature detection and use the best thing it could, falling back on XHR. E.g., IE (Edge still?) has ms-stream and Firefox has moz-chunk-arraybuffer.

I should also note that this repo is not being actively worked on. Alon is working on a high-performance polyfill based on a similar strategy in Binaryen, though that I think will be evolved into something industrial strength (where these streaming techniques could help).

lukewagner avatar Dec 19 '15 01:12 lukewagner