Description
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.