-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use feature switch to perform hot reload trimming
Contributes to dotnet/runtime#51159
- Loading branch information
Showing
12 changed files
with
48 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 4 additions & 10 deletions
14
src/Components/Components/src/Properties/ILLink.Substitutions.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,11 @@ | ||
<linker> | ||
<assembly fullname="Microsoft.AspNetCore.Components" > | ||
<!-- HotReload will not be available in a trimmed app. We'll attempt to aggressively remove all references to it. --> | ||
<type fullname="Microsoft.AspNetCore.Components.RenderTree.Renderer"> | ||
<!-- Renderer.IsHotReloading will always return false in a trimmed app. --> | ||
<method signature="System.Boolean get_IsHotReloading()" body="stub" value="false" /> | ||
<method signature="System.Void RenderRootComponentsOnHotReload()" body="remove" /> | ||
<method signature="System.Void InitializeHotReload(System.IServiceProvider)" body="stub" /> | ||
<method signature="System.Void CaptureRootComponentForHotReload(Microsoft.AspNetCore.Components.ParameterView,Microsoft.AspNetCore.Components.Rendering.ComponentState)" body="stub" /> | ||
<method signature="System.Void DisposeForHotReload()" body="stub" /> | ||
</type> | ||
<assembly fullname="Microsoft.AspNetCore.Components"> | ||
<!-- Avoid any overhead in RenderHandle.IsHotReloading by aggressively trimming it --> | ||
<type fullname="Microsoft.AspNetCore.Components.RenderHandle"> | ||
<method signature="System.Boolean get_IsHotReloading()" body="stub" value="false" /> | ||
</type> | ||
<type fullname="Microsoft.AspNetCore.Components.HotReload.HotReloadFeature" feature="System.Diagnostics.Debugger.IsSupported" featurevalue="false"> | ||
<method signature="System.Boolean get_IsSupported()" body="stub" value="false" /> | ||
</type> | ||
</assembly> | ||
</linker> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// Copyright (c) .NET Foundation. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace Microsoft.AspNetCore.Components.HotReload | ||
{ | ||
internal static class HotReloadFeature | ||
{ | ||
/// <summary> | ||
/// Gets a value that determines if hot reload is supported. Currently, the <c>Debugger.IsSupported</c> feature switch is used as a proxy for this. | ||
/// </summary> | ||
public static bool IsSupported { get; } = AppContext.TryGetSwitch("System.Diagnostics.Debugger.IsSupported", out var isSupported) ? isSupported : true; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/Components/WebAssembly/WebAssembly/src/Properties/ILLink.Substitutions.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
<linker> | ||
<assembly fullname="Microsoft.AspNetCore.Components.WebAssembly" > | ||
<!-- HotReload will not be available in a trimmed app. We'll attempt to aggressively remove all references to it. --> | ||
<type fullname="Microsoft.AspNetCore.Components.WebAssembly.Hosting.WebAssemblyHost"> | ||
<method signature="System.Threading.Tasks.Task InitializeHotReloadAsync()" body="stub" /> | ||
<type fullname="Microsoft.AspNetCore.Components.HotReload.HotReloadFeature" feature="System.Diagnostics.Debugger.IsSupported" featurevalue="false"> | ||
<method signature="System.Boolean get_IsSupported()" body="stub" value="false" /> | ||
</type> | ||
</assembly> | ||
</linker> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters