Wasm binary optimization in dfx

I’ve been using ic-cdk-optimizer and am attempting to switch over to ic-wasm. These tools are essential for Azle and Kybra, the TypeScript and Python CDKs. One issue of complication that arises when developers try to use Azle and Kybra, is that each CDK must install ic-cdk-optimizer or ic-wasm for the developer, or expect them to install these tools. Requiring any kind of Rust tooling for TypeScript and Python devs is undesirable.

Basically, can we incorporate ic-wasm into the dfx build process somehow, especially so that developers don’t have to independently install ic-wasm?

1 Like
1 Like

Recorded feature request here.

Since this merged PR, dfx default to run ic-wasm shrink pass during canister build. No need to install ic-wasm binary.

This feather was included since dfx v0.12.0-beta.3.

1 Like

Does it do that with custom canisters?

Looks like it does according to the PR comments. Unfortunately ic-wasm shrink does not shrink the binary as much as ic-cdk-optimizer…so still can’t switch to ic-wasm