Large WebAssembly builds with Rust and regex
.wasm file size was about 720K for a ~100 line function (plus dependencies, of course).
Working through the code size guide eventually made it clear that the regex crate was contributing a lot to the total size. Removing it brought the size down to ~24K. And I got to learn about parser combinators with nom!
This appears to be one of the fundamental points of friction when using WASM. Either compile in everything you need (increasing filesize) or inject it from the host environment (increasing complexity). In fact, one of the reasons Rust is so well suited to WASM is that doesn’t need to bring an entire garbage collector.