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
<PackageReference Include="Alethic.AspNetCore.EcmaScript" Version="0.2.0" />
<PackageVersion Include="Alethic.AspNetCore.EcmaScript" Version="0.2.0" />
<PackageReference Include="Alethic.AspNetCore.EcmaScript" />
paket add Alethic.AspNetCore.EcmaScript --version 0.2.0
#r "nuget: Alethic.AspNetCore.EcmaScript, 0.2.0"
#:package Alethic.AspNetCore.EcmaScript@0.2.0
#addin nuget:?package=Alethic.AspNetCore.EcmaScript&version=0.2.0
#tool nuget:?package=Alethic.AspNetCore.EcmaScript&version=0.2.0
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
Clientare never mapped — whatever already serves the application shell keeps serving them, and the engine is never invoked on their behalf. - A route's
idnames its endpoint, soLinkGenerator.GetPathByNamebuilds URLs from the manifest — canonical redirects and sitemaps use the platform facility. ConfigureEndpointapplies 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 | Versions 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. |
-
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.