Document DB v7: Temporal Support Feed The Machine Here
Blazor Hosting
Shiny Blazor Hosting provides an IAppSupport service for Blazor WebAssembly apps — app version, browser user-agent, screen and viewport dimensions, plus live culture and time-zone change notifications. It’s the browser-side sibling of MAUI Hosting’s IAppSupport, reading browser state synchronously through IJSInProcessRuntime (the same approach as Stores for WebAssembly).
| GitHub | |
| Downloads |
Frameworks
Blazor
Operating Systems
Web
Features
Section titled “Features”IAppSupport— app version, browser user-agent (raw string + best-effort parsed browserVersion), screen and viewport dimensions- Live
CultureChanged/TimeZoneChangedevents with lazy subscription - Synchronous browser reads via
IJSInProcessRuntime— noawaitneeded for property access - App version supplied at registration from the head assembly’s
ThisAssemblyconstant — no runtime reflection
-
Install the NuGet package:
Terminal window dotnet add package Shiny.Extensions.BlazorHosting -
Reference the bundled script in
wwwroot/index.html, beforeblazor.webassembly.js:<script src="_content/Shiny.Extensions.BlazorHosting/shiny-appsupport.js"></script> -
Register in
Program.cs, passing your app’s version constant:using Shiny;var builder = WebAssemblyHostBuilder.CreateDefault(args);builder.Services.AddAppSupport(ThisAssembly.AssemblyVersion);await builder.Build().RunAsync();
@inject IAppSupport App
@code { protected override void OnInitialized() { // Snapshot Version version = App.AppVersion; string? userAgent = App.UserAgent; Version? browser = App.UserAgentVersion; // best-effort, may be null var (w, h) = (App.BrowserWidth, App.BrowserHeight); // viewport — read live var (sw, sh) = (App.ScreenWidth, App.ScreenHeight); // physical screen
// Live updates App.CultureChanged += (s, e) => InvokeAsync(StateHasChanged); App.TimeZoneChanged += (s, e) => InvokeAsync(StateHasChanged); }}| Member | Source | Notes |
|---|---|---|
AppVersion | Registration argument | Pass ThisAssembly.AssemblyVersion (or another compile-time constant) — never reflected |
UserAgent | navigator.userAgent | Read once and cached for the page’s lifetime |
UserAgentVersion | Parsed from UserAgent | Best-effort browser version (Edge → Opera → Firefox → Chrome → Safari); null if unparseable |
ScreenWidth, ScreenHeight | window.screen.* | Physical screen size |
BrowserWidth, BrowserHeight | window.innerWidth/innerHeight | Viewport — read live, so reflects window resizes |
CurrentCulture + CultureChanged | CultureInfo.CurrentCulture | 30-second poller raises the event on change |
CurrentTimeZone + TimeZoneChanged | TimeZoneInfo.Local | 30-second poller raises the event on change |
AI Coding Assistant
Section titled “AI Coding Assistant”Step 1 — Add the marketplace:
claude plugin marketplace add shinyorg/skills Step 2 — Install the plugin:
claude plugin install shiny-extensions@shiny Step 1 — Add the marketplace:
copilot plugin marketplace add https://github.com/shinyorg/skills Step 2 — Install the plugin:
copilot plugin install shiny-extensions@shiny