| name | dotnet-aot-wasm |
| category | performance |
| subcategory | aot |
| description | Compiles .NET to WebAssembly AOT. Blazor/Uno WASM, size vs speed, lazy loading, Brotli. |
| license | MIT |
| targets | ["*"] |
| tags | ["aot","dotnet","skill"] |
| version | 0.0.1 |
| author | dotnet-agent-harness |
| invocable | true |
| claudecode | {"allowed-tools":["Read","Grep","Glob","Bash","Write","Edit"]} |
| codexcli | {"short-description":".NET skill guidance for aot tasks"} |
| opencode | {"allowed-tools":["Read","Grep","Glob","Bash","Write","Edit"]} |
| copilot | {} |
| geminicli | {} |
| antigravity | {} |
dotnet-aot-wasm
WebAssembly AOT compilation for Blazor WASM and Uno WASM applications: compilation pipeline, download size vs runtime
speed tradeoffs, trimming interplay, lazy loading assemblies, and Brotli pre-compression for download optimization.
Version assumptions: .NET 8.0+ baseline. Blazor WASM AOT shipped in .NET 6 and has been refined through .NET 8-10.
Uno WASM uses a similar compilation pipeline with Uno-specific tooling.
Important tradeoff: Trimming and AOT have opposite effects on WASM artifact size. Trimming reduces download size
by removing unused code. AOT increases artifact size (native WASM code is larger than IL) but improves runtime
execution speed. Use both together for the best balance.
Scope
- Download size vs runtime speed tradeoff analysis
- Blazor WASM AOT (RunAOTCompilation, selective AOT)
- Uno WASM AOT (.NET 8+ standard workload)
- Lazy loading assemblies for size reduction
- Brotli pre-compression for download optimization
- WASM size optimization checklist
Out of scope
- Native AOT for server-side .NET -- see [skill:dotnet-native-aot]
- AOT-first design patterns -- see [skill:dotnet-aot-architecture]
- Trim-safe library authoring -- see [skill:dotnet-trimming]
- MAUI-specific AOT -- see [skill:dotnet-maui-aot]
- Blazor hosting models and render modes -- see [skill:dotnet-blazor-patterns]
- Blazor component lifecycle and JS interop -- see [skill:dotnet-blazor-components]
- Uno Platform architecture -- see [skill:dotnet-uno-platform]
Cross-references: [skill:dotnet-native-aot] for general AOT pipeline, [skill:dotnet-trimming] for trimming annotations,
[skill:dotnet-aot-architecture] for AOT-safe design patterns, [skill:dotnet-serialization] for AOT-safe serialization,
[skill:dotnet-csharp-source-generators] for source gen as AOT enabler, [skill:dotnet-blazor-patterns] for Blazor
architecture (soft), [skill:dotnet-uno-platform] for Uno Platform patterns (soft).
Download Size vs Runtime Speed
Understanding the size/speed tradeoff is critical for WASM AOT decisions:
| Compilation Mode | Download Size | Runtime Speed | Startup Time |
|---|
| IL interpreter (no AOT) | Smallest | Slowest | Fastest startup |
| AOT (all assemblies) | Largest | Fastest | Slower startup |