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
Support Vue's built-in components (<Transition>, <TransitionGroup>, <KeepAlive>, <Teleport>, <Suspense>) #167
Vue's built-in components <Transition>, <TransitionGroup>, <KeepAlive>, <Teleport> and <Suspense> can't be used in Citry templates. Citry rejects them when the template loads.
Why they're unsupported today
The browser bundle already contains all five (Citry ships the full Vue runtime). They're blocked because:
Citry's compiler output check only allows a fixed list of runtime helpers, and these compile to helpers outside it.
The server renderer, which writes the HTML Vue later takes over, can't render them.
Several of them change where or when DOM exists, which Citry's server-driven updates rely on.
Feasibility, per component (estimates, not yet prototyped)
Transition / TransitionGroup — most feasible. They only animate in the browser, and the server can render the child (or the TransitionGroup wrapper tag). Risk: a server update removing nodes in the middle of an animation. Medium effort.
Teleport — content leaves the component's root element, which affects how Citry finds a component's elements, attaches listeners and places updates, and needs server HTML and hydration support for the target. Hard.
KeepAlive — cached instances are deactivated rather than unmounted, which conflicts with server-driven remounts. Hard, low value. Not planned unless requested.
Suspense — needs async component setup, which Citry's model doesn't have. Very hard. Not planned unless requested.
Parked for now (low priority). This is the design note worked out so far, kept here so the work can resume from it.
What blocks all five today
Compiler output check._vue/compiler.py accepts only a fixed list of Vue runtime helpers (about
lines 400-435). The five built-ins compile to helpers outside it (Transition, TransitionGroup, KeepAlive, Teleport, Suspense), so the template fails when it loads. This is the error users see.
Server renderer.crates/citry_vue_compiler/src/server_render.rs recognises none of the five. If
the helper check let them through, the renderer would mark them unsupported, and the page would
fall back to rendering in the browser.
The helper contract (HELPER_CONTRACT_DESCRIPTOR, "ordinary-vnodes/1") treats block helpers as
plain vnodes. Adding a helper changes the contract hash. That is fine, and it is how a new helper
should be introduced, so stale cached definitions are refused.
Decision summary
Component
Plan
Phase
<Transition>
Support
1
<TransitionGroup>
Support
1
<Teleport>
Support later, for full-page renders only
2
<KeepAlive>
Keep rejected, with a clearer error
Not planned
<Suspense>
Keep rejected, with a clearer error
Not planned
1. <Transition> (phase 1)
Server HTML: only the child. Vue's own server renderer writes no wrapper element for a Transition, and its props (name, mode, appear, the class names) produce no markup.
Hydration: Vue hydrates the child as usual. With appear, the browser runs the enter animation
on the first mount; the server HTML already shows the final state, so nothing jumps.
Citry server renderer: treat Transition as transparent. Render its default slot and drop its
props. This is close to how the renderer already handles a component's default slot.
Server-driven updates: an Events render that replaces the subtree while an animation runs
unmounts the transitioning element. Vue cancels the pending callbacks on unmount, so this is safe.
The leave animation of the replaced node simply does not finish. The docs should say so.
Pages without Vue:<Transition> cannot render there, so it fails the same way as other Vue
syntax on a page without Vue.
Error modes:
More than one root child inside <Transition>: Vue only warns about this. Citry should fail when
the template loads, naming the rule, "one element or component, or one v-if chain".
mode with a value other than out-in or in-out: fail at load.
Inside a Citry component tag (<c-Panel>), <Transition> works only as content of a fill, like
any other Vue element.
2. <TransitionGroup> (phase 1)
Server HTML: the element named by tag with the children inside, or the children alone when
there is no tag. Transition props produce no markup. The tag element's other attributes pass
through.
Hydration: Vue hydrates the wrapper and the children. A reorder caused by Vue state animates
with Vue's move transition.
Citry server renderer: render the tag element, or a fragment, and then the children. Drop moveClass and the transition props.
Server-driven updates: an Events render of the list replaces it, so there is no move
animation between server renders. Document that animated reordering comes from browser state, not
from server renders.
Error modes:
A direct child without a key: Vue requires one. Citry should fail at load, with the same
message style as the existing #c-key check for repeated components.
A c-for (server-repeated) child: this works, because each item gets a key. The docs should show :key on the Vue side and #c-key on the Citry side.
3. <Teleport> (phase 2)
Server HTML: Vue writes <!--teleport start--><!--teleport end--> anchors where the <Teleport> stands, and collects the content separately. The page must place that content into the
target element, such as body or #modals.
Hydration: Vue looks for the content inside the target, between its own anchors. If the server
did not place it there, hydration reports a mismatch and the content renders in the browser instead.
Why it is hard for Citry:
Citry finds a component's elements, attaches its listeners, and places Events updates through
its root elements. Teleported content is outside them.
An Events render returns a fragment for one component. It cannot add content to a target
elsewhere in the page.
Proposed rule:
Support <Teleport> only where Citry renders the whole document, so the server can place the
content into the target in the same response.
In a fragment or an Events render, a <Teleport> whose target lies outside the fragment fails
with a clear error.
disabled teleports render in place and are always allowed.
defer teleports render in the browser only, and the docs warn about the flash.
Error modes:
The target is not found in the rendered document: fail when the page serialises, naming the
selector.
A teleport inside a fragment whose target lies outside it: fail, as above.
An event binding (@c-*) inside teleported content: phase 2 must prove that Citry still routes
it to the owning component. If that cannot be guaranteed, reject it in teleported content.
4. <KeepAlive> (not planned)
Server HTML: only the active child.
Conflict: KeepAlive deactivates cached instances instead of unmounting them. Citry's
server-driven updates replace instances and their State tokens, so a reactivated cached instance
would hold stale State and a stale token.
Decision: keep it rejected. Replace the generic helper error with "KeepAlive is not supported
in Citry; use v-show to keep a component's state while it is hidden".
5. <Suspense> (not planned)
Server HTML: Vue resolves async setups before writing the default branch.
Conflict: Citry components have no async setup. Their data comes from the server render.
Decision: keep it rejected, with a specific error saying that Citry components render with
their data already resolved, so Suspense has nothing to wait for.
What changes in the spec and docs
vue/limits.md: move Transition and TransitionGroup from "unsupported" to a supported section with
the rules above. Keep KeepAlive and Suspense listed with the reasons. Mark Teleport "planned, full
pages only".
The helper allowlist and the contract descriptor gain Transition and TransitionGroup, which
produces a new contract hash.
Parity corpus: pages for Transition with a v-if child, Transition with appear, and TransitionGroup
with and without tag. This keeps the server HTML equal to the first browser render.
What would show this design is wrong
Vue's compiled output for <Transition> uses a helper that needs the block-tracking optimisations
Citry turns off (openBlock=noop in the contract), and the transition misbehaves under
"ordinary-vnodes" rendering. This is the first thing to check, with one compiled sample.
Server-driven updates of transitioning content turn out to be common, for example a toast list
rendered by the server, so the missing leave animation makes the feature feel broken. A
browser-side list driven by js_data would then be the recommended pattern, and the docs must say
so up front.
Risk (a) checked: compiled output for Transition and TransitionGroup
I compiled one sample of each with Citry's own Vue compiler (citry_core._rust.vue._compile_vue, the
ordinary target) and read the output:
<TransitionGroup tag="ul" name="list"><li v-for ... :key="i"> compiles to _createBlock(_TransitionGroup, { tag, name }, { default: _withCtx(() => [ _renderList(...) ]) }),
with a keyed fragment inside.
Every helper used is already on Citry's allowlist: openBlock, createBlock, createElementBlock, createCommentVNode, withCtx, renderList and Fragment. The only new names are the two
component objects, Transition and TransitionGroup. The compiler's own audit reports exactly
that: UNSUPPORTED_HELPER: unsupported Vue helper Transition (and TransitionGroup).
Nothing uses _cache, setBlockTracking or withMemo, which _FORBIDDEN_CODE rejects, and the
output carries only the usual patch-flag hints that the contract already ignores
(createBlock=createVNode-ignore-hints).
Answer: the output needs no block-tracking feature that the ordinary-vnodes contract turns off.
Vue's transition hooks attach to individual vnodes and its keyed children, not to the block tree, so
full-diff patching is compatible. The change is: allow the two component objects, declare them in the
contract descriptor (for example Transition=pass;TransitionGroup=pass), and teach the server renderer
to render them transparently. Not yet verified: a real enter and leave run in a browser under
Citry's runtime. That belongs in the phase-1 e2e test.
Activity
[-]Support Vue's built-in components (Transition first)[/-][+]Support Vue's built-in components (<Transition>, <TransitionGroup>, <KeepAlive>, <Teleport>, <Suspense>)[/+]JuroOravec commentedon Oct 25, 2026
Parked for now (low priority). This is the design note worked out so far, kept here so the work can resume from it.
What blocks all five today
_vue/compiler.pyaccepts only a fixed list of Vue runtime helpers (aboutlines 400-435). The five built-ins compile to helpers outside it (
Transition,TransitionGroup,KeepAlive,Teleport,Suspense), so the template fails when it loads. This is the error users see.crates/citry_vue_compiler/src/server_render.rsrecognises none of the five. Ifthe helper check let them through, the renderer would mark them unsupported, and the page would
fall back to rendering in the browser.
HELPER_CONTRACT_DESCRIPTOR, "ordinary-vnodes/1") treats block helpers asplain vnodes. Adding a helper changes the contract hash. That is fine, and it is how a new helper
should be introduced, so stale cached definitions are refused.
Decision summary
<Transition><TransitionGroup><Teleport><KeepAlive><Suspense>1.
<Transition>(phase 1)Transition, and its props (name,mode,appear, the class names) produce no markup.appear, the browser runs the enter animationon the first mount; the server HTML already shows the final state, so nothing jumps.
Transitionas transparent. Render its default slot and drop itsprops. This is close to how the renderer already handles a component's default slot.
renderthat replaces the subtree while an animation runsunmounts the transitioning element. Vue cancels the pending callbacks on unmount, so this is safe.
The leave animation of the replaced node simply does not finish. The docs should say so.
<Transition>cannot render there, so it fails the same way as other Vuesyntax on a page without Vue.
<Transition>: Vue only warns about this. Citry should fail whenthe template loads, naming the rule, "one element or component, or one
v-ifchain".modewith a value other thanout-inorin-out: fail at load.<c-Panel>),<Transition>works only as content of a fill, likeany other Vue element.
2.
<TransitionGroup>(phase 1)tagwith the children inside, or the children alone whenthere is no
tag. Transition props produce no markup. Thetagelement's other attributes passthrough.
with Vue's move transition.
tagelement, or a fragment, and then the children. DropmoveClassand the transition props.renderof the list replaces it, so there is no moveanimation between server renders. Document that animated reordering comes from browser state, not
from server renders.
key: Vue requires one. Citry should fail at load, with the samemessage style as the existing
#c-keycheck for repeated components.c-for(server-repeated) child: this works, because each item gets a key. The docs should show:keyon the Vue side and#c-keyon the Citry side.3.
<Teleport>(phase 2)<!--teleport start--><!--teleport end-->anchors where the<Teleport>stands, and collects the content separately. The page must place that content into thetarget element, such as
bodyor#modals.did not place it there, hydration reports a mismatch and the content renders in the browser instead.
its root elements. Teleported content is outside them.
renderreturns a fragment for one component. It cannot add content to a targetelsewhere in the page.
<Teleport>only where Citry renders the whole document, so the server can place thecontent into the target in the same response.
<Teleport>whose target lies outside the fragment failswith a clear error.
disabledteleports render in place and are always allowed.deferteleports render in the browser only, and the docs warn about the flash.selector.
@c-*) inside teleported content: phase 2 must prove that Citry still routesit to the owning component. If that cannot be guaranteed, reject it in teleported content.
4.
<KeepAlive>(not planned)server-driven updates replace instances and their State tokens, so a reactivated cached instance
would hold stale State and a stale token.
in Citry; use
v-showto keep a component's state while it is hidden".5.
<Suspense>(not planned)their data already resolved, so
Suspensehas nothing to wait for.What changes in the spec and docs
vue/limits.md: move Transition and TransitionGroup from "unsupported" to a supported section withthe rules above. Keep KeepAlive and Suspense listed with the reasons. Mark Teleport "planned, full
pages only".
TransitionandTransitionGroup, whichproduces a new contract hash.
v-ifchild, Transition withappear, and TransitionGroupwith and without
tag. This keeps the server HTML equal to the first browser render.What would show this design is wrong
<Transition>uses a helper that needs the block-tracking optimisationsCitry turns off (
openBlock=noopin the contract), and the transition misbehaves under"ordinary-vnodes" rendering. This is the first thing to check, with one compiled sample.
rendered by the server, so the missing leave animation makes the feature feel broken. A
browser-side list driven by
js_datawould then be the recommended pattern, and the docs must sayso up front.
Risk (a) checked: compiled output for Transition and TransitionGroup
I compiled one sample of each with Citry's own Vue compiler (
citry_core._rust.vue._compile_vue, theordinary target) and read the output:
<Transition name="fade"><p v-if="show">x</p></Transition>compiles to_createBlock(_Transition, { name: "fade" }, { default: _withCtx(() => [ v-if branch ]), _: 1 }).<TransitionGroup tag="ul" name="list"><li v-for ... :key="i">compiles to_createBlock(_TransitionGroup, { tag, name }, { default: _withCtx(() => [ _renderList(...) ]) }),with a keyed fragment inside.
openBlock,createBlock,createElementBlock,createCommentVNode,withCtx,renderListandFragment. The only new names are the twocomponent objects,
TransitionandTransitionGroup. The compiler's own audit reports exactlythat:
UNSUPPORTED_HELPER: unsupported Vue helper Transition(andTransitionGroup)._cache,setBlockTrackingorwithMemo, which_FORBIDDEN_CODErejects, and theoutput carries only the usual patch-flag hints that the contract already ignores
(
createBlock=createVNode-ignore-hints).Answer: the output needs no block-tracking feature that the ordinary-vnodes contract turns off.
Vue's transition hooks attach to individual vnodes and its keyed children, not to the block tree, so
full-diff patching is compatible. The change is: allow the two component objects, declare them in the
contract descriptor (for example
Transition=pass;TransitionGroup=pass), and teach the server rendererto render them transparently. Not yet verified: a real enter and leave run in a browser under
Citry's runtime. That belongs in the phase-1 e2e test.