Alethic.AspNetCore.EcmaScript 0.2.0

dotnet add package Alethic.AspNetCore.EcmaScript --version 0.2.0
                    
NuGet\Install-Package Alethic.AspNetCore.EcmaScript -Version 0.2.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="Alethic.AspNetCore.EcmaScript" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Alethic.AspNetCore.EcmaScript" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Alethic.AspNetCore.EcmaScript" />
                    
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 Alethic.AspNetCore.EcmaScript --version 0.2.0
                    
#r "nuget: Alethic.AspNetCore.EcmaScript, 0.2.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 Alethic.AspNetCore.EcmaScript@0.2.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=Alethic.AspNetCore.EcmaScript&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Alethic.AspNetCore.EcmaScript&version=0.2.0
                    
Install as a Cake Tool

Alethic.AspNetCore.EcmaScript

The rendering-engine abstraction for ASP.NET Core: HTTP request in, rendered response out.

IRenderEngine is the whole contract. How rendering happens — what runtime, what language, whether anything is pooled — is entirely an implementation's affair, and nothing of it appears here:

public interface IRenderEngine
{
    Task PrepareAsync(CancellationToken cancellationToken = default);
    Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken = default);
    Task<IReadOnlyList<RenderRoute>?> GetRoutesAsync(CancellationToken cancellationToken = default);
}

Responses stream: they are returned as soon as status and headers are known, and the body follows as it is produced. Cancellation aborts the rendering itself, not merely the wait for it.

Mounting an engine

MapRenderEngine prepares the engine ahead of traffic, reads the application's route manifest, and maps an endpoint per route plus a fallback:

var app = builder.Build();
app.UseStaticFiles();
app.UseRouting();                      // explicit, or the fallback outruns static files

app.MapRenderEngine();

await app.RunAsync();
  • Routes marked Client are never mapped — whatever already serves the application shell keeps serving them, and the engine is never invoked on their behalf.
  • A route's id names its endpoint, so LinkGenerator.GetPathByName builds URLs from the manifest — canonical redirects and sitemaps use the platform facility.
  • ConfigureEndpoint applies host policy per route: output caching by render mode, authorization by path, anything the endpoint builder carries.
  • An engine that cannot prepare fails startup, and with it the deployment, rather than quietly serving nothing.

The route manifest

Patterns are URLPattern pathnames — the WHATWG syntax every framework's route grammar lowers to — so an application declares its routes without knowing anything about its host:

[
    { "pattern": "/parks/:parkRef", "renderMode": "Server",    "id": "park" },
    { "pattern": "/about",          "renderMode": "Prerender", "id": "about" },
    { "pattern": "/profile",        "renderMode": "Client",    "id": "profile" }
]

RenderMode is the per-route policy: Client (shell only, engine never invoked), Server (rendered per request), or Prerender (served like Server; the signal for caching or a build step). A pattern beyond what a route template can express is simply served by the fallback, losing only its per-route policy.

Implementations

  • Alethic.AspNetCore.EcmaScript.Node — renders on a Node runtime embedded in the process.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  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 was computed.  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.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Alethic.AspNetCore.EcmaScript:

Package Downloads
Alethic.AspNetCore.EcmaScript.Node

Rendering engine backed by a Node runtime embedded in the process through node-api-dotnet, and the pooled Node engines it runs on.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 105 8/23/2026
0.1.1 95 8/23/2026
0.1.0 94 8/23/2026