Skip to content

Make vize's fallback lane follow Vue's v-pre rules #519

Open

Description

@JuroOravec

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_armature under third_party/rust/ (Cargo [patch], README.citry.md, the distribution verifier, the shared +citry.N version), and decide the tag type after v-pre is known, as compiler-core's onCloseTag does.
  • Keep a v-pre marker on ElementNode so Citry's own metadata walk does not need to read it from the source text (opening_tag_has_v_pre).
  • Make every v-pre detector agree: Vue reads v-pre with an argument or modifiers as v-pre; Citry now rejects those spellings at load, and the Python checks read the name case-insensitively.
  • Inside v-pre, Vue also drops is="vue:..." from any element; S2 keeps it. Vue 3.5.42 also writes v-slot:a there as "v-slota" (a Vue bug), while S2 keeps v-slot:a.
  • When Citry compiles a v-pre element 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_LANE refusal and test both lanes, as crates/citry_vue_compiler/tests/directive_value_entities.rs does.

Activity

  1. added
    next-sprint
    on Oct 28, 2026
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

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions