docs: update portal for WRNexusJS 0.2.25

This commit is contained in:
2026-07-14 00:48:59 +05:30
parent 67c4ed5913
commit 6f56187b26
77 changed files with 566 additions and 524 deletions
+21 -6
View File
@@ -10,12 +10,12 @@ page wrnexuscsr {
<header class="topbar">
<a class="brand" href="/"><span>W</span> WRNexusJS</a>
<nav aria-label="Primary"><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a></nav>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.2.24</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
<div class="topbar-actions"><a class="preview-pill" href="/access">Private preview · v0.2.25</a><button data-wire-theme-toggle class="theme-button" aria-label="Toggle color theme" title="Toggle color theme">◐</button></div>
</header>
<div class="mobile-doc-nav"><details><summary>Browse documentation</summary><nav><a href="/getting-started">Get started</a><a href="/packages">Packages</a><a href="/language">Language</a><a href="/architecture">Architecture</a><a href="/tutorial">Tutorial</a><a href="/guides/project-structure">Guides</a><a href="/examples">Examples</a><a href="/search">Search</a></nav></details></div>
<main class="page package-page">
<aside class="sidebar"><a href="/packages">← All packages</a><span class="category">Frontend</span><h2>@wrnexus/csr</h2><p>Reactive, navigation, and realtime browser runtimes.</p><span class="status status-beta">Private preview · 0.2.24</span><nav><a href="#access">Access</a><a href="#guide">Guide</a><a href="#api">Complete API</a></nav></aside>
<article id="main" class="documentation"><section class="doc-intro"><span class="eyebrow">Frontend · Preview</span><h1>@wrnexus/csr</h1><p>Reactive, navigation, and realtime browser runtimes.</p><section id="access" class="access-callout"><h2>Private registry access required</h2><p>This package is not available from the public npm registry. After WorkRoot approves access and supplies private registry instructions, install the release-aligned package:</p><pre><code>bun add @wrnexus/csr@0.2.24</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide" class="prose"><blockquote>The browser-side client runtime for WRNexusJS — generic, self-contained JS that hydrates server-rendered pages with reactivity, client-side navigation, and realtime rooms.</blockquote>
<aside class="sidebar"><a href="/packages">← All packages</a><span class="category">Frontend</span><h2>@wrnexus/csr</h2><p>Reactive, navigation, and realtime browser runtimes.</p><span class="status status-beta">Private preview · 0.2.25</span><nav><a href="#access">Access</a><a href="#guide">Guide</a><a href="#api">Complete API</a></nav></aside>
<article id="main" class="documentation"><section class="doc-intro"><span class="eyebrow">Frontend · Preview</span><h1>@wrnexus/csr</h1><p>Reactive, navigation, and realtime browser runtimes.</p><section id="access" class="access-callout"><h2>Private registry access required</h2><p>This package is not available from the public npm registry. After WorkRoot approves access and supplies private registry instructions, install the release-aligned package:</p><pre><code>bun add @wrnexus/csr@0.2.25</code><button type="button" class="copy-button" aria-label="Copy installation command">Copy</button></pre><p><a href="/access">Request preview access</a>. Never put registry tokens in source control.</p></section></section><section id="guide" class="prose"><blockquote>The browser-side client runtime for WRNexusJS — generic, self-contained JS that hydrates server-rendered pages with reactivity, client-side navigation, and realtime rooms.</blockquote>
<p>Part of the <strong>WRNexusJS</strong> framework — an SSR-first, Bun-native full-stack web framework.</p>
<h3 id="overview">Overview</h3>
<p><code>@wrnexus/csr</code> holds the three client runtimes that WRNexusJS serves to the browser. Components are authored as <code>.wrn</code> files and rendered on the <strong>server</strong>; this package provides the single, generic runtime that <strong>hydrates</strong> that HTML in the browser — there are no per-component browser bundles. Each runtime is exported as a plain-JS string (no build step, no imports) intended to be served verbatim from a well-known URL:</p>
@@ -95,12 +95,20 @@ Bun.serve(&#123;
&#125;,
&#125;);</code></pre>
<p>Browser side — server-rendered HTML that the reactive runtime hydrates:</p>
<pre data-language="html"><code>&lt;div data-scope=&quot;count: 0&quot;&gt;
<pre data-language="html"><code>&lt;div data-scope=&quot;count: 0, showPassword: false&quot;&gt;
&lt;button data-on-click=&quot;count++&quot;&gt;+1&lt;/button&gt;
&lt;span data-text=&quot;count&quot;&gt;&lt;/span&gt;
&lt;p&gt;Total: &#123;&#123;count&#125;&#125;&lt;/p&gt;
&lt;input type=&quot;&#123;showPassword ? 'text' : 'password'&#125;&quot; /&gt;
&lt;button
data-on-click=&quot;showPassword = !showPassword&quot;
aria-label=&quot;&#123;showPassword ? 'Hide password' : 'Show password'&#125;&quot;
&gt;
Toggle password
&lt;/button&gt;
&lt;/div&gt;
&lt;script src=&quot;/__wrnexus/reactive.js&quot;&gt;&lt;/script&gt;</code></pre>
<p>State interpolation in ordinary attributes is reactive. The compiler keeps the initial SSR value and emits an internal binding so attributes such as <code>type</code>, <code>aria-label</code>, <code>aria-pressed</code>, <code>class</code>, and <code>href</code> update after state changes.</p>
<p>A realtime chat, fully declarative:</p>
<pre data-language="html"><code>&lt;div data-room=&quot;lobby&quot; data-room-user=&quot;ada&quot;&gt;
&lt;div data-room-status&gt;&lt;/div&gt;
@@ -215,10 +223,17 @@ Bun.serve(&#123;
&#125;
return new Response(&quot;Not found&quot;, &#123; status: 404 &#125;);
&#125;,
&#125;);</code></pre></article><article class="example-card"><h3>Browser side — server-rendered HTML that the reactive runtime hydrates</h3><pre data-language="html"><code>&lt;div data-scope=&quot;count: 0&quot;&gt;
&#125;);</code></pre></article><article class="example-card"><h3>Browser side — server-rendered HTML that the reactive runtime hydrates</h3><pre data-language="html"><code>&lt;div data-scope=&quot;count: 0, showPassword: false&quot;&gt;
&lt;button data-on-click=&quot;count++&quot;&gt;+1&lt;/button&gt;
&lt;span data-text=&quot;count&quot;&gt;&lt;/span&gt;
&lt;p&gt;Total: &#123;&#123;count&#125;&#125;&lt;/p&gt;
&lt;input type=&quot;&#123;showPassword ? 'text' : 'password'&#125;&quot; /&gt;
&lt;button
data-on-click=&quot;showPassword = !showPassword&quot;
aria-label=&quot;&#123;showPassword ? 'Hide password' : 'Show password'&#125;&quot;
&gt;
Toggle password
&lt;/button&gt;
&lt;/div&gt;
&lt;script src=&quot;/__wrnexus/reactive.js&quot;&gt;&lt;/script&gt;</code></pre></article><article class="example-card"><h3>A realtime chat, fully declarative</h3><pre data-language="html"><code>&lt;div data-room=&quot;lobby&quot; data-room-user=&quot;ada&quot;&gt;
&lt;div data-room-status&gt;&lt;/div&gt;
@@ -235,7 +250,7 @@ room.on(&quot;chat&quot;, (msg) =&gt; console.log(msg.user, msg.text));
room.send(&#123; type: &quot;chat&quot;, user: &quot;ada&quot;, text: &quot;hi&quot; &#125;);</code></pre></article></div></section></article>
<aside class="on-this-page"><h2>On this page</h2><nav><a class="toc-level-2" href="#guide">Guide</a><a class="toc-level-3" href="#overview">Overview</a><a class="toc-level-3" href="#api">API</a><a class="toc-level-4" href="#runtime-strings">Runtime strings</a><a class="toc-level-4" href="#accessor-functions">Accessor functions</a><a class="toc-level-4" href="#browser-reactive-directives">Browser: reactive directives</a><a class="toc-level-4" href="#browser-navigation">Browser: navigation</a><a class="toc-level-4" href="#browser-realtime-rooms">Browser: realtime rooms</a><a class="toc-level-3" href="#usage">Usage</a><a class="toc-level-3" href="#requirements-notes">Requirements / Notes</a><a class="toc-level-2" href="#api">Complete API</a><a class="toc-level-2" href="#examples">Examples</a></nav></aside>
</main>
<footer>WRNexusJS 0.2.24 · Private Developer Preview · Bun-native · Documentation generated from installed package APIs.</footer>
<footer>WRNexusJS 0.2.25 · Private Developer Preview · Bun-native · Documentation generated from installed package APIs.</footer>
</div>
}
}