Natrix.Ssr 0.19.0

dotnet add package Natrix.Ssr --version 0.19.0
                    
NuGet\Install-Package Natrix.Ssr -Version 0.19.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Natrix.Ssr" Version="0.19.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Natrix.Ssr" Version="0.19.0" />
                    
Directory.Packages.props
<PackageReference Include="Natrix.Ssr" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Natrix.Ssr --version 0.19.0
                    
#r "nuget: Natrix.Ssr, 0.19.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Natrix.Ssr@0.19.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Natrix.Ssr&version=0.19.0
                    
Install as a Cake Addin
#tool nuget:?package=Natrix.Ssr&version=0.19.0
                    
Install as a Cake Tool

Natrix.Ssr

Server-side rendering helpers for Natrix applications hosted on ASP.NET Core.

Features

  • SsrEventLoop runs a request the way the browser runs the app: one single-threaded event loop per request. Wrap the whole request handler in SsrEventLoop.RunAsync — mount, waiting for prefetches, and writing the response. Continuations run one at a time on it, which is what keeps the lock-free signals safe while prefetches run concurrently on the network.
  • ServerPrefetchFeature starts every prefetch components register during Setup and waits for all of them, cascades included. Construct it with HttpContext.RequestAborted so an aborted request cancels its fetches.
  • MainScript component that resolves the fingerprinted _framework/dotnet.js static asset route from endpoint metadata.

Usage

Reference Natrix.Ssr from your server project and use components from Natrix.Ssr.Components.

app.MapFallback(httpContext => SsrEventLoop.RunAsync(async () =>
{
    var root = new SsrRenderRoot();
    var prefetch = new ServerPrefetchFeature(httpContext.RequestAborted);

    using var _ = new NatrixHostBuilder()
        .UseRootRenderer(root)
        .SetFeature<IServerPrefetchFeature>(prefetch)
        .UseRootComponent(() => new AppPage())
        .Build()
        .Mount();

    await prefetch.WaitForCompletionAsync();

    httpContext.Response.Headers.ContentType = "text/html";
    await root.WriteAsync(httpContext.Response.BodyWriter, cancellationToken: httpContext.RequestAborted);
}));

The same rule as in the browser applies inside the loop: never block synchronously on a task whose continuation has to come back through it.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.19.0 108 10/10/2026
0.18.0 103 10/10/2026
0.17.0 99 10/10/2026
0.16.0 114 10/6/2026
0.15.0 108 10/1/2026
0.14.1 96 9/30/2026
0.14.0 108 9/30/2026
0.5.0 142 8/16/2026
0.4.0 140 7/31/2026
0.3.0 135 7/26/2026
0.2.0 132 7/25/2026
0.1.0 137 7/25/2026