lukewagner / polyfill-prototype-1

Experimental WebAssembly polyfill library and tools
Apache License 2.0
241 stars 42 forks source link

A question about decoding while downloading #18

Open steelbrain opened 8 years ago

steelbrain commented 8 years ago

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

jdalton commented 8 years ago

And exclude Edge? No way ;)

lukewagner commented 8 years ago

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