Skip to content

Commit

Permalink
Default new runtime feature switches (#25108)
Browse files Browse the repository at this point in the history
Porting #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 #25099

If there is an ask mode template to fill out, let me know and I can do it.
  • Loading branch information
pranavkm authored Aug 22, 2020
1 parent 826bc84 commit 85835c7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ public async Task Publish_HostedApp_ProducesBootJsonDataWithExpectedContent()
Assert.Contains("System.Text.Json.dll", assemblies);

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

Assert.Contains("appsettings.json", bootJsonData.config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Copyright (c) .NET Foundation. All rights reserved.
<IsPackable>false</IsPackable>

<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>

<!-- Turn off symbol publishing by default -->
<CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
</PropertyGroup>

<Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.props" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ Copyright (c) .NET Foundation. All rights reserved.
<!-- Trimmer defaults -->
<PublishTrimmed Condition="'$(PublishTrimmed)' == ''">true</PublishTrimmed>
<TrimMode Condition="'$(TrimMode)' == ''">link</TrimMode>
<TrimmerRemoveSymbols Condition="'$(TrimmerRemoveSymbols)' == ''">false</TrimmerRemoveSymbols>

<!-- Runtime feature defaults to trim unnecessary code -->
<EventSourceSupport Condition="'$(EventSourceSupport)' == ''">false</EventSourceSupport>
<UseSystemResourceKeys Condition="'$(UseSystemResourceKeys)' == ''">true</UseSystemResourceKeys>
<EnableUnsafeUTF7Encoding Condition="'$(EnableUnsafeUTF7Encoding)' == ''">false</EnableUnsafeUTF7Encoding>
<HttpActivityPropagationSupport Condition="'$(HttpActivityPropagationSupport)' == ''">false</HttpActivityPropagationSupport>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' != 'Debug'">false</DebuggerSupport>

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

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

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

0 comments on commit 85835c7

Please sign in to comment.