unoplatform / Uno.Wasm.Bootstrap

A simple nuget package to run C# code in a WASM-compatible browser
Other
364 stars 57 forks source link

Add zstd to wasm #836

Open easy28 opened 4 months ago

easy28 commented 4 months ago

What would you like to be added

Add an option to generate zstd files for wasm head.

Why is this needed

zstd is generally faster and provides better compression ratio than br.

For which platform

WebAssembly

Anything else we need to know?

Chrome support zstd by default, expect smaller download size if zstd added.

jeromelaban commented 4 months ago

Thanks for the suggestion.

Note for contributors

The implementation for this provided here: https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/9b559fc9a8b5e939fd99fa119a243e760ae3770d/src/Uno.Wasm.Bootstrap/ShellTask.cs#L498

With compression handlers provided here: https://github.com/unoplatform/Uno.Wasm.Bootstrap/blob/9b559fc9a8b5e939fd99fa119a243e760ae3770d/src/Uno.Wasm.Bootstrap/ShellTask.cs#L546

There are likely some additional considerations to provide around the availability of a .NET implementation or wrapper for zstd, as well as server-side support for such compressed files, such as azure static apps.