You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v-for aliases accept the $, _ and citry prefixes that v-slot reserves #560
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)
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
fix(parser): reject v-for and v-slot names with Citry's reserved pref…
fix(parser): reject v-for and v-slot names with Citry's reserved pref…