Skip to content
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

Fix issues with Blazor WASM delta applier #43152

Merged
merged 4 commits into from
Sep 5, 2024
Merged

Conversation

tmat
Copy link
Member

@tmat tmat commented Aug 31, 2024

BlazorWebAssemblyDeltaApplier.WaitForProcessRunningAsync needs to wait until the build is complete and the app is running to avoid treating file changes that occur during build as Hot Reload changes. We can use browser connection event as an indication that Blazor WASM app is running. Alternatively, we could notify dotnet-watch via named pipe from a module injected to the host (blazor-devserver.dll) but that's more complex and adds more dependencies on the details of the host to dotnet-watch.

Enables unit testing apps that require browser connector (such as Blazor WASM). We mock the browser by short-circuiting code paths that launch the browser or apply the change in the browser if a TestFlags.MockBrowser is specified.

Adds Blazor WASM test. The test validates that Blazor WASM app builds and starts correctly under dotnet-watch. Testing update in Razor file is blocked by dotnet/razor#10818.

Contributes to https://github.com/dotnet/AspNetCore-ManualTests/issues/3080.

@tmat tmat requested review from arunchndr and a team as code owners August 31, 2024 00:43
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch untriaged Request triage from a team member labels Aug 31, 2024
Copy link
Contributor

Thanks for your PR, @tmat.
To learn about the PR process and branching schedule of this repo, please take a look at the SDK PR Guide.

@phil-allen-msft
Copy link
Contributor

Overall question: Based on the description, where is the main place to look for the functional change (Waiting until browser connection occurs to know that build is complete)?

@tmat tmat merged commit 59a7106 into dotnet:main Sep 5, 2024
37 checks passed
@tmat tmat deleted the FixBlazorWasm branch September 5, 2024 23:09
tmat added a commit to tmat/sdk that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-AspNetCore RazorSDK, BlazorWebAssemblySDK, dotnet-watch untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants