Skip to content

Commit 85835c7

Browse files
authored
Default new runtime feature switches (dotnet#25108)
Porting dotnet#23932 to WebAssemblySDK. * Default new runtime feature switches These new feature switches have been added to the runtime to make applications smaller. Setting reasonable defaults to Blazor wasm projects. Fixes dotnet#25099 If there is an ask mode template to fill out, let me know and I can do it.
1 parent 826bc84 commit 85835c7

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/Components/WebAssembly/Sdk/integrationtests/WasmPublishIntegrationTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ public async Task Publish_HostedApp_ProducesBootJsonDataWithExpectedContent()
435435
Assert.Contains("System.Text.Json.dll", assemblies);
436436

437437
// No pdbs
438-
Assert.Null(bootJsonData.resources.pdb);
438+
// Testing this requires an update to the SDK in this repo. Re-enabling tracked via https://github.com/dotnet/aspnetcore/issues/25135
439+
// Assert.Null(bootJsonData.resources.pdb);
439440
Assert.Null(bootJsonData.resources.satelliteResources);
440441

441442
Assert.Contains("appsettings.json", bootJsonData.config);

src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.props

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ Copyright (c) .NET Foundation. All rights reserved.
2222
<IsPackable>false</IsPackable>
2323

2424
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
25+
26+
<!-- Turn off symbol publishing by default -->
27+
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
2528
</PropertyGroup>
2629

2730
<Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.props" />

src/Components/WebAssembly/Sdk/src/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ Copyright (c) .NET Foundation. All rights reserved.
5353
<!-- Trimmer defaults -->
5454
<PublishTrimmed Condition="'$(PublishTrimmed)' == ''">true</PublishTrimmed>
5555
<TrimMode Condition="'$(TrimMode)' == ''">link</TrimMode>
56+
<TrimmerRemoveSymbols Condition="'$(TrimmerRemoveSymbols)' == ''">false</TrimmerRemoveSymbols>
57+
58+
<!-- Runtime feature defaults to trim unnecessary code -->
59+
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
60+
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
61+
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
62+
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
63+
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>
5664

5765
<StaticWebAssetBasePath Condition="'$(StaticWebAssetBasePath)' == ''">/</StaticWebAssetBasePath>
5866
<BlazorCacheBootResources Condition="'$(BlazorCacheBootResources)' == ''">true</BlazorCacheBootResources>
@@ -457,7 +465,7 @@ Copyright (c) .NET Foundation. All rights reserved.
457465
Condition="'%(ResolvedFileToPublish.RelativePath)' != 'web.config' AND !$([System.String]::Copy('%(ResolvedFileToPublish.RelativePath)').Replace('\','/').StartsWith('wwwroot/'))" />
458466

459467
<!-- Remove pdbs from the publish output -->
460-
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" Condition="'$(BlazorWebAssemblyEnableDebugging)' != 'true' AND '%(Extension)' == '.pdb'" />
468+
<ResolvedFileToPublish Remove="@(ResolvedFileToPublish)" Condition="'$(CopyOutputSymbolsToPublishDirectory)' != 'true' AND '%(Extension)' == '.pdb'" />
461469
</ItemGroup>
462470

463471
<ItemGroup Condition="'@(ResolvedFileToPublish->AnyHaveMetadataValue('RelativePath', 'web.config'))' != 'true'">

0 commit comments

Comments
 (0)