-
Notifications
You must be signed in to change notification settings - Fork 25.3k
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
Document what's new in ASP.NET Core for .NET 9 Preview 5 #32692
Comments
@MackinnonBuck please add a comment documenting the ReconnectionUI work that you've done. |
@javiercn please add a comment with the Static Assets compression work that you've done. |
@halter73 please add a comment documenting the AuthenticationStateProvider work. |
Improved Blazor Server reconnection experience:The following changes have been made to the default Blazor Server reconnection experience:
|
Detect the current component render mode at runtimeWe've introduced an API to make easier to answer 3 questions many component authors have. Making some scenarios more straightforward. These questions are:
ComponentBase (and per extension your components) offer a new Platform property (soon to be renamed RendererInfo) that exposes a `(Name, and IsInteractive) properties.
Finally, the other property ComponentBase exposes is These values are most useful during prerendering, as they allow you to know where the component will transition to after prerendering, and you might use that to render different content. For example, if you create a Form component and the form is going to be rendered interactively, you might choose to disable the inputs during prerendering, until the component becomes interactive and enables them. Alternatively, if the component is not going to be rendered in an interactive context, you might render markup to support performing any action through regular web mechanics. Optimizing static web asset deliveryA big part of delivering performant web applications involves optimizing asset delivery to the browser. This process entails many aspects, among some of them are:
To this effect, we are introducing a new functionality called
What are the things that MapStaticAssets does that UseStaticFiles doesn't?
What are some of the gains that we can expect: This is the default Razor Pages template (did we mention that this works for all UI flavors, Blazor, MVC, Razor Pages or your own custom framework?)
For a total of 331.1 KB uncompressed vs 65.5 KB compressed. This is the reduction that you get if you use the Fluent UI Blazor components library:
For a total of 478 KB uncompressed to 84 KB compressed. Or, if you use other popular Blazor component libraries like MudBlazor:
For a total of 588.4 KB to 46.7 KB The best part is that all of this happens automatically for the app after using You might be wondering, if I have turn on dynamic compression on the server, how do I benefit from this? To begin, this approach is simpler, because there is no server specific configuration for you to figure out. Then, even in this situation, you still benefit from leveraging MapStaticAssets instead of letting your IIS or other server do the compression for you. This is for two reasons:
|
.NET MAUI Blazor Hybrid and Web Solution TemplateWe are providing a new solution template in .NET 9 starting in Preview 5 to make it easier to create .NET MAUI native and Blazor web client apps that share the same UI. This allows you to create client apps that can target Android, iOS, Mac, Windows and Web maximizing code reuse. The template allows you to choose a Blazor interactive render mode for the web app and will create the appropriate projects for you, including a Blazor Web App and a .NET MAUI Blazor Hybrid app. It will then wire them up to use a shared Razor Class Library that has all of the UI components and pages. It also includes sample code that shows you how to use service injection to provide different interface implementations for the Blazor Hybrid and Blazor Web App. In .NET 8 this is a manual process documented here: Build a .NET MAUI Blazor Hybrid app with a Blazor Web App. To get started, install the .NET 9 SDK (Preview 5 or higher) then install the .NET MAUI workload which contains the template. dotnet workload install maui You can then create the template from the commandline like this: dotnet new maui-blazor-web Alternative, you can use the template from Visual Studio:
|
Simplified authentication state serialization for Blazor Web AppsWhen you create a new Blazor Web App project with authentication using "Individual Accounts" and you enable WebAssembly-based interactivity, the project will include a custom To make this easier, .NET 9 Preview 5 introduces // Server Program.cs
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents()
.AddAuthenticationStateSerialization(); // Client Program.cs
builder.Services.AddAuthorizationCore();
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddAuthenticationStateDeserialization(); By default, this will only serialize the server-side name and role claims for access in the browser. If you want to include all claims, you can write the following on the server instead: // Server Program.cs
builder.Services.AddRazorComponents()
.AddInteractiveWebAssemblyComponents()
.AddAuthenticationStateSerialization(options => options.SerializeAllClaims = true); The Blazor Web App project template has been updated to use these APIs, so you can try out using the new template. |
Progress report:
I'll report back here later to confirm today's goals are achieved. |
Progress report: All reference article content merged and cross-linked. What's New content for Blazor merged. 🍻 PR list ...
|
Nevermind! That's covered by an open issue. |
Description
Update the "What's new in ASP.NET Core 9.0" for .NET 9 Preview 5
Page URL
https://learn.microsoft.com/en-us/aspnet/core/release-notes/aspnetcore-9.0?view=aspnetcore-8.0
Content source URL
https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/release-notes/aspnetcore-9.0.md
Document ID
4e75ad25-2c3f-b28e-6a91-ac79a9c683b6
Article author
@Rick-Anderson @tdykstra @guardrex
The text was updated successfully, but these errors were encountered: