Skip to content

v-for aliases accept the $, _ and citry prefixes that v-slot reserves #560

Closed

Description

@JuroOravec

Follow-up to #168.

What happens

A v-slot pattern may not bind a name that starts with $, _ or citry, because Citry adds its own names to a fill's slot function, such as $i18n and citrySlotKey. A v-for alias has no such rule, so v-for="$i18n in items" or v-for="citrySlotKey in keys" is accepted.

Inside the loop, such an alias hides the value Citry provides under that name, and the template reads the loop item instead, with no error.

What to do

Apply the same rule to v-for aliases (the item, key and index names, including names inside a destructuring pattern), with a load-time error that names the alias and suggests another name. Report it in citry check and the editor too. Search for other places where a template binds a browser-side name (for example a v-slot on a Vue component inside <c-element>) and apply the rule there if it is missing.

Pointers

  • The v-slot rule: crates/citry_template_parser/src/parser.rs (the starts_with(['$', '_']) || starts_with("citry") checks, around lines 2559 and 2693)
  • v-for handling: packages/py/citry/citry/_browser_expressions.py (_v_for_expression), crates/citry_vue_compiler/src/lib.rs
  • Docs: docs_site/content/vue/slots.md, "Slot syntax errors"

Error mode

Today a clashing alias renders and reads the wrong value silently. After the fix the template fails to load with a message naming the alias. This rejects templates that load today, so it needs a changelog line.

Activity

  1. added
    next-sprint
    on Nov 1, 2026
  2. added
    v0.9.0
    and removed
    next-sprint
    on Nov 14, 2026
  3. added 2 commits that reference this issue on Nov 14, 2026
    e0e3a26
    3dcc100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    v0.9.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions