[Wasm] Prototype middleware-free standalone hot reload - #56010
Draft
lewing wants to merge 1 commit into
Draft
Conversation
Use a trusted launch URL fragment to bootstrap the net11+ standalone Blazor WebAssembly browser client directly to dotnet-watch, while preserving middleware fallback and page-reload delta replay. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Modern standalone Blazor WebAssembly is served by the NativeAOT-compatible Gateway, which cannot dynamically load
Microsoft.AspNetCore.Watch.BrowserRefresh. As a result, the hosting-startup middleware never injects the browser-refresh script anddotnet watchreports that no browser is connected.This prototypes a .NET 11+ path that does not require Gateway middleware, HTML response rewriting, or dynamic assembly loading. It is an alternative and architectural follow-up to dotnet/aspnetcore#68900 and dotnet/aspnetcore#67611.
Approach
Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js, replacing the proposed middleware configuration endpoint.sessionStorageso manual and static-file reloads can replay them without/_framework/blazor-hotreload.dotnet watchdoes not automatically launch the browser.For the new path this removes dependencies on
DOTNET_STARTUP_HOOKS,ASPNETCORE_HOSTINGSTARTUPASSEMBLIES, HTML script injection,aspnetcore-browser-refresh.js,browser-refresh-config,blazor-hotreload, andclear-browser-cache. The dotnet-watch WebSocket refresh server remains.Validation
./build.shbuild.dotnet-watch.Tests: 18 passed.Microsoft.DotNet.HotReload.Client.Tests: 3 passed.No browser is connectedafter a Razor edit.<h1>, a manual page reload reconnected as a second browser, and the updated DOM was preserved by replay.Known limitations and follow-ups
@importand scoped CSS behavior needs more validation withoutClear-Site-Data.