NE.Standard

Web hosting

Web is the platform implemented today: ASP.NET Core for the shell and the transport, SignalR for the live channel, and a TypeScript client embedded in the assembly.

Startup

WebStartupBuilder.Configure<TWebStartup, TStartup>(services) drives a WebStartupBase<TStartup> subclass:

internal sealed class AppWebStartup : WebStartupBase<AppStartup>
{
    protected override void ConfigureServices(IServiceCollection services)
    {
        _ = services.AddStandardRenderers();
        _ = services.AddMaterialWebIcons(MaterialIconStyle.Fill | MaterialIconStyle.Outlined, AppIcons.All());
    }
}

WebStartupBase<TStartup>.Configure registers five option types — WebViewRenderCacheOptions, WebEndpointOptions, WebValueOptions, WebHubOptions (read from configuration first) and WebResponseCompressionOptions — calls your ConfigureServices override, then registers the framework's own web defaults: response compression (configured, not yet installed), SignalR with the framework's JSON wire settings, IWebAssetRegistry, IWebRendererRegistry, IWebViewRenderer, the file-system render cache (IWebViewRenderCache) and the task that clears it on startup, the task that compresses the page's scripts and stylesheets in the background once the host has started, the staging store for large values, the update sink (IUIUpdateSink), the sign-in's key handover (a new session key reaches its page as a one-time token the page trades for the cookie), the download address provider and the content address resolver — and finally UIStartupBuilder.Configure<TStartup>, which wires the platform-agnostic engine and its own defaults: the session store, the file store, the upload and download services, authorization and the exception handler (platforms says where that seam runs). The default services are registered with TryAdd, so an implementation your ConfigureServices registered first wins.

WebValueOptions bounds a value too large for the hub, which the client posts beside it instead: MaxValueSize (4 MB of JSON by default, refused as it arrives), MaxStagedBytesPerSession (64 MB) and MaxStagedBytesTotal (512 MB, every session together) for what may wait staged at once, and StagingRetention (two minutes).

Hosting itself is five lines:

WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
WebStartupBuilder.Configure<AppWebStartup, AppStartup>(builder.Services);
WebApplication app = builder.Build();
await app.MapStandardUIWebAsync();
await app.RunAsync();

MapStandardUIWebAsync

Maps, in order: every registered asset's own GET route, the file transfer endpoints (POST /_ne/files/upload, GET /_ne/files/selection/{selectionId} — what a selection still holds, for a shelf drawn again after a reload — GET /_ne/files/upload/{fileId} — one upload read back, a shelf's thumbnail — and GET /_ne/files/{token}, a staged download), the staged-value endpoints (POST /_ne/values, GET /_ne/values/{token}), the sign-in's key trade (POST /_ne/session/key), the web app manifest (GET /_ne/manifest.webmanifest), the protected-content endpoint (GET /_ne/content/{**key} — a key may hold /), the words of a language (GET /_ne/words/{language}.json), the compiled-view endpoint (GET /_ne/view, mapped only when WebEndpointOptions.EnableClientViewEndpoint is set), the response compression middleware in front of everything just mapped, the SignalR hub at /_ne/hub, and last the catch-all shell route GET /{**route} — which matches every path there is but the framework's own.

Everything the framework serves stands under /_ne/: the hub, the endpoints above, and its assets — the stylesheets under /_ne/css/, the scripts under /_ne/js/, the fonts under /_ne/fonts/, a component package's bundles and an icon pack's stylesheet among them. The shell route answers nothing under that prefix, so an address beneath it that nothing maps is a 404, never a page; the rest of the address space is the application's, and its own routes and static files cannot collide with the framework's.

That last part is why an application's own static files must be served before routing. app.UseStaticFiles() left where ASP.NET puts it by default runs after routing has already matched the catch-all, stands down, and every file comes back as the not-found page, answered with a 404. Call it, and UseRouting(), by hand before the map:

app.UseStaticFiles();
app.UseRouting();

await app.MapStandardUIWebAsync();

MapStaticAssets() looks like the modern replacement and is not one here: its precompressed variants and the framework's own response compression together return an empty body for every compressible asset.

WebEndpointOptions gates the hub and the shell route behind ASP.NET authorization: RequireAuthorization (off by default) and AuthorizationPolicy (the default policy when unset). The other endpoints are left out of that gate: assets are public and carry no session check at all, so nothing private belongs in one; the file, staged-value and content endpoints each require the session cookie and its authorization instead. Its content and downloads always go out inert: a Content-Security-Policy that runs nothing, HTML, XML or SVG sent as an attachment, and a script, a stylesheet, WebAssembly or a type that does not parse as application/octet-stream; its InlinePassiveContent (off by default) shows a PDF, a raster image, plain text, audio or video inline without the policy. Its RestrictFraming (on by default) lets only the page's own origin frame a page, and FrameAncestors names other framers (a frame-ancestors list, 'self' https://partner.example; see security). The application's icon is set in UIStartupBase.ConfigureApplication with application.SetIcon("/brand/icon.svg") (or suppressed with application.SetNoIcon(), which writes data:, so a browser never asks for an unserved /favicon.ico), and WebEndpointOptions.Icon overrides it per web host — an absolute path under the application's static files or a data: URL:

services.Configure<WebEndpointOptions>(options => options.Icon = "/brand/icon.svg");

Without either, the shell serves the framework's default NE mark at /_ne/icon.svg (and NE.Standard.UI.Desktop applies the matching multi-size .ico to the window and WinExe executable). EnableClientViewEndpoint (off by default) maps GET /_ne/view alongside HTML rendering so remote NE.Standard.UI.Client sessions can connect to the same web host; an API-only host with no HTML shell or web assets uses NE.Standard.UI.Server (UIServerStartupBase<TStartup>, UIServerStartupBuilder, MapStandardUIServerAsync), which maps /_ne/view unconditionally.

Every response except the hub's carries X-Content-Type-Options: nosniff — the hub is mapped outside that filter. The three POSTs (upload, staged value and the sign-in's key trade), the two reads of a session's uploads (/_ne/files/selection/… and /_ne/files/upload/…) and the hub — its negotiate and every transport, a WebSocket handshake included — refuse a request from any other origin with 403 before the session check even runs: Sec-Fetch-Site must be same-origin or none (a sibling subdomain's same-site is refused too), and without it an Origin, when one is sent, must be this one — scheme, host and port, a port left out read as its scheme's default. So a page elsewhere can neither fill a session's storage by making the visitor's browser post to it nor attach to the session's views over a WebSocket, which no CORS rule stops. The staged-value POST and the sign-in's key trade (POST /_ne/session/key) take only application/json and answer anything else 415, since a plain-text body is a request any page may send without asking. A download is answered Cache-Control: no-store, and a page private, no-cache: both carry one session's data.

A page is served only as a document. A request for a page whose Sec-Fetch-Dest names anything else — an <img>, a script, a fetch — is a 404 before any session, view filter or hook runs, and so is a cross-site frame's while only the page's own origin may frame it. A page carries X-Frame-Options: SAMEORIGIN (where the host sent none) and a frame-ancestors policy appended beside the host's own Content-Security-Policy. A service worker of the application's own that precaches pages with fetch(url) gets that 404: let it pass a navigation's own request on, whose destination is a document.

Behind a TLS-terminating proxy, forward the scheme. The Origin fallback compares the scheme, so a proxy that takes https and passes plain http on makes every page's own Origin look foreign: a browser that sends no Sec-Fetch-Site gets 403 from the hub and both POSTs. The session cookie goes by the scheme too: over HTTPS it is __Host-<ClientKey> and Secure, and a request read as plain HTTP is sent the plain name without Secure. Let the host read the proxy's X-Forwarded-Proto before the framework's endpoints:

builder.Services.Configure<ForwardedHeadersOptions>(options =>
{
    options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto;
    // Name the proxy in options.KnownProxies / KnownNetworks unless it is on the loopback.
});

app.UseForwardedHeaders();
app.UseStaticFiles();
app.UseRouting();
await app.MapStandardUIWebAsync();

A page that fails — the view cannot be resolved, or a getter throws while this reader's values are rendered — is answered with the error route (UIErrorHandlingOptions.ErrorRoute) in place rather than a bare 500. That page gets the real exception text only when IncludeExceptionDetail is on — the same switch that gates a failed command's reported message (see interactions and effects) — as a UIErrorDetail in its message navigation parameter, handed over in-process: a message in the address is plain text, which the default page never shows. Off, the page shows UIErrorHandlingOptions.ErrorPageMessage.

Response compression

WebResponseCompressionOptions, on by default:

Option Meaning
Enabled whether the framework installs the middleware at all (default true)
Level the level the per-response middleware runs Brotli and Gzip at (default Optimal)
EnableForHttps whether compression also applies over HTTPS (default true) — turn it off if a page renders a secret beside text an attacker controls (BREACH)

The framework's own scripts and stylesheets, and a package's, do not go through the middleware: they are compressed once, at Brotli's and Gzip's smallest size, in the background after the host starts, and served as they are by Accept-Encoding — a font is left out, woff2 being compressed already. Enabled governs both.

Turn Enabled off where a reverse proxy already compresses. A host that maps endpoints inside UseEndpoints hands the framework something that is not an IApplicationBuilder; it logs that it could not install the middleware rather than skipping silently.

The render cache

A page with a controller renders twice per request: once for the view's shared shape — cached — and once with this session's own values. WebViewRenderCacheOptions:

services.Configure<WebViewRenderCacheOptions>(options =>
{
    options.DirectoryPath = "/var/ne-render-cache";
    options.ClearOnStartup = true;
});

DirectoryPath is where FileSystemWebViewRenderCache keeps the cached shape, keyed by {ViewKey}:{Language}:{Fingerprint} — the fingerprint of the compile, so a render made before the code changed is never served after it. The cache writes only inside a renders folder of its own there — one folder per view and language, one per compile beneath it — so it never empties a folder the application keeps anything else in. Unset, it is a folder of the application's own in the system temp folder — NE.Standard.UI/<entry assembly>-<hash of the folder it runs from> under Path.GetTempPath() — so a read-only application folder (a container image, run-from-package, an IIS pool without write rights) costs nothing, and two applications on one machine never share a cache. ClearOnStartup (default true) wipes it on boot, so a deployed change to a view is never served from a stale entry left by the previous build. Turned off — what a folder several processes share wants — a start instead removes every compile of a view but the newest, and temporary files a stopped process left behind.

A view without a controller is served from its entry whole: the page's markup and its metadata, kept as UTF-8 and written into the response as they are. A view with a controller reads only the bindings its first paint fills off the entry, so that is all its entry keeps. The bindings are written last, and a read takes an entry only once they are there. Requests that miss the same entry together render it once and write it once.

The cache is best-effort: a folder that cannot be cleared, read or written costs the cache, never the page or the host. Each kind of failure is logged once as a warning, and the page renders without the disk — still held in memory, as below.

Each entry is also held in memory once it has been read, so a page load does not go back to disk; MaxHeldRenders (default 256) bounds how many and MaxHeldBytes (default 128 MB) how much, and the least recently read go first past either.

Assets and icon packs

IWebAssetRegistry collects every WebAssetDescriptor the host serves — the client bundle, stylesheets, icon packs — each mapped to its own GET route by MapStandardUIWebAsync, versioned (?v=) and cached immutable for a year when the version matches, no-cache with an ETag otherwise; either answers 304 to a browser that revalidates bytes it already holds. The framework's own sit under /_ne/css/, /_ne/js/ and /_ne/fonts/; an asset of the application's own names whatever path it likes outside /_ne/. AddStandardRenderers() registers an IWebComponentRenderer for every built-in component; call it once from ConfigureServices.

Icons ship as separate packages, Material Symbols:

services.AddMaterialWebIcons(MaterialIconStyle.Fill | MaterialIconStyle.Outlined, MaterialIcons.Home, MaterialIcons.Search);
services.AddMaterialWebIcons(MaterialIcons.Home, MaterialIcons.Search); // MaterialIconStyle.Fill
services.AddMaterialWebIcons(MaterialIconScope.All, MaterialIconStyle.Fill); // every glyph: the font, and a rule per glyph per style

Call it as many times as suits the application — a feature can register its own icons where it lives, and the pack builds one stylesheet from everything registered by the time the host starts. Name a glyph by its MaterialIcons constant, the value a component's SetIcon takes too: a bare "home" registers, but SetIcon("home") names a glyph no rule draws, and an icon no registration covers draws nothing. The page's head preloads every font asset — the icon pack's among them — before the stylesheets, so a glyph is not a blank box for an extra round trip; the framework's own text face, Geist, only when an entry of the theme's font family list is Geist.

Framework glyphs drawn by an icon pack

The framework's own marks are the ne- pack (UIGlyphs), mostly filled. An application whose icons are another drawing maps any of them onto a glyph of its registered pack, once, beside the pack's registration:

services.AddMaterialWebIcons(MaterialIconStyle.Outlined, AppIcons.All());
services.MapUIGlyph(UIGlyphs.Copy, MaterialIcons.Outlined(MaterialIcons.ContentCopy));
services.MapUIGlyph(UIGlyphs.Edit, MaterialIcons.Outlined(MaterialIcons.Edit));
services.MapUIGlyph(UIGlyphs.Delete, MaterialIcons.Outlined(MaterialIcons.Delete));

The glyph is redrawn wherever it is an icon value: UIMenuItems.* and UIIconButtons.*, the tab menu, a key-value row's buttons, a UIDialogs ×, any SetIcon(UIGlyphs.Copy) — on the first paint and on every update alike, since a stylesheet after the framework's restates the glyph's class with the pack's drawing. The pack must be registered, the target need not be. The startup fails on a key that is not a UIGlyphs name, on a picture or another ne- glyph as the target, on mapping one glyph two ways, and on a target no registered pack draws. A mark the framework's stylesheet draws itself — a select's chevron, a checkbox's tick, a tree's folder — is not an icon value and keeps the framework's face. A pack of the application's own takes part by registering an IWebIconPack that writes the declarations its rule for a name sets.

Sessions on the web

The session's secret travels in an HttpOnly cookie named by UISessionOptions.ClientKey — by default ne.ui.session. followed by the application's name, since a browser keeps one set of cookies per host whatever the port and two applications under one name would sign each other out. Over HTTPS the cookie is that name under the __Host- prefix — Secure, Path=/, no Domain — so a sibling subdomain can neither set nor shadow it; the plain name is not read there, and a ClientKey carrying a cookie prefix of its own is refused at startup. It is written only by a page load — the shell render, or the trade that hands a signed-in page its new key — and read by the hub off its negotiate request, which is what makes both halves of one page load share a session. A sign-in moves the session to a new id at once: the page is pushed a one-time token it trades for the new cookie, and loads, uploads, staged values and downloads wait for it (security). The edge hashes the secret into the session id (SHA-256, as lower-case hex) as it reads the cookie, and nothing past it holds the secret (security). With ClientKeyLifetime set, the cookie a load presented is written back as the response's headers go out, and only while its session still stands with no rotation to a new id pending.

Only a page load issues a session; the hub never does. An attach whose cookie names no session the store holds — none, an unknown or idle one, one an in-memory store lost to a restart, one removed during the attach — is answered with a reload, since a session issued there could never reach the browser: the reload's render writes a new key and the page attaches under it. A browser that keeps no cookie therefore cannot run a page with a controller — nor can a cross-site iframe the SameSite=Lax cookie does not reach. The page reloads once and then stays as rendered, with an error in the console (and it does not reload at all where navigator.cookieEnabled is false).

A dropped connection is started again for as long as the server keeps the page's runtime. The page tries at once, then waits a random time up to a growing ceiling of 30 s between tries, for UIPersistenceOptions.DisconnectedRetention (10 minutes, as the attach reports it); the browser going online or the page becoming visible tries again at once. A socket that comes straight back keeps its connection and its calls (SignalR's stateful reconnect), and a Background command keeps running while the page is away. Past a grace of two seconds — a blip shows nothing — the document element carries data-ui-connection="reconnecting" and a quiet notice says "Reconnecting…", both gone by themselves once the page is attached again; once the window is spent the attribute reads lost and a notice offers the reload. A press held across the drop more than 10 s after it was made is dropped and said, not run late. A value on its way when the connection dropped is sent again once the page is attached — unless another tab or user changed the field meanwhile: then the field keeps the reader's words, marked, and they go with the reader's next edit.

A page whose runtime is gone reloads, and carries its unsaved input over. A reconnect that finds a runtime built since the page attached — the one it held evicted under MaxRuntimesTotal, past its retention, or lost to a restart with a session store that kept the session — reloads the page at once rather than lay the new runtime's state over what the page shows. Before it does, and when the connection is given up, what the fields hold that the server never took is kept in sessionStorage for the tab and the address, for 30 minutes; the reloaded page writes it back into its fields as the reader's edit, held and marked where the server's value changed meanwhile. A password, a one-time code, a card field and a picker's uploads are never kept, and a reload over another compile of the view keeps nothing. A page's first attach never counts, a second tab's included.

A new session starts in the browser's language: the first Accept-Language entry the translator has, as written or by its primary language (nl-BE finds nl), else UILocalizationOptions.DefaultLanguage; NegotiateLanguage = false turns it off (localization). The page reports its time zone as it attaches, and the session keeps it (UserSessionState.TimeZone, read by a controller as Context.TimeZone).

What the request says about its connection reaches a controller and the filters as UIConnectionInfo (Context.Connection, UIViewFilterContext.Connection, UICommandFilterContext.Connection), captured at the page render and at every attach: RemoteAddress — HttpContext.Connection.RemoteIpAddress, so behind a proxy it is the client's only once UseForwardedHeaders runs ahead of the framework — UserAgent, and BaseUri, the application's root (scheme, host and path base, ending in /) that an absolute link it hands out is built on. Every part is what the client or a proxy said: it describes a request and never proves one.

UISecurityOptions.IdentitySource says where identity comes from: Session (the default) means the application signs users in itself through Context.SignInAsync; Claims makes the host's ClaimsPrincipal — filled from HttpContext.User — authoritative in both directions, mapped by an IUserClaimsMapper. Either way, the framework consumes a principal and never authenticates: the host owns AddAuthentication() and whatever scheme populates HttpContext.User.

The principal is read at every page render and every hub attach: an authenticated one refreshes the session's user, roles and permissions, and an anonymous one signs the session out — in the store the command check reads, not only on the page. A command in a tab already attached is checked against what the last of those requests left there. Under Claims the setup is the host's authentication plus the source:

application.ConfigureSecurity(o => o.IdentitySource = UIIdentitySource.Claims);
builder.Services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme).AddCookie();
builder.Services.AddAuthorization();

WebApplication app = builder.Build();

app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();

await app.MapStandardUIWebAsync();

End the UI session where the host signs out. Under Claims a page's connection keeps the principal it connected with and a command is checked against the session store, so an endpoint of the host's own that signs a user out calls await HttpContext.EndUISessionAsync() beside its SignOutAsync: the session behind the request's cookie ends, and every page open under it is sent to sign in.

Call UseAuthentication() and UseAuthorization() by hand, after UseRouting(). Left to the host, ASP.NET puts both ahead of the whole pipeline, and so ahead of the UseRouting() written by hand above: the principal still arrives, but authorization runs before any endpoint is matched, and with WebEndpointOptions.RequireAuthorization on every page fails with "contains authorization metadata, but a middleware was not found that supports authorization".

The page lifecycle

A request renders the page server-side — markup, theme CSS and a metadata blob describing every binding, property, event and interaction — and that markup is the finished page; nothing the client does afterwards changes what the reader is looking at. The browser then attaches over SignalR. The page whose render built its runtime presents where that render stood, and its first attach carries only what changed since; any other attach — a reconnect, a second tab, a reload that found the runtime already there — carries the whole initial change set (scalar values plus every bound collection), which the page reconciles against what it holds. From then on two channels apply changes: the invoke return value of a command, and the pushed "ui.changes"/"ui.commandResult" messages the runtime's flush loop drives. A reload re-renders from scratch; state survives it if and only if it lives in the controller — nothing client-side is replayed onto a fresh page.

Running in production

Several servers need sticky sessions

A page's controller and its state live in the memory of the process that built the page. Everything that page does afterwards has to reach that same process: the SignalR connection, the upload POST whose selection the controller then reads, and the staged-value POST and GET that carry a value too large for the hub — a staged value is held in that process's memory and redeemed by that session's hub update. Behind a load balancer, turn on session affinity (a cookie-based one is simplest); without it, a page works until its first request lands on the wrong server.

Defaults that are single-process

Service Default What it means
IUserSessionStore UserSessionMemoryStore sessions, and whoever is signed in, are lost on restart and not shared between servers
IUIFileStore FileSystemUIFileStore metadata in process memory, content on local disk under UIFileOptions.StorageRoot
value staging in process memory not replaceable; this is what sticky sessions cover

For a farm, register your own session store (services.AddUserSessionStore<TStore>(), or AddSignedInUserSessionStore<TStore>() to keep only signed-in sessions there) and IUIFileStore (a database, a shared cache, blob storage) in ConfigureServices; the framework's defaults only fill what is still empty. Under the split store an anonymous session lives in each process's memory, so it is affinity, not the store, that keeps it. Affinity is still required either way — the runtimes themselves never leave their process.

Limits

Each session is bounded in what it can make the server hold, and so is every session together where a session's share would not bound the disk or the memory:

Option Default At the limit
UIPersistenceOptions.MaxRuntimesPerSession 64 the session's longest-idle disconnected runtime is evicted for the new page; when every runtime it holds has a page connected, the new page is refused
UIPersistenceOptions.MaxUnclaimedRuntimesPerSession 4 runtimes a page render built that no tab has presented yet — a crawler's or a script's page loads; past it the session's longest-idle one of those is evicted, never one a tab presented
UIPersistenceOptions.MaxRuntimesTotal 4096 every session's runtimes together; the runtime that has been without a page longest (by when its last tab left), of any session, is evicted for the new page — one no tab ever presented first, then a reader's — one running a command passed over; when none can go, the new page's runtime is refused before its controller is built and the first refusal of a burst is logged as a warning — a page render then shows the error route (a 500 without one), an attach retries and then shows the page's connection-lost notice
UIPersistenceOptions.MaxQueuedChangeSets / MaxQueuedChangeBytes 64 / 8 MB (estimated) change sets waiting to reach one runtime's pages; a set queued behind another for the same pages joins it, a later value replacing an earlier one, and past either bound the queue is dropped for a full resync
UIPersistenceOptions.MaxQueuedChangeBytesTotal 256 MB (estimated) change sets waiting across every runtime; the runtime whose set would cross it drops its queue for a full resync
UIPersistenceOptions.SendTimeout 30 s one change set's send to one page; a send past it is given up as a failed one — a full resync, that page's connection aborted and attached again — so a stalled socket does not hold the runtime's other tabs
UISessionOptions.MaxUnclaimedSessions 100 000 sessions a page load issued that no tab attached to, in the in-memory store; past it the oldest is given up, and its tab, attaching later, gets a new session
UISecurityOptions.MaxClientValueElements / MaxClientValueDepth 100 000 / 32 the list items and document fields, through every level, and the nesting of a value a client writes; past either it is refused as a value its input cannot read, never built — text is not counted
WebHubOptions.MaxCallsPerSecond / MaxCallBurst 100 / 400 a token bucket per hub connection — one tab — refilled at the first and holding at most the second; a call past it fails alone (a HubException) and the connection stays open, its first refusal logged as a warning
UIFileOptions.MaxUploadBytesPerSession 256 MB an upload that would cross it is answered 413
UIFileOptions.MaxFileSize 32 MB a single file past it is stopped as it arrives and answered 413
UIFileOptions.MaxUploadBytesTotal 4 GB every session's uploads together; an upload that would cross it is answered 413, and the first refusal of a burst is logged as a warning
UIFileOptions.MaxDownloadBytesPerSession / MaxDownloadBytesTotal 256 MB / 4 GB uncollected staged downloads for one session or across every session; staging past either fails
WebValueOptions.MaxValueSize 4 MB a staged value past it is answered 413
WebValueOptions.MaxStagedBytesPerSession 64 MB what one session may have staged at once; a value that would cross it is answered 413
WebValueOptions.MaxStagedBytesTotal 512 MB every session's staged values together; a value that would cross it is answered 503, since the server is full rather than the request too large

The UIPersistenceOptions, UISessionOptions, UISecurityOptions and UIFileOptions limits are set in the UIStartupBase subclass (ConfigurePersistence, ConfigureSessions, ConfigureSecurity, ConfigureFiles), WebValueOptions and WebHubOptions through services.Configure<…>:

protected override void ConfigureApplication(UIApplicationBuilder application)
{
    application.ConfigurePersistence(persistence => persistence.MaxRuntimesPerSession = 32);
    application.ConfigureFiles(files => files.MaxUploadBytesPerSession = 64 * 1024 * 1024);
}

The totals, MaxCallsPerSecond, MaxQueuedChangeBytes, MaxQueuedChangeBytesTotal and MaxUnclaimedSessions take zero or null for no limit, SendTimeout null. The default MaxRuntimesTotal is about 5 GB of the demo's pages (a runtime measured at about 1.2 MB); a process serving more open pages than that raises it to what its memory affords.

A page load without the cookie gets a new session, so a client can open many sessions, each with its runtimes, a page load at a time — which is what MaxRuntimesTotal holds. The hub cannot: it never issues a session (Sessions on the web), and one connection attaches to one page — a second attach on it to another page is refused, while an attach to the page it already holds goes through, since the page attaches again on the same connection for a full resync. The hub also caps what one call may ask for: an item window at most 1000 rows (UIItemWindowClientRequest.MaxCount), a lookup of words at most 256 keys. Socket counts and request rates stay the reverse proxy's job (or ASP.NET Core's rate limiter) — page loads (GET /{**route}), hub connections (/_ne/hub), and the upload and staged-value POSTs in particular; everything of the framework's is under /_ne/, so one prefix names it.

Metrics and tracing

The framework's meter and activity source are both named UIDiagnostics.Name ("NE.Standard.UI"). With OpenTelemetry:

builder.Services.AddOpenTelemetry()
    .WithMetrics(metrics => metrics.AddMeter(UIDiagnostics.Name))
    .WithTracing(tracing => tracing.AddSource(UIDiagnostics.Name));
Instrument What it reports
ne.ui.runtimes the runtimes held now: open pages and the ones kept for a while after they closed
ne.ui.runtimes.attached the connections attached to a runtime: the pages open now
ne.ui.runtimes.created runtimes created, one per page a controller was built for
ne.ui.runtime.start.duration how long a new runtime took to initialize and start its controller, in seconds
ne.ui.updates.pending change sets waiting to be sent, over every client — a slow client shows here before its queue overflows
ne.ui.sessions the sessions the in-memory session store holds
ne.ui.files, ne.ui.files.size the files the default file store keeps on disk, and their bytes
ne.ui.command.duration how long a command took, in seconds, tagged ne.ui.route (the route template) and ne.ui.command.outcome (ok or failed)
ne.ui.flush.duration how long one scheduled flush pass over every runtime took, in seconds
ne.ui.flush.failures runtimes whose scheduled flush failed
ne.ui.web.connections the hub connections open now
ne.ui.web.render.duration, ne.ui.web.render.length how long a page render took, in seconds, and how long the page is, in characters before compression, tagged ne.ui.route
ne.ui.web.render_cache.held, ne.ui.web.render_cache.held.size the renders the render cache holds in memory, and the bytes they take
ne.ui.web.render_cache.disk.io bytes the render cache read from and wrote to its folder, tagged ne.ui.io.direction
ne.ui.web.values.staged, ne.ui.web.values.staged.size the values staged beside the hub now, and their bytes
ne.ui.web.files.transferred bytes uploaded to and downloaded from the file endpoints, tagged ne.ui.io.direction

Each command also runs inside a ui.command span. The sizes a gauge reports are read only when a listener collects.

Logs

The framework logs through the host's ILogger. A log line carries a short fingerprint of the session id rather than the id, which still tells one session's lines from another's; the id itself is a hash of the cookie's secret and opens no session.

Extending the platform

A custom component's HTML comes from an IWebComponentRenderer (ComponentTypeKey, Render(WebRenderContext)), registered with services.TryAddEnumerable(ServiceDescriptor.Singleton<IWebComponentRenderer, MyRenderer>()) — the same pattern AddStandardRenderers() uses for every built-in.

On the client, window.NEStandardUI exposes eight register* extension points, six of them keyed by a plain string: ConverterRegistry (a named convert function), EventCatalog (a native DOM event name and/or a custom attach), DomOperationRegistry (a WebDomOperationKind → DOM mutation, and it can override a built-in one), ValueReaderRegistry (data-ui-value-kind → how a written value is read off an element), the effect registry for ClientEffect kinds, and client-strings.ts for words the client writes itself; registerCollectionSink hands a component its bound collection as values, and registerEngine starts a package's own engine with the framework's services.

A custom client effect names its own ClientEffect.Kind (prefix it — the client keys handlers by this string) and registers a handler with NEStandardUI.registerEffect; nothing needs registering on the server side, since an effect travels by value.GetType() and nothing in the framework reads one back.

This is a pointer, not a tutorial: read the client's sources under src/Platforms/Web/NE.Standard.UI.Web/Client before adding to any of these.