Blazor Render Modes Demo
The solution has a blazor web app template + a minimal API backend to demonstrate some new features.
Solution Structure
- BlazorRenderModes: Main server project hosting the Blazor app and APIs.
- BlazorRenderModes.Client: Blazor WebAssembly client project.
- WeatherApi: Minimal API backend for weather data.
Running the Demo
- Open
BlazorRenderModes.slnin Visual Studio or your preferred .NET IDE. - Launch
WeatherApithenBlazorRenderModes - Explore the solution
- Faster static web assets
Program.csusesapp.MapStaticAssets()- better compression
- fingerprinting for aggresive caching
Components/App.razorneed to update the static assets path to use the magic@Assest[]thing
- Note how there is no caching in debug - lets test out the published app
- Publish the app in release mode
dotnet publish -c Release - Go to the published direcroty
cd bin/Release/net9.0/publish - Run and explore the published app
dotnet BlazorRenderModes.dllThe caching should be working, and assets should load fast. - Counter - Try out all the different render modes:
Server- Server-side renderingWebAssembly- Client-side renderingAuto- A combination of both server and client rendering
- Server Mode - test reconnection handling
- Weather - Try add/remove streaming