Skip to content

Simplify WebAssembly hot reload capabilities detection #51507

@MackinnonBuck

Description

@MackinnonBuck

Background

Upon initialization, the dotnet watch tool needs to know the set of available WebAssembly hot reload capabilities before the hot reload session starts. The current mechanism for this relies on the WebAssembly runtime having started up so it can be asked which capabilities it supports. However, in Blazor Web scenarios, WebAssembly runtime startup might be delayed indefinitely, which causes the mechanism to read hot reload capabilities to fail.

We worked around this problem in dotnet/sdk#36195 by having a fallback, default set of capabilities to use if reading capabilities from the WebAssembly runtime fails.

Proposed solution

We could go one of two directions in the future to fully address this issue:

  • Expand the capabilities of dotnet watch to dynamically update the set of available capabilities if a new runtime becomes available (relatively high complexity)
  • Remove WebAssembly capabilities detection completely and rely on the fallback capabilities only (simpler)

To simplify the Blazor WebAssembly hot reload infrastructure and make the overall hot reload experience less error prone, I propose we go with the 2nd option that simplifies WebAssembly hot reload capabilities detection by having the full set of capabilities be known by the dotnet watch tool without having to dynamically fetch those capabilities from the WebAssembly runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Pillar: Dev ExperiencePriority:2Work that is important, but not critical for the releasearea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-blazor-wasmThis issue is related to and / or impacts Blazor WebAssemblyfeature-hot-reloadThis issue is related to the Hot Reload feaaturetriaged

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions