Split WebAssembly SDK from Blazor SDK#31154
Conversation
# Conflicts: # sdk.sln # src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmBuildIntegrationTest.cs
|
Thanks for your PR, @maraf. |
| ("RelativePath", "my-custom-extension.blz"), | ||
| ("TargetPath", "_bin/my-custom-extension.blz"), | ||
| ("AssetTraitName", "BlazorWebAssemblyResource"), | ||
| ("AssetTraitName", "WasmResource"), |
There was a problem hiding this comment.
We need to be careful here because I believe we use this on the service worker. Just making a note here so that I don't forget as I haven't gone through the entire PR
| <Project ToolsVersion="14.0" TreatAsLocalProperty="RuntimeIdentifier"> | ||
| <PropertyGroup> | ||
| <!-- FIXME: Important to get rid of missing workload --> | ||
| <UsingMicrosoftNETSdkBlazorWebAssembly>true</UsingMicrosoftNETSdkBlazorWebAssembly> |
There was a problem hiding this comment.
Yes, I'll update the property during the migration to runtime repo once I update the wasm-tools workload manifest
src/WasmSdk/Targets/Microsoft.NET.Sdk.WebAssembly.Current.props
Outdated
Show resolved
Hide resolved
src/WasmSdk/Targets/Microsoft.NET.Sdk.WebAssembly.Current.targets
Outdated
Show resolved
Hide resolved
| /// <summary> | ||
| /// "debug" (.pdb) resources | ||
| /// </summary> | ||
| [DataMember(EmitDefaultValue = false)] |
There was a problem hiding this comment.
FYI, this can be updated to use System.Text.Json. It used datacontractserializer because it predates it, but I did support to add System.Text.Json support to the SDK tasks, so you should be able to use it. (It might be that I only did it in the RazorSDK, but it should be "copiable")
There was a problem hiding this comment.
Not asking you to change it, just letting you know
There was a problem hiding this comment.
I would love to do it. I think I struggled on the package version when I tried it last week.
So you are saying that I can use version 6.0 like in here https://github.com/dotnet/razor/blob/33e06ed0fd64c8b67b80d464370ee0380f9ab32c/eng/Versions.props#L179, right?
There was a problem hiding this comment.
| namespace Microsoft.NET.Sdk.BlazorWebAssembly | ||
| namespace Microsoft.NET.Sdk.WebAssembly | ||
| { | ||
| public static class FileHasher |
There was a problem hiding this comment.
@MackinnonBuck this will move to static web assets as part of dotnet/aspnetcore#47000
# Conflicts: # src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets # src/BlazorWasmSdk/Tasks/BootJsonData.cs # src/WasmSdk/Tasks/GenerateWasmBootJson.cs
# Conflicts: # src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets # src/WasmSdk/Tasks/ComputeWasmBuildAssets.cs # src/WasmSdk/Tasks/ComputeWasmPublishAssets.cs # src/WasmSdk/Tasks/GenerateWasmBootJson.cs
`Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets` unconditionally imports: ```xml <Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Web.ProjectSystem" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" /> ``` .. *after* which it can import `Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets`, which then unconditionally imports: ```xml <Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Web.ProjectSystem" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" /> ``` .. which produces warning: ``` [2023/05/24 07:06:03][INFO] /home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets(13,3): warning MSB4011: "/home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.Razor/Sdk/Sdk.targets" cannot be imported again. It was already imported at "/home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. ``` .. and the same for `Microsoft.NET.Sdk.Web.ProjectSystem`, and `Microsoft.NET.Sdk.Publish`. Since the `5_0.targets` is only ever imported from the `Current.targets`, it does not need to import the same SDKs again. This was introduced in: ``` commit 3e34299 Author: Marek Fišera <mara@neptuo.com> Date: Tue Mar 28 15:47:55 2023 +0200 Split WebAssembly SDK from Blazor SDK (dotnet#31154) ``` .. and the blazor scenario perf runs have been broken since it got merged.
`Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets` unconditionally imports: ```xml <Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Web.ProjectSystem" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" /> ``` .. *after* which it can import `Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets`, which then unconditionally imports: ```xml <Import Sdk="Microsoft.NET.Sdk.Razor" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Web.ProjectSystem" Project="Sdk.targets" /> <Import Sdk="Microsoft.NET.Sdk.Publish" Project="Sdk.targets" /> ``` .. which produces warning: ``` [2023/05/24 07:06:03][INFO] /home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.5_0.targets(13,3): warning MSB4011: "/home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.Razor/Sdk/Sdk.targets" cannot be imported again. It was already imported at "/home/helixbot/work/BAA509D0/p/dotnet/sdk/8.0.100-preview.5.23273.2/Sdks/Microsoft.NET.Sdk.BlazorWebAssembly/targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets (25,3)". This is most likely a build authoring error. This subsequent import will be ignored. ``` .. and the same for `Microsoft.NET.Sdk.Web.ProjectSystem`, and `Microsoft.NET.Sdk.Publish`. Since the `5_0.targets` is only ever imported from the `Current.targets`, it does not need to import the same SDKs again. This was introduced in: ``` commit 3e34299 Author: Marek Fišera <mara@neptuo.com> Date: Tue Mar 28 15:47:55 2023 +0200 Split WebAssembly SDK from Blazor SDK (#31154) ``` .. and the blazor scenario perf runs have been broken since it got merged.
Contributes to dotnet/aspnetcore#47001