fix(web): restore bounded-memory wasm release profile

Reapply aiongg commit 1848c17350 (#15508), reverted by 435d6e5. Preserve newer test profiles, optimization levels and browser package size gate. Independently source-reviewed; locked offline metadata passed. Fresh hosted browser validation remains required.
This commit is contained in:
aiongg authored and Dylan M. Taylor committed 2026-11-18 08:36:32 -05:00
1 parent 9e934c6e0e
commit b4511d21ca
1 file changed
+6 -3
+6 -3
View File
@@ -243,16 +243,19 @@ codegen-units = 1
# The browser build (apps/photocraft-web, `data-cargo-profile` in its index.html). Hosts cap the
# size of a single file (Cloudflare Pages/Workers: 25 MiB), and the wasm is downloaded on every
# visit, so this profile optimizes for size: fat LTO, opt-level "z" for PhotoCraft's own crates,
# visit, so this profile optimizes for size: opt-level "z" for PhotoCraft's own crates,
# "s" for dependencies and for the crates that decode files, and 3 for pixel processing (filters
# and compositing). Dependencies stay at "s": at "z" the whole wasm grows (by 0.4 MB, measured).
# panic stays the target default (wasm32-unknown-unknown aborts; AGENTS.md's `panic = "unwind"`
# is for the native app shell). packaging/web/package.sh fails the build above 24 MiB.
# Thin LTO over 16 codegen units keeps the link step near 8 GB, inside a 16 GB CI runner (one
# fat-LTO unit needs about 21 GB); after trunk's wasm-opt -Oz the wasm is within 3% of the
# fat-LTO size (71.6 MB against 69.7 MB, measured).
[profile.wasm-release]
inherits = "release"
opt-level = "z"
lto = "fat"
codegen-units = 1
lto = "thin"
codegen-units = 16
strip = "debuginfo"
[profile.wasm-release.package."*"]