Nightly Rust needed for building std
wasm_bindgen_convert_closures_invoke3_mut_h6effd6ec78924e06
find out why it allocates and fix that
wasm-pack build --profiling . -- -Z build-std=core,alloc,std,panic_abort -Z build-std-features=panic_immediate_abort && wasm2wat pkg/nano_web_bg.wasm -o pkg/nano_web_bg.wat && ls -lh ./pkg/
cargo install --path ../wasm-bindgen/crates/cli
wasm-pack build --mode no-install --release . -- -Z build-std=core,std,panic_abort -Z build-std-features=panic_immediate_abort && ls -l pkg/ && ls -lh pkg/ && wasm2wat pkg/nano_web_bg.wasm -o pkg/nano_web_bg.wat
# bundler, nodejs, web, no-modules
cargo expand --target wasm32-unknown-unknown
# https://github.com/rustwasm/wasm-bindgen/blob/main/crates/web-sys/src/lib.rs
# https://github.com/rustwasm/wasm-bindgen/blob/main/src/convert/closures.rs
# the wat format is pretty good
twiggy top -n 20 pkg/nano_web_bg.wasm
cargo rustc --release -- --emit llvm-ir
find target/release -type f -name '*.ll'
https://rustwasm.github.io/docs/book/reference/code-size.html