Skip to content

[browser] Integrate DevServer into WasmAppHost - #88985

Merged
maraf merged 29 commits into
dotnet:mainfrom
maraf:WasmBrowserHost
Jul 29, 2023
Merged

[browser] Integrate DevServer into WasmAppHost#88985
maraf merged 29 commits into
dotnet:mainfrom
maraf:WasmBrowserHost

Conversation

@maraf

@marafmaraf commented Jul 17, 2023

Copy link
Copy Markdown
Member
  • Integrate (copy) Blazor DevServer into WasmAppHost
    • DevServer origins
      • Copied from Blazor DevServer without any change
        • ComponentsWebAssemblyApplicationBuilderExtensions.cs
        • ContentEncodingNegotiator.cs
        • WebAssemblyNetDebugProxyAppBuilderExtensions.cs
      • DevServer.cs is mix between WebServer and asptnetcore DevServer/Program.cs
      • DevServerStartup.cs mix between WebServerStartup and asptnetcore DevServer/Startup.cs
      • DevServerOptions.cs is inspired by WebServerOptions
      • DebugProxyLauncher.cs changed folder where it expects debug proxy
    • The WasmAppHost still remains in workload, because of the console template
    • The WasmAppHost is also included in the Wasm SDK pack for running without workload from Wasm SDK
    • If we finish the console template in .NET 8, we can remove WasmAppHost from the workload
  • The BrowserHost switches between WebServer and DevServer based on static web assets manifest presence
    • We probably could remove WebServer later
    • The solution still uses runtime config
  • Make HTMLPath optional
  • Set run parameters for Wasm SDK
    • It's in the Browser.targets because that is the topmost place where OutputPath is correctly set. Unfortunatelly it's after the default run parameters are set. So it must override it
    • It uses _WebAssemblyUserRunParameters to preserve user defined values. The property will be set in SDK dotnet/sdk@569f220
    • It checks for "blazor-devserver.dll" to preserve Blazor setting. We could use different check once the UsingMicrosoftNETSdkBlazorWebAssembly is removed from Wasm SDK
  • Until resolved, TestAppScenarios pass GenerateRuntimeConfigurationFiles=true as command line argument to override Microsoft.NET.Sdk.WebAssembly.Browser.targets#L64
  • Remove GenerateRuntimeConfigurationFiles=false from Wasm SDK, since the WasmAppHost needs it and Blazor SDK Move GenerateRuntimeConfigurationFiles=false back to Blazor SDK from Wasm SDK sdk#34177 change already flown to installer
  • DebugProxy tested manually
  • Tested that is doesn't interfere with Blazor's DevServer from nuget package

Contributes to #70762

@marafmaraf added arch-wasm WebAssembly architecture area-Host os-browser Browser variant of arch-wasm labels Jul 17, 2023
@marafmaraf added this to the 8.0.0 milestone Jul 17, 2023
@marafmaraf self-assigned this Jul 17, 2023
@ghost

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

TBD

Author:maraf
Assignees:maraf
Labels:

arch-wasm, area-Host, os-browser

Milestone:8.0.0

@maraf
maraf marked this pull request as ready for review July 21, 2023 12:59
Comment threadsrc/mono/wasm/Wasm.Build.Tests/TestAppScenarios/AppTestBase.cs Outdated
Comment threadsrc/mono/wasm/host/WebServerStartup.cs Outdated
Comment threadsrc/mono/wasm/host/BrowserHost.cs Outdated
Comment threadsrc/mono/wasm/host/BrowserHost.cs Outdated
Comment threadsrc/mono/wasm/host/BrowserHost.cs Outdated
Comment threadsrc/mono/wasm/host/BrowserHost.cs Outdated
Comment threadsrc/mono/wasm/host/BrowserHost.cs
Comment threadsrc/mono/wasm/host/BrowserArguments.cs

@radicalradical left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment threadsrc/mono/wasm/host/BrowserHost.cs
@maraf
maraf merged commit d5c4a4e into dotnet:mainJul 29, 2023
@maraf
maraf deleted the WasmBrowserHost branch August 14, 2023 07:45
@ghostghost locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-Hostos-browserBrowser variant of arch-wasm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@maraf@lewing@radical@pavelsavara@ilonatommy