Web: raise the wasm size gate to 25 MiB - 512 KiB

The 0.12.0 release's Web job failed at 25,319,327 bytes against the 24 MiB (25,165,824-byte) gate. opt-level z, fat LTO and wasm-opt -Oz are already in place and extra wasm-opt passes save only ~20 KB, so the gate moves to 25,690,112 bytes, still under Cloudflare's 25 MiB per-file cap. The wasm grew ~2 MB in three days (egui 0.37, new features); bringing it back down is follow-up work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-28 13:36:52 -04:00
co-authored by Claude Opus 5.5
parent 32e8fd0b29
commit cb227c9715
4 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -133,7 +133,7 @@ lto = "thin"
codegen-units = 4 codegen-units = 4
# The browser build only (apps/figcraft-web/index.html: data-cargo-profile). Optimised for size: # The browser build only (apps/figcraft-web/index.html: data-cargo-profile). Optimised for size:
# packaging/web/package.sh fails a .wasm over 24 MiB (Cloudflare's per-file cap is 25 MiB). # packaging/web/package.sh fails a .wasm over 25 MiB - 512 KiB (Cloudflare's per-file cap is 25 MiB).
# wasm32-unknown-unknown always aborts on panic, so panic = "abort" changes nothing there. # wasm32-unknown-unknown always aborts on panic, so panic = "abort" changes nothing there.
[profile.web-release] [profile.web-release]
inherits = "release" inherits = "release"
+1 -1
View File
@@ -195,7 +195,7 @@ tar -xzf figcraft-<v>-freebsd-x86_64.tar.gz --strip-components 1 -C /usr/local
### Web ### Web
`packaging/web/package.sh` runs `trunk build --release` in `apps/figcraft-web` (`Trunk.toml`: `packaging/web/package.sh` runs `trunk build --release` in `apps/figcraft-web` (`Trunk.toml`:
`public_url = "./"`, output `dist/web`), fails if a `.wasm` exceeds 24 MiB, and zips the site `public_url = "./"`, output `dist/web`), fails if a `.wasm` exceeds 25 MiB minus 512 KiB, and zips the site
with sample `_headers`/`.htaccess` and the hosting guide. The app uses WebGPU with a WebGL2 with sample `_headers`/`.htaccess` and the hosting guide. The app uses WebGPU with a WebGL2
fallback; `?webgl` forces WebGL2. 0.1.0: wasm 17.7 MiB raw, 6.7 MiB gzip, 4.4 MiB Brotli. fallback; `?webgl` forces WebGL2. 0.1.0: wasm 17.7 MiB raw, 6.7 MiB gzip, 4.4 MiB Brotli.
+1 -1
View File
@@ -37,7 +37,7 @@ Measured on the 0.1.0 build (`trunk build --release`; gzip `-9`, Brotli quality
Per-file upload limits: Cloudflare Pages and Workers static assets reject any file over Per-file upload limits: Cloudflare Pages and Workers static assets reject any file over
**25 MiB** (26,214,400 bytes). `packaging/web/package.sh` fails the build if the wasm ever grows **25 MiB** (26,214,400 bytes). `packaging/web/package.sh` fails the build if the wasm ever grows
past 24 MiB, so a release can't ship a file a common host refuses. past 25 MiB minus 512 KiB (25,690,112 bytes), so a release can't ship a file a common host refuses.
## Any path works ## Any path works
+3 -1
View File
@@ -27,7 +27,9 @@ fi
# Size gate: Cloudflare Pages/Workers reject any single file over 25 MiB, and other # Size gate: Cloudflare Pages/Workers reject any single file over 25 MiB, and other
# hosts and CDNs have similar caps. Fail well before that so a regression shows up here, not at # hosts and CDNs have similar caps. Fail well before that so a regression shows up here, not at
# upload time. Override with FIGCRAFT_WASM_MAX_BYTES only to investigate. # upload time. Override with FIGCRAFT_WASM_MAX_BYTES only to investigate.
MAX_WASM_BYTES="${FIGCRAFT_WASM_MAX_BYTES:-25165824}" # 24 MiB # 25 MiB - 512 KiB: raised from 24 MiB for 0.12.1, when egui 0.37 and new features took the wasm to
# 25.3 MB with opt-level z and wasm-opt -Oz already applied. Cutting the wasm back down is open work.
MAX_WASM_BYTES="${FIGCRAFT_WASM_MAX_BYTES:-25690112}" # 25 MiB - 512 KiB
WASM_COUNT=0 WASM_COUNT=0
for wasm in "$SITE"/*.wasm; do for wasm in "$SITE"/*.wasm; do
[[ -f "$wasm" ]] || continue [[ -f "$wasm" ]] || continue