Shell follow-ups: CI cargo caching and wasm-opt for the bundle #26

Closed
opened 2026-07-21 05:15:51 +00:00 by coilyco-ops · 0 comments
Member

Two deferred items from the #18 shell landing, both quality-of-life rather than blockers.

1. CI cargo caching. With factory_shell in the workspace, every cargo test --workspace in CI pays a cold Bevy compile inside a fresh container. The gate timeout was raised to 30 minutes to absorb it (#24 commit 41fbc51), but a cache would cut most runs to a fraction. Options: actions/cache over ~/.cargo/registry + target/ keyed on Cargo.lock, or a runner-local shared cache dir if the Forgejo runner supports it. Watch out for cache size - Bevy target dirs are multi-GB, so a registry-only cache may be the sane first step.

2. wasm-opt. The shell's release wasm bundle is 76MB un-optimized (data-wasm-opt="0" in index.html - strip is a no-op for wasm). nginx gzip blunts the wire cost but wasm-opt would cut the raw size several-fold. When enabling it, use the upstream binaryen release, not Debian's - the galaxy-gen Dockerfile documents the WebAssembly.Table.grow instantiation bug the Debian build triggers. This should land with or before the #16 viewer implementation, which will grow the bundle further.

Neither item changes shell behavior. Acceptance: CI median run time drops meaningfully with caching, and the deployed bundle shrinks with wasm-opt while still rendering in Chrome.

Two deferred items from the #18 shell landing, both quality-of-life rather than blockers. **1. CI cargo caching.** With `factory_shell` in the workspace, every `cargo test --workspace` in CI pays a cold Bevy compile inside a fresh container. The gate timeout was raised to 30 minutes to absorb it (#24 commit `41fbc51`), but a cache would cut most runs to a fraction. Options: `actions/cache` over `~/.cargo/registry` + `target/` keyed on `Cargo.lock`, or a runner-local shared cache dir if the Forgejo runner supports it. Watch out for cache size - Bevy target dirs are multi-GB, so a registry-only cache may be the sane first step. **2. wasm-opt.** The shell's release wasm bundle is 76MB un-optimized (`data-wasm-opt="0"` in index.html - `strip` is a no-op for wasm). nginx gzip blunts the wire cost but wasm-opt would cut the raw size several-fold. When enabling it, use the upstream binaryen release, not Debian's - the galaxy-gen Dockerfile documents the `WebAssembly.Table.grow` instantiation bug the Debian build triggers. This should land with or before the #16 viewer implementation, which will grow the bundle further. Neither item changes shell behavior. Acceptance: CI median run time drops meaningfully with caching, and the deployed bundle shrinks with wasm-opt while still rendering in Chrome.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/factory-game-v3#26
No description provided.