Skip to content

Commit 10bacce

Browse files
authored
Merge pull request dotnet#23321 from dotnet-maestro-bot/merge/release/5.0-preview7-to-master
[automated] Merge branch 'release/5.0-preview7' => 'master'
2 parents c42d1a3 + a93ff60 commit 10bacce

File tree

5 files changed

+14
-24
lines changed

5 files changed

+14
-24
lines changed

src/Components/Web.JS/dist/Release/blazor.server.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Components/Web.JS/src/Boot.Server.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,18 @@ async function boot(userOptions?: Partial<CircuitStartOptions>): Promise<void> {
5656
return true;
5757
};
5858

59-
window.addEventListener(
60-
'unload',
61-
() => {
59+
let disconnectSent = false;
60+
const cleanup = () => {
61+
if (!disconnectSent) {
6262
const data = new FormData();
6363
const circuitId = circuit.circuitId!;
6464
data.append('circuitId', circuitId);
65-
navigator.sendBeacon('_blazor/disconnect', data);
66-
},
67-
false
68-
);
65+
disconnectSent = navigator.sendBeacon('_blazor/disconnect', data);
66+
}
67+
};
68+
69+
window.addEventListener('beforeunload', cleanup, { capture: false, once: true });
70+
window.addEventListener('unload', cleanup, { capture: false, once: true });
6971

7072
window['Blazor'].reconnect = reconnect;
7173

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/LinkerWorkaround.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
<type fullname="System.ComponentModel.TimeSpanConverter" />
1414
</assembly>
1515

16-
<assembly fullname="System.Runtime.InteropServices.JavaScript" preserve="all" />
17-
1816
<assembly fullname="System.Text.Json">
1917
<!-- S.T.J. uses Activator.CreateInstance to instantiate converters, so we need to preserve default constructors.
2018
For safety, do this for all converter types, even though most of them are preserved anyway due to being referenced

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.ServiceWorkerAssetsManifest.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Copyright (c) .NET Foundation. All rights reserved.
121121
</PropertyGroup>
122122

123123
<ItemGroup>
124-
<_ServiceWorkerIntermediatePublishFile Include="%(ServiceWorker.IntermediateOutputPath)serviceworkers\%(FileName).publish%(Extension)">
124+
<_ServiceWorkerIntermediatePublishFile Include="$(IntermediateOutputPath)serviceworkers\%(FileName).publish%(Extension)">
125125
<ContentSourcePath Condition="'%(ServiceWorker.PublishedContent)' != ''">%(ServiceWorker.PublishedContent)</ContentSourcePath>
126126
<ContentSourcePath Condition="'%(ServiceWorker.PublishedContent)' == ''">%(ServiceWorker.Identity)</ContentSourcePath>
127127
<RelativePath>%(ServiceWorker.Identity)</RelativePath>
@@ -154,7 +154,7 @@ Copyright (c) .NET Foundation. All rights reserved.
154154
CopyToPublishDirectory="PreserveNewest"
155155
RelativePath="%(_ServiceWorkerIntermediatePublishFile.RelativePath)"
156156
ExcludeFromSingleFile="true" />
157-
157+
158158
<ResolvedFileToPublish
159159
Include="$(_ServiceWorkerAssetsManifestPublishIntermediateOutputPath)"
160160
CopyToPublishDirectory="PreserveNewest"

src/Razor/Microsoft.NET.Sdk.Razor/src/build/netstandard2.0/Microsoft.NET.Sdk.Razor.Components.Wasm.targets

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -307,36 +307,26 @@ Copyright (c) .NET Foundation. All rights reserved.
307307

308308
<Target Name="_CreateBlazorTrimmerRootDescriptorFiles" BeforeTargets="ILLink" AfterTargets="ComputeResolvedFilesToPublishList">
309309
<PropertyGroup>
310-
<_BlazorApplicationTrimmerDescriptorFile>$(IntermediateOutputPath)default.trimmerdescriptor.xml</_BlazorApplicationTrimmerDescriptorFile>
311310
<_BlazorTypeGranularTrimmerDescriptorFile>$(IntermediateOutputPath)typegranularity.trimmerdescriptor.xml</_BlazorTypeGranularTrimmerDescriptorFile>
312311
</PropertyGroup>
313312

314313
<ItemGroup>
315314
<_BlazorTypeGranularAssembly
316315
Include="@(ResolvedFileToPublish)"
317-
Condition="$([System.String]::Copy('%(Filename)').StartsWith('Microsoft.AspNetCore.')) or $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.Extensions.'))">
316+
Condition="'%(Extension)' == '.dll' AND ($([System.String]::Copy('%(Filename)').StartsWith('Microsoft.AspNetCore.')) or $([System.String]::Copy('%(Filename)').StartsWith('Microsoft.Extensions.')))">
318317
<Required>false</Required>
319318
<Preserve>all</Preserve>
320319
</_BlazorTypeGranularAssembly>
321-
322-
<_BlazorApplicationAssembly Include="@(IntermediateAssembly)">
323-
<Required>true</Required>
324-
</_BlazorApplicationAssembly>
325320
</ItemGroup>
326321

327-
<CreateBlazorTrimmerRootDescriptorFile
328-
Assemblies="@(_BlazorApplicationAssembly)"
329-
TrimmerFile="$(_BlazorApplicationTrimmerDescriptorFile)" />
330-
331322
<CreateBlazorTrimmerRootDescriptorFile
332323
Assemblies="@(_BlazorTypeGranularAssembly)"
333324
TrimmerFile="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
334325

335326
<ItemGroup>
336-
<TrimmerRootDescriptor Include="$(_BlazorApplicationTrimmerDescriptorFile)" />
327+
<TrimmerRootDescriptor Include="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
337328
<TrimmerRootDescriptor Include="$(MSBuildThisFileDirectory)LinkerWorkaround.xml" />
338329

339-
<FileWrites Include="$(_BlazorApplicationTrimmerDescriptorFile)" />
340330
<FileWrites Include="$(_BlazorTypeGranularTrimmerDescriptorFile)" />
341331
</ItemGroup>
342332
</Target>

0 commit comments

Comments
 (0)