Microsoft recently released .NET 8 Preview 3. This new release contains many new enhancements to ASP.NET Core, such as native AOT support, server-side rendering with Blazor, Razor component rendering outside of ASP.NET Core, section support in Blazor, or monitoring Blazor Server circuit activity, infoq reports.
In .NET 8 Preview 3, AOT support for ASP.NET Core was added. This makes it possible to publish an ASP.NET Core application with native AOT by creating a standalone application that is precompiled (AOT) in native code. Publishing and deploying a native AOT application can reduce the following things: disk size, memory requirement, and startup time.
Publishing the application as a native AOT improves startup time and application size. In the experiment, startup time was reduced by 80% and app size by 87%. These and other metrics are available on Microsoft’s public benchmarking dashboard.
Not all features and libraries in ASP.NET Core are compatible with native AOT. The .NET 8 platform represents the beginning of work to incorporate native AOT into ASP.NET Core, with an initial focus on including support for applications using minimal APIs, or gRPC, and deployed in cloud environments.
Initial support for server-side rendering using Blazor components has been added in this preview release. This is the beginning of work to unify Blazor to enable the use of Blazor components for all web UI needs, both client-side and server-side.
Work on enabling server-side rendering with Blazor components made it possible to render Blazor components outside the context of an HTTP request. Razor components can be rendered as HTML directly in a string or stream, independent of the ASP.NET Core hosting environment. This is useful in scenarios where you want to generate HTML snippets.
Another important Blazor-related feature is the addition of the SectionOutlet and SectionContent components. These provide support for identifying outputs for content that will be populated later. Sections are often used to define placeholders in layouts that are then populated by specific pages. Sections are referenced by either a unique name or a unique object identifier