Skip to content

ci: optimize wasm build#8

Merged
alvgaona merged 1 commit into
mainfrom
ci/wasm-opt-release
Jul 7, 2026
Merged

ci: optimize wasm build#8
alvgaona merged 1 commit into
mainfrom
ci/wasm-opt-release

Conversation

@alvgaona

@alvgaona alvgaona commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

The release wasm grew to ~125 MiB in v0.5.0 (Rerun 0.34), over wrangler r2 object put's single-request limit. That failed the deploy-wasm job and left app.rewire.run with the new rewire_viewer.js paired with the stale v0.4.0 wasm (a wasm-bindgen ABI mismatch = broken viewer). This adds wasm-opt -Oz to the build-wasm job so the deployed wasm is shrunk before upload.

Changes

  • release.yaml build-wasm: install binaryen, run wasm-opt -Oz on the wasm-bindgen output before packaging/upload.

Verified locally on the v0.5.0 wasm: 125 MiB to 87 MiB (31% smaller), export ABI preserved (84 exports incl. memory / __wbindgen_malloc / __wbindgen_free), so it stays compatible with rewire_viewer.js. Also faster for users. The R2 object stays uncompressed so Cloudflare's edge keeps brotli-compressing it.

Related

  • REW-183. Fixes the v0.5.0 deploy-wasm failure.

Checklist

  • PR title follows Conventional Commits
  • Workflow-only change; wasm-opt -Oz result validated locally (size + ABI). The step runs on the next tag.

Breaking changes

None.

@alvgaona alvgaona changed the title ci: wasm-opt -Oz the release wasm so it fits the R2 upload limit ci: optimize wasm build Jul 7, 2026
@alvgaona alvgaona merged commit e69d5c6 into main Jul 7, 2026
4 checks passed
@alvgaona alvgaona deleted the ci/wasm-opt-release branch July 7, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant