Repository navigation
Conversation
javiercn
requested review from
a team,
akoeplinger,
lbussell,
lewing,
maraf,
mthalman,
pavelsavara and
tmat
as code owners
September 1, 2026 14:45
|
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. |
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Pull request overview
Routes .NET 11+ standalone Blazor WebAssembly dotnet watch browser tooling through Gateway-native endpoints (HTTP + WebSocket) instead of relying on hosting-startup/startup-hook injection, while keeping legacy behavior for other app models/TFMs.
Changes:
- Add a versioned browser-tools protocol surface (
session.json,updates/{generation}.json,clear-cache,connect) with generation-scoped update replay and authenticated WebSocket connections. - Introduce launch-configuration abstraction to switch between legacy hosting-startup injection and Gateway/YARP proxy configuration based on the app model/TFM.
- Extend WASM SDK/static-web-asset baselines and tests to ensure the new browser-tools JS module is build-only (not published).
File summaries
| File | Description |
|---|---|
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/WasmJsModulesIntegrationTests.cs | Adds an integration test ensuring the BrowserTools JS module is build-only and excluded from publish outputs. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.staticwebassets.json | Updates baseline to include BrowserTools module assets/endpoints in build manifest. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_BuildMinimal_Works.Build.files.json | Updates baseline file list to include BrowserTools module outputs. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/StaticWebAssets_Build_Hosted_Works.Build.staticwebassets.json | Updates hosted baseline to include BrowserTools module assets/endpoints. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/JSModules_ManifestIncludesModuleTargetPaths.Build.staticwebassets.json | Updates JS module baseline to include BrowserTools module entries. |
| test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/StaticWebAssetsBaselines/Build_DoesNotGenerateManifestJson_IncludesJSModulesOnBlazorBootJsonManifest.Build.staticwebassets.json | Updates baseline to include BrowserTools module in the build manifest shape used by this scenario. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/WebAssemblyHotReloadClientTests.cs | Adds tests validating replay-enabled behavior vs legacy behavior when no browser is connected. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/BrowserToolsUpdateStoreTests.cs | Adds unit tests for generation/update ordering and reset semantics of the replay store. |
| test/Microsoft.Extensions.DotNetDeltaApplier.Tests/BrowserToolsEndpointRouterTests.cs | Adds unit tests for the new browser-tools endpoint router behavior and error handling. |
| test/dotnet-watch.Tests/Browser/BrowserRefreshServerTests.cs | Adds coverage for inserting BrowserRefresh-related env vars into an existing environment dictionary. |
| test/dotnet-watch.Tests/Browser/BlazorWebAssemblyAppModelTests.cs | Adds coverage for Gateway vs hosting-startup launch configuration selection for net11+ standalone WASM. |
| src/WasmSdk/Sdk/Sdk.targets | Copies and registers the new BrowserTools JS module into the hotreload intermediate/static-web-assets pipeline. |
| src/Dotnet.Watch/Watch/AppModels/WebApplicationAppModel.cs | Adds launch-configurator plumbing and passes generation/replay parameters into the WASM hot reload client. |
| src/Dotnet.Watch/Watch/AppModels/BlazorWebAssemblyAppModel.cs | Switches net11+ standalone WASM to Gateway proxy launch config and enables replay in the WASM client. |
| src/Dotnet.Watch/HotReloadClient/Web/WebServerHost.cs | Splits WebSocket vs HTTP endpoint exposure to support Gateway proxy addressing. |
| src/Dotnet.Watch/HotReloadClient/Web/WebAssemblyHotReloadClient.cs | Adds generation ID + optional replay storage and includes generation ID in managed-update messages. |
| src/Dotnet.Watch/HotReloadClient/Web/KestrelWebSocketServer.cs | Exposes both WebSocket URLs and underlying HTTP URLs from Kestrel. |
| src/Dotnet.Watch/HotReloadClient/Web/IBrowserToolsLaunchConfigurator.cs | Introduces a launch-environment configurator interface and feature flags. |
| src/Dotnet.Watch/HotReloadClient/Web/HostingStartupBrowserToolsLaunchConfigurator.cs | Implements legacy hosting-startup/startup-hook environment configuration behind the new abstraction. |
| src/Dotnet.Watch/HotReloadClient/Web/GatewayProxyBrowserToolsLaunchConfigurator.cs | Implements Gateway/YARP proxy environment configuration for browser-tools traffic. |
| src/Dotnet.Watch/HotReloadClient/Web/BrowserToolsUpdateStore.cs | Adds a thread-safe generation-scoped replay store for managed-update batches. |
| src/Dotnet.Watch/HotReloadClient/Web/BrowserToolsProtocol.cs | Defines protocol constants and reserved route prefix for browser-tools endpoints. |
| src/Dotnet.Watch/HotReloadClient/Web/BrowserToolsEndpointRouter.cs | Adds HTTP routing for browser-tools endpoints and authenticated WebSocket connect handling. |
| src/Dotnet.Watch/HotReloadClient/Web/BrowserRefreshServer.cs | Routes requests either to browser-tools HTTP endpoints or legacy WebSocket acceptance. |
| src/Dotnet.Watch/HotReloadClient/Web/AbstractBrowserRefreshServer.cs | Centralizes WebSocket acceptance logic and exposes data needed by launch configurators/router. |
| src/Dotnet.Watch/HotReloadClient/HotReloadClients.cs | Switches launch env configuration to use the new launch configurator. |
| src/Dotnet.Watch/HotReloadAgent.WebAssembly.Browser/wwwroot/Microsoft.DotNet.HotReload.WebAssembly.BrowserTools.lib.module.js | Adds the new browser-tools JS module (auth + replay buffering + CSS swap + live update processing). |
| src/Dotnet.Watch/HotReloadAgent.WebAssembly.Browser/wwwroot/Microsoft.DotNet.HotReload.WebAssembly.Browser.lib.module.js | Adds provider discovery/replay activation and legacy fallback logic in the existing WASM loader module. |
| src/Dotnet.Watch/HotReloadAgent.WebAssembly.Browser/WebAssemblyHotReload.cs | Adds an initializer variant that skips applying previous deltas (Gateway replay handles it). |
| src/Dotnet.Watch/dotnet-watch/Watch/DotNetWatcher.cs | Adjusts environment building per-iteration and uses the new configurator for BrowserRefresh-only setup. |
| src/Dotnet.Watch/AGENTS.md | Updates contributor/agent guidance for the new Gateway-native WASM hot reload path. |
| eng/Signing.props | Adds signing metadata for the new BrowserTools JS module. |
Review details
- Files reviewed: 32/32 changed files
- Comments generated: 1
- Review effort level: Lite
Comment on lines
+8
to
+11
| using System; | ||
| using System.Net; | ||
| using System.Threading.Tasks; | ||
| using Microsoft.AspNetCore.Http; |
tmat
reviewed
Sep 1, 2026
| { | ||
| } | ||
|
|
||
| public WebServerHost( |
tmat
reviewed
Sep 1, 2026
| AbstractBrowserRefreshServer? browserRefreshServer, | ||
| bool useRefreshServerToApplyStaticAssets) : IDisposable | ||
| bool useRefreshServerToApplyStaticAssets, | ||
| IBrowserToolsLaunchConfigurator? browserToolsLaunchConfigurator = null) : IDisposable |
Member
There was a problem hiding this comment.
Make this non-optional, so that we don't forget to pass it in all call sites that should have it.
Move standalone net11 Blazor WASM activation to a watch-owned provider reached through Blazor Gateway's existing reverse proxy. Behavior: changed: standalone net11 WASM discovers provider-owned browser tooling without BrowserRefresh startup injection State: builds; regression coverage follows in the next commit Review hint: focus on provider discovery, generation replay, and the fixed Gateway route; the remainder is wiring Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49a13c60-1d66-4321-bfdb-01275ead89d6
Add provider endpoint, replay-store, launch-selection, and build-only WASM asset coverage for the Gateway-native implementation. Behavior: preserved State: complete for PR #56071 Review hint: generated Static Web Assets baseline additions represent the two build-only hot reload modules Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49a13c60-1d66-4321-bfdb-01275ead89d6
javiercn
force-pushed
the
javiercn-implement-gateway-hot-reload
branch
from
September 2, 2026 10:32
e0f0b2e to
8792886
Compare
javiercn
added a commit
that referenced
this pull request
Sep 8, 2026
Add provider endpoint, replay-store, launch-selection, and build-only WASM asset coverage for the Gateway-native implementation. Behavior: preserved State: complete for PR #56071 Review hint: generated Static Web Assets baseline additions represent the two build-only hot reload modules Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49a13c60-1d66-4321-bfdb-01275ead89d6
javiercn
added a commit
that referenced
this pull request
Sep 18, 2026
Add provider endpoint, replay-store, launch-selection, and build-only WASM asset coverage for the Gateway-native implementation. Behavior: preserved State: complete for PR #56071 Review hint: generated Static Web Assets baseline additions represent the two build-only hot reload modules Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 49a13c60-1d66-4321-bfdb-01275ead89d6
Contributor
|
Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label. |
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.
Summary
dotnet watchManual validation
Validated with a real standalone
net11.0Blazor WebAssembly app and the locally built SDK/watch tool:session.json, replay, cache-clearing, and WebSocket upgrade requests through the stable root route, including withGateway__PathBase=/baseDOTNET_STARTUP_HOOKS,ASPNETCORE_HOSTINGSTARTUPASSEMBLIES, launch-timeDOTNET_MODIFIABLE_ASSEMBLIES, and BrowserRefresh variablesdotnet runremained functional and inactive after the bounded provider probe returned 404Tests
node --checkfor both browser modulesgit diff --checkDesign note
The browser establishes and buffers its live WebSocket before replay completes, then activates live processing after replay. This preserves replay-before-live ordering while closing the missed-update window. Browser-tools traffic intentionally remains on the reserved root route when the application has a Gateway path base.