Skip to content

Commit d6c7a46

Browse files
mogera551claude
andcommitted
docs(state): drop the v1 @State selector from the binding syntax
The general form still read property[#modifier]: path[@State][|filter...], the for shorthand table kept a .name@state row, and the $watch rules said a key may not carry @stateName. @ in a path has been a parse error since v2 (named states became mount= volumes), so the general form now matches the state README (property[#modifier]: path[|filter[|filter(args)...]]), the shorthand row is gone, and the $watch row says what the README says: paths of the tree only - a key containing @, the v1 name selector, is rejected at declaration. The v1 migration paragraph under mount= keeps its @ examples, since it describes what to replace. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 3f6e41e commit d6c7a46

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

‎state/index.html‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ <h2>Binding: <code style="font-family:var(--mono)">data-wcs</code> <a class="anc
642642
<p>General form &mdash; multiple bindings separated by <code>;</code>:</p>
643643
<div class="code-block">
644644
<div class="code-header"><span class="filename">syntax</span><span>General form</span></div>
645-
<pre><code class="language-none">property[#modifier]: path[@state][|filter[|filter(args)...]]</code></pre>
645+
<pre><code class="language-none">property[#modifier]: path[|filter[|filter(args)...]]</code></pre>
646646
</div>
647647
<div class="code-block">
648648
<div class="code-header"><span class="filename">index.html</span><span>Multiple bindings</span></div>
@@ -733,7 +733,6 @@ <h3>Loop: <code>for</code></h3>
733733
<tr><td><code>.name</code></td><td><code>users.*.name</code></td></tr>
734734
<tr><td><code>.</code></td><td><code>users.*</code> (current element)</td></tr>
735735
<tr><td><code>.name|upper</code></td><td><code>users.*.name|upper</code> (filters preserved)</td></tr>
736-
<tr><td><code>.name@state</code></td><td><code>users.*.name@state</code> (state name preserved)</td></tr>
737736
</table>
738737
</div>
739738
<div class="code-block">
@@ -1063,7 +1062,7 @@ <h2>Watch: <code style="font-family:var(--mono)">$watch</code> <a class="anchor"
10631062
<div class="table-wrap">
10641063
<table>
10651064
<tr><th>Rule</th><th>Consequence</th></tr>
1066-
<tr><td>Own state only</td><td>A key may not carry <code>@stateName</code> &mdash; rejected at declaration</td></tr>
1065+
<tr><td>Paths of the tree only</td><td>A key may not contain <code>@</code> (the v1 name selector) &mdash; rejected at declaration</td></tr>
10671066
<tr><td>No <code>$</code>-prefixed keys</td><td><code>$streamStatus.x</code> cannot be watched directly &mdash; mirror it through a one-line non-<code>$</code> getter and watch that (the eager rule makes it work unrendered)</td></tr>
10681067
<tr><td>Batches coalesce</td><td><code>a &rarr; b &rarr; c</code> in one batch fires once with <code>cur = c</code>, <code>prev = a</code></td></tr>
10691068
<tr><td>Row watches want <code>$listKeys</code></td><td>Without it a whole-array assignment fires every row with <code>prev === undefined</code>; <strong>headless</strong> row watching (no rendered <code>for</code>) fires <em>zero</em> times without it</td></tr>

0 commit comments

Comments
 (0)