-
Notifications
You must be signed in to change notification settings - Fork 820
Add Blazor WASM .NET on Web Workers sample app #635
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
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 adds a comprehensive Blazor WebAssembly sample demonstrating .NET on Web Workers and updates the existing React sample with consistent naming. The samples show how to run .NET code on web workers to offload computation from the main UI thread, using QR code generation as a practical example.
Key Changes
- Adds
DotNetOnWebWorkersBlazorWebAssemblysample with complete Blazor WASM implementation including worker infrastructure, UI components, and build scripts - Renames React sample to
DotNetOnWebWorkersReactfor consistent naming across samples - Updates both samples to target .NET 10.0 with appropriate package versions
Reviewed Changes
Copilot reviewed 28 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| run.sh | Shell script for building and running the Blazor WASM project on Unix systems |
| run.cmd | Batch script for building and running the Blazor WASM project on Windows |
| README.md (Blazor) | Documentation for the Blazor sample with startup instructions |
| BlazorWasm/ | Complete Blazor WebAssembly project with components, layouts, pages, and styles |
| Workers/QRGenerator.razor.* | Web worker implementation for QR code generation using .NET |
| Clients/Client.razor.* | JavaScript interop client for communicating with workers |
| Components/Popup.razor | Reusable popup component for displaying errors |
| Pages/Home.razor | Main page with QR code generation UI |
| App.razor | Root application component with routing and NotFound page configuration |
| BlazorWasm.csproj | Project file targeting net10.0 with required packages |
| DotNetOnWebWorkersReact/ | Updated React sample with consistent naming and structure |
| dotnet/Program.cs | QR generator implementation for the React sample |
| react/src/* | React UI components and worker client code |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ilonatommy
left a comment
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.
After that small rename, it's working and looks good. Thanks!
Addresses dotnet/AspNetCore.Docs#36370
Ilona ...
DotNetOnWebWorkersBlazorWebAssemblyandDotNetOnWebWorkersReact.<input>element so that one doesn't need to back out the text to type something in the field.awaittoInvokeAsync(StateHasChanged)inHome.razor.cs(I think because the method returns aTask).I'll go work on the article next. I'll update the React sample name in the .NET on Web Workers article on the docs PR.