Repository navigation
Description
Follow-up from #515.
Vize compiles a template on one of two lanes. The S2 emitter (vize_s1_to_s2, patched in-tree) writes it when it can, and the older code generator in vize_atelier_core writes it when S2 declines. #515 made the S2 lane follow Vue 3.5's v-pre rule: inside v-pre, and on the element that opens it, <slot>, <component>, <teleport>, <keep-alive>, <transition> and component names stay plain elements, and is is dropped from a plain <component>.
The fallback lane still types those tags as live Vue, because the tag type is decided in the parser, vize_armature 0.420.0 (parser/element/tags.rs:60 calls determine_element_type before has_v_pre is computed at :78, and v-pre is removed from the props at :89-92). Citry has no patched copy of that crate. For now Citry refuses a v-pre template that only the fallback lane would compile (V_PRE_NEEDS_S2_LANE in crates/citry_vue_compiler/src/lib.rs), so the fallback never compiles v-pre content silently. That refusal can also catch a template the S2 lane declines for a reason unrelated to v-pre, such as a duplicate :class, as long as the template contains v-pre; the template parser already rejects that example, so only a template built another way reaches the probe with it.
To do
- Add a patched copy of
vize_armatureunderthird_party/rust/(Cargo[patch],README.citry.md, the distribution verifier, the shared+citry.Nversion), and decide the tag type afterv-preis known, as compiler-core'sonCloseTagdoes. - Keep a
v-premarker onElementNodeso Citry's own metadata walk does not need to read it from the source text (opening_tag_has_v_pre). - Make every
v-predetector agree: Vue readsv-prewith an argument or modifiers asv-pre; Citry now rejects those spellings at load, and the Python checks read the name case-insensitively. - Inside
v-pre, Vue also dropsis="vue:..."from any element; S2 keeps it. Vue 3.5.42 also writesv-slot:athere as"v-slota"(a Vue bug), while S2 keepsv-slot:a. - When Citry compiles a
v-preelement itself because it holds Citry values, a custom element name such as<my-el v-pre>{{ x }}</my-el>still compiles as a component and renders an empty shell, where Vue writes<my-el>. Vue's rule is "not a native tag and not a registered custom element"; Citry refuses only<slot>,<component>, the built-ins, and capitalized names other than SVG's camelCase elements. - Then remove the
V_PRE_NEEDS_S2_LANErefusal and test both lanes, ascrates/citry_vue_compiler/tests/directive_value_entities.rsdoes.
Activity