-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixes capability detection for hosted Blazor apps #49037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
dd3189f
to
aa4bed4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes capability detection for hosted Blazor apps by replacing the legacy HotReloadProfile mechanism with a new HotReloadAppModel abstraction. The changes include updating test assets and project files for Blazor WASM/hosted apps, removing the HotReloadProfile and related files, and adapting the Browser Refresh and Delta Applier logic to use the new app model.
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorwasm/_Imports.razor | Adds necessary using directives. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorwasm/Program.cs | Introduces a sample entry point for the Blazor WASM project. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorwasm/Pages/Index.razor | Adds a simple page view. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorwasm/LinkToWebRoot/css/app.css | Adds an empty style rule for publishing. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorwasm/App.razor | Sets up the app router with a fallback view. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorhosted/blazorhosted.csproj | Updates the project file to reference the WASM project. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorhosted/Properties/launchSettings.json | Provides launch settings for the hosted project. |
test/TestAssets/TestProjects/WatchBlazorWasmHosted/blazorhosted/Program.cs | Implements a top‑level statement loop for the hosted app sample. |
src/BuiltInTools/dotnet-watch/HotReload/ProjectLauncher.cs | Replaces profile-based logic with the new app model. |
src/BuiltInTools/dotnet-watch/HotReload/HotReloadProfileReader.cs | Removes the old HotReloadProfileReader implementation. |
src/BuiltInTools/dotnet-watch/HotReload/HotReloadProfile.cs | Removes legacy HotReloadProfile definitions. |
src/BuiltInTools/dotnet-watch/HotReload/HotReloadAppModel.cs | Introduces the new abstraction to infer hot reload behavior. |
src/BuiltInTools/dotnet-watch/HotReload/DefaultAppModel.cs | Provides the default hot reload model implementation. |
src/BuiltInTools/dotnet-watch/HotReload/CompilationHandler.cs | Adjusts delta applier creation to use the app model. |
src/BuiltInTools/dotnet-watch/HotReload/BlazorWebAssemblyHostedDeltaApplier.cs | Renames parameter to clarify that it represents the client project. |
src/BuiltInTools/dotnet-watch/HotReload/BlazorWebAssemblyHostedAppModel.cs | Adds the hosted model for Blazor WebAssembly apps. |
src/BuiltInTools/dotnet-watch/HotReload/BlazorWebAssemblyDeltaApplier.cs | Enhances logging with project display names. |
src/BuiltInTools/dotnet-watch/HotReload/BlazorWebAssemblyAppModel.cs | Adds the client-only model for Blazor WebAssembly apps. |
src/BuiltInTools/dotnet-watch/DotNetWatcher.cs | Updates server creation to use DefaultAppModel. |
src/BuiltInTools/dotnet-watch/Browser/BrowserConnector.cs | Updates browser refresh logic to work with the app model. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The refactoring into HotReloadAppModel
looks solid, but I didn't spot the actual fix. The code to read project capabilities seems to be the same as it was before. and it doesn't look to me like there were any conditions in CompilationHandler
the project capabilities wouldn't have been checked before. Could you describe the fix or point me in the right direction?
The difference is the project that we read the capability msbuild property from (the one stored in the app model instance). We need to read it from the client project, but we read it from the server. |
Ah-ha - thanks for the clarification! |
e389d0f
to
652836e
Compare
Fixes https://github.com/dotnet/AspNetCore-ManualTests/issues/3673