Stop embedding sources/PDB in shipped WASM assemblies

Set EmbedAllSources=false and DebugType=portable in the root
Directory.Build.props so the demo and API-reference assemblies no longer
carry an embedded PDB containing full source. The embedded source is
deflate-compressed, so Brotli cannot reclaim it - it was inflating
RadzenBlazorDemos.wasm from ~1.3MB to ~4.2MB Brotli (and the lazy API
bundle similarly).

The packable Radzen.Blazor library is unaffected: it is governed by
Radzen.Blazor/Directory.Build.props and still ships embedded sources in
its .snupkg for consumer step-into-source debugging.
This commit is contained in:
Atanas Korchev
2026-06-22 12:58:07 +03:00
parent ccc3eaa93e
commit 5cd64c8ac9
2 changed files with 7 additions and 16 deletions

View File

@@ -47,21 +47,11 @@
<!-- Enable deterministic builds in CI/CD --> <!-- Enable deterministic builds in CI/CD -->
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild> <ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
<!-- Embed source files for better debugging --> <!-- Apps/tests/tools ship the DLL itself; embedded source can't be Brotli-recompressed and bloats the
<EmbedAllSources>true</EmbedAllSources> shipped .wasm (~3.5 MB on RadzenBlazorDemos). Portable PDBs aid local debugging but are not published
<!-- in a Release Blazor WASM build. snupkg source-embedding lives in Radzen.Blazor/Directory.Build.props. -->
IMPORTANT: <EmbedAllSources>false</EmbedAllSources>
- NuGet symbol packages (.snupkg) require portable PDB files. <DebugType>portable</DebugType>
- If DebugType=embedded, there are no standalone PDBs, so the .snupkg ends up effectively empty.
Use portable PDBs when symbols are enabled; otherwise use embedded for local debugging convenience.
-->
<!--
NOTE: Directory.Build.props is imported before project files, so properties like IncludeSymbols
set in a .csproj may not be available yet for Conditions here.
IsPacking *is* set by `dotnet pack`, so use that to switch DebugType for symbol packages.
-->
<DebugType Condition="'$(IsPacking)' == 'true'">portable</DebugType>
<DebugType Condition="'$(IsPacking)' != 'true'">embedded</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="Demos and Tests Project Configuration" Condition="$(MSBuildProjectName.Contains('Demos')) OR $(MSBuildProjectName.Contains('Tests'))"> <PropertyGroup Label="Demos and Tests Project Configuration" Condition="$(MSBuildProjectName.Contains('Demos')) OR $(MSBuildProjectName.Contains('Tests'))">

View File

@@ -47,7 +47,8 @@
<!-- Enable deterministic builds in CI/CD --> <!-- Enable deterministic builds in CI/CD -->
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild> <ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
<!-- Embed source files for better debugging --> <!-- Packable library only: embeds source into the .snupkg portable PDB for consumer step-into-source.
App projects override this to false in the root Directory.Build.props - do not re-sync that here. -->
<EmbedAllSources>true</EmbedAllSources> <EmbedAllSources>true</EmbedAllSources>
<!-- <!--
IMPORTANT: IMPORTANT: