GitXplorerGitXplorer
d

Net8BlazorWebAssembly

public
34 stars
9 forks
6 issues

Commits

List of commits on branch main.
Unverified
06fdc8be9b8ad07842c1ee95fcd90b6cb9dd651b

Update readme with prerendering steps

ddanroth27 committed 2 years ago
Unverified
27bc4c423a4653bb38818dc2d3c7a57b71921442

Prerender App component

ddanroth27 committed 2 years ago
Unverified
0c0d0f69b1df25232aa825cc886122a75dfbd4a2

Update components to support prerendering

ddanroth27 committed 2 years ago
Unverified
26ce6f2b8cf6d330fe1e959075dd4a37eda90930

Update readme

ddanroth27 committed 2 years ago
Unverified
3144198a3d3be9ef78051da5fa8c5aaa4dfe98de

Update server Program.cs

ddanroth27 committed 2 years ago
Unverified
cd50cfde1a3dc48b2773be12f2236dd325ae9019

Update client Program.cs

ddanroth27 committed 2 years ago

README

The README file for this repository.

Blazor WebAssembly in .NET 8

This project demonstrates how to build an ASP.NET Core hosted Blazor WebAssembly app with .NET 8 and how to upgrade existing apps to take advantage of the latest features.

To upgrade an existing ASP.NET Core hosted Blazor WebAssembly app to .NET 8:

  1. Update the project file to target net8.0 and package references to the latest .NET 8 versions (commit).
  2. Move content from Client/wwwroot/index.html to Host.razor (commit):
    1. Update script to blazor.web.js.
    2. Replace title tag with HeadOutlet component.
  3. Update Client/Program.cs (commit):
    1. Remove builder.RootComponents.Add<HeadOutlet>("head::after").
  4. Update Server/Program.cs (commit):
    1. Add builder.Services.AddRazorComponents().AddWebAssemblyComponents().
    2. Remove app.UseBlazorFrameworkFiles().
    3. Replace MapFallbackToFile("index.html") with app.MapRazorComponents<Host>().AddWebAssemblyRenderMode().

To enable prerendering:

  1. Update all components to support prerendering from the server (commit).
  2. In Host.razor replace the id=app tag with <App @rendermode="@RenderMode.WebAssembly" /> (commit).

Open issues: