Use compressed WASM for even smaller webroot size
All checks were successful
check / stable / fmt (push) Successful in 21s
check / nightly / doc (push) Successful in 2m24s
check / ubuntu / stable / features (push) Successful in 2m27s
check / ubuntu / 1.87.0 (push) Successful in 2m18s

This commit is contained in:
2025-11-15 14:42:03 -06:00
parent 46892ec32c
commit 6329d000f5
2 changed files with 12 additions and 7 deletions

View File

@@ -112,7 +112,11 @@
<script type="module">
import init from './boids.js'
init().catch((error) => {
let compressed = await fetch("./boids_bg.wasm.gz")
let wasm_stream = compressed.body.pipeThrough(new DecompressionStream("gzip"))
let blob = await new Response(wasm_stream).blob();
init(await blob.arrayBuffer()).catch((error) => {
if (!error.message.startsWith("Using exceptions for control flow, don't mind me. This isn't actually an error!")) {
throw error;
}