Skip to content

Commit 6ac3f7f

Browse files
serpentbladeclaude
andcommitted
docs(features): document ROZ127 slot-name == prop-name compile error
The slot/prop name-collision rule shipped this session (ROZ127) now has a narrative entry in the Slots section, alongside the auto-generated diagnostics reference table (which already picks it up from codes.ts). Frames it as the slot-side sibling of the ROZ121 $expose/event collision rule and explains the Svelte-5 $props-namespace root cause + the rename remediation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 301bd39 commit 6ac3f7f

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

docs/guide/features.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -990,6 +990,10 @@ The slot key on the producer (`item`) stays the binding point; `column` is the l
990990
Rozie's compatibility bar is "high percentage" parity, not 100%. Slots are the area with the largest documented divergence — React consumers see a render-prop-flavored API (`children?: (ctx) => ReactNode`, `renderHeader?: (ctx) => ReactNode`) rather than children-as-JSX. This is called out in [`docs/guide/why.md`](/guide/why) and is accepted as a v1 trade-off.
991991
:::
992992

993+
### A slot name can't equal a prop name (ROZ127)
994+
995+
A `<slot name="X">` whose `X` matches a declared `<props>` key is a compile error (**ROZ127**). The names live in distinct namespaces internally (`$slots` vs `$props`), but on **Svelte 5** they collapse onto one — snippets and props both arrive through a single `$props()` bag, so a same-named slot and prop would resolve to the same member and the snippet would shadow the prop value. Rather than silently diverge on one of six targets, Rozie blocks it loudly and you rename the slot — typically by appending the wrapped engine's hook name (e.g. a `nowIndicator` boolean prop alongside a `nowIndicatorContent` slot). This is the slot-side sibling of the `$expose`/event name-collision rule (`ROZ121`).
996+
993997
## `:root { }` — the global escape hatch in scoped styles
994998

995999
`<style>` is scoped by default. Anything inside a `:root { }` selector is emitted globally — useful for CSS variables, font definitions, or anything else that legitimately belongs on the document:

0 commit comments

Comments
 (0)