Skip to content

Commit 6eff684

Browse files
committed
Switch BrowserWasm from Blazor AOT to NativeAOT-LLVM
Replace Microsoft.NET.Sdk.WebAssembly with Microsoft.NET.Sdk and PublishAot/IsAotCompatible. Strip all Blazor-specific properties (RunAOTCompilation, WasmBuildNative, WasmStripILAfterAOT, WasmRunWasmOpt, size-reduction flags). Same AOT pipeline as Motely.NodeAddon now. https://claude.ai/code/session_019weRHQbABp2dzatqkp2aKV
1 parent 1dabb20 commit 6eff684

File tree

2 files changed

+20
-35
lines changed

2 files changed

+20
-35
lines changed

Motely.BrowserWasm/Motely.BrowserWasm.SingleThread.csproj

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>net10.0-browser</TargetFramework>
4+
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
5+
<OutputType>Exe</OutputType>
46
<Version>$(MotelyVersion)</Version>
57
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
68
<Nullable>enable</Nullable>
79
<ImplicitUsings>enable</ImplicitUsings>
810
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
9-
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
10-
<RunAOTCompilation>true</RunAOTCompilation>
11-
<PublishReadyToRun>false</PublishReadyToRun>
1211

13-
<!-- Single-thread: NO threading, NO SharedArrayBuffer -->
14-
<WasmBuildNative>true</WasmBuildNative>
12+
<!-- NativeAOT-LLVM -->
13+
<PublishAot>true</PublishAot>
14+
<IsAotCompatible>true</IsAotCompatible>
15+
16+
<!-- Single-threaded: no SharedArrayBuffer required -->
1517
<WasmEnableThreads>false</WasmEnableThreads>
1618
<WasmEnableSIMD>true</WasmEnableSIMD>
1719

18-
<!-- Trimming & Optimization -->
20+
<!-- Trimming -->
1921
<PublishTrimmed>true</PublishTrimmed>
2022
<TrimMode>full</TrimMode>
21-
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
22-
23-
<!-- SIZE REDUCTION -->
24-
<WasmIncludeFullSymbols>false</WasmIncludeFullSymbols>
25-
<WasmDebugLevel>0</WasmDebugLevel>
26-
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
27-
<WasmEmitCompressedAssets>false</WasmEmitCompressedAssets>
2823

24+
<!-- No ICU -->
2925
<InvariantGlobalization>true</InvariantGlobalization>
30-
<WasmRunWasmOpt>true</WasmRunWasmOpt>
3126
</PropertyGroup>
3227

3328
<ItemGroup>

Motely.BrowserWasm/Motely.BrowserWasm.csproj

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
1-
<Project Sdk="Microsoft.NET.Sdk.WebAssembly">
2-
<!-- Do NOT add Content Include="wwwroot\**" - SDK includes wwwroot automatically; duplicate causes NETSDK1022 -->
1+
<Project Sdk="Microsoft.NET.Sdk">
32
<PropertyGroup>
43
<TargetFramework>net10.0-browser</TargetFramework>
4+
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
5+
<OutputType>Exe</OutputType>
56
<Version>$(MotelyVersion)</Version>
67
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
78
<Nullable>enable</Nullable>
89
<ImplicitUsings>enable</ImplicitUsings>
910
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
10-
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
11-
<RunAOTCompilation>true</RunAOTCompilation>
12-
<PublishReadyToRun>false</PublishReadyToRun>
1311

14-
<!-- AOT & Native Build -->
15-
<WasmBuildNative>true</WasmBuildNative>
16-
<!-- Pass -p:SingleThread=true to publish without threading (browsers without SharedArrayBuffer) -->
12+
<!-- NativeAOT-LLVM -->
13+
<PublishAot>true</PublishAot>
14+
<IsAotCompatible>true</IsAotCompatible>
15+
16+
<!-- SIMD & Threading -->
1717
<SingleThread Condition="'$(SingleThread)' == ''">false</SingleThread>
1818
<WasmEnableThreads Condition="'$(SingleThread)' != 'true'">true</WasmEnableThreads>
1919
<WasmEnableThreads Condition="'$(SingleThread)' == 'true'">false</WasmEnableThreads>
2020
<WasmEnableSIMD>true</WasmEnableSIMD>
2121

22-
<!-- Trimming & Optimization -->
22+
<!-- Trimming -->
2323
<PublishTrimmed>true</PublishTrimmed>
2424
<TrimMode>full</TrimMode>
25-
<WasmStripILAfterAOT>true</WasmStripILAfterAOT>
26-
27-
<!-- SIZE REDUCTION -->
28-
<WasmIncludeFullSymbols>false</WasmIncludeFullSymbols>
29-
<WasmDebugLevel>0</WasmDebugLevel>
30-
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
31-
<WasmEmitCompressedAssets>false</WasmEmitCompressedAssets>
3225

33-
<!-- Globalization: Search doesn't need ICU data (~2.5MB saved) -->
26+
<!-- No ICU -->
3427
<InvariantGlobalization>true</InvariantGlobalization>
35-
36-
<!-- Re-enabled: testing with Binaryen 117 from .NET 10 Emscripten pack -->
37-
<WasmRunWasmOpt>true</WasmRunWasmOpt>
3828
</PropertyGroup>
3929

4030
<ItemGroup>

0 commit comments

Comments
 (0)