diff --git a/.changeset/binding-slot-text-positions.md b/.changeset/binding-slot-text-positions.md new file mode 100644 index 000000000..660b7c317 --- /dev/null +++ b/.changeset/binding-slot-text-positions.md @@ -0,0 +1,7 @@ +--- +"@solidjs/web": patch +--- + +Binding slots: a slot property placed as a child (`{list.remaining} items left`) is a text position. The server emits a comment pair around it, `…`, with the escaped t=0 value inside on the document face and nothing on the stream face; the client writes the text between the markers from the occurrence's render effect, and a refetch's morph keeps the client's text. Strings and numbers render; nullish and booleans render empty, as a client insert renders them. Any other value is a new client dev finding (`BINDING_SLOT_POSITION`, reason `text-shape`) and clears. The content of `` | raw-text content: the markers land in the text | `value={row.draft}` | | `format(row.title)` (a server helper) | the helper receives a stand-in | do the formatting in the fill | | `
  • ` | spread: the template must show what the client owns | name each position | | `onClick={() => …}` on a server element | a server function can never run in the browser | bind a slot property or a form `action` | | `onKeyDown={[row.key, 1]}` | a tuple: a marker names keys, never data | return `onKeyDown: [handler, data]` from the fill; bind `onKeyDown={row.onKeyDown}` | -Every case except truthiness is a dev finding (`BINDING_SLOT_POSITION`) -and renders **nothing on either face**, so it shows on the first render. -Truthiness has no runtime hook: if a retry button appears on every row, this -is why. +Every case except truthiness and raw-text content is a dev finding +(`BINDING_SLOT_POSITION`) and renders **nothing on either face**, so it +shows on the first render. Truthiness has no runtime hook: if a retry button +appears on every row, this is why. Raw-text content has none either; in +`