smoldot icon indicating copy to clipboard operation
smoldot copied to clipboard

wasm-node: use native inflate implementation when available

Open tomaka opened this issue 4 years ago • 2 comments

After https://github.com/paritytech/smoldot/pull/1801, the wasm node decompresses the smoldot wasm bytecode before executing it. This is done with the pako library.

NodeJS has https://nodejs.org/api/zlib.html, but browsers don't have any equivalent yet. However I see that https://developer.mozilla.org/en-US/docs/Web/API/DecompressionStream is in progress. If one day it is available then we should make use of it.

tomaka avatar Dec 17 '21 08:12 tomaka

After https://github.com/paritytech/smoldot/pull/2519 it will be possible to use the NodeJS native API and the Deno native API. Only browsers will need to do the decompression using JS code.

tomaka avatar Jul 18 '22 07:07 tomaka

cc https://mozilla.github.io/standards-positions/#compression-streams

tomaka avatar Sep 29 '22 11:09 tomaka