Skip to content

Inside v-pre, the template parser and vize still treat Vue syntax as live Vue #515

Closed

Description

@JuroOravec

Found by the sweep in #514. Both are in Rust, so they were left out of that PR.

Vue 3.5 reads an element with v-pre, and everything inside it, as written: directives stay plain attributes, and tags stay plain elements. Citry's parser and the Vue compiler it uses (vize) don't always do that.

1. The template parser rejects Vue-only syntax inside v-pre

crates/citry_template_parser/src/parser.rs validates Vue directives and built-in tags even under v-pre, so a template that Vue would accept fails to load:

from citry_core.template_parser import parse_template

parse_template('<main><div v-pre><p v-once>a</p></div></main>')
# SyntaxError: 'v-once' on <p> (line 1, column 21): Citry does not support 'v-once' or 'v-memo' ...

parse_template('<main><div v-pre><transition><p>a</p></transition></div></main>')
# SyntaxError: '<transition>' (line 1, column 19) is Vue's built-in 'Transition' component ...

parse_template('<main><div v-pre><button @click.bogus="x">a</button></div></main>')
# SyntaxError at 1:26 (the listener-modifier check)

Inside v-pre these are plain text, so the checks should skip them, the same way #514 skips the ownership marker.

2. vize compiles some tags inside v-pre as live Vue

Inside a v-pre element, vize still compiles <slot> to _renderSlot, <component is> to _resolveDynamicComponent, and <teleport> and <keep-alive> to the built-ins. Vue 3.5 leaves all of them as plain elements. For example, a Vue component with this template:

<div v-pre><slot name="a">FALLBACK</slot></div>

renders <div><!--[-->FALLBACK<!--]--></div> on the server: the slot ran, and its fallback shows. Vue would write <slot name="a">FALLBACK</slot> as written. Citry's check on copied slot content also does not count a <slot> written inside v-pre.

Done when

  • Each case above loads, compiles and renders as Vue 3.5 does, on the server and after hydration.
  • Tests cover each case.

Activity

  1. added
    next-sprint
    and removed
    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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions