Repository navigation
Description
(Opus 5.5)
Problem
Citry's native Vue compiler currently depends on locally patched copies of vize_atelier_core and vize_s1_to_s2 0.420.0 under third_party/rust/. The copies come from the crates.io archives and retain Vize's MIT license; Citry's patch manifests identify them as 0.420.0+citry.1.
The local patches correct code generation that Citry relies on:
- quote and escape custom-directive and
v-modelmodifier keys; - preserve runtime directive wrappers when a single element is transformed out of
<template v-for>; - preserve an element's own key instead of losing it when loop or conditional template fragments are transformed;
- preserve keyed component and slot children inside conditional fragments.
The exact source and test deltas are inventoried in
vize_atelier_core/README.citry.md
and
vize_s1_to_s2/README.citry.md.
The remainder of each directory is the corresponding upstream archive.
These crates are source dependencies. Citry does not publish or deploy them separately: Cargo compiles them into citry_core through citry_vue_compiler.
Goal
Contribute the generally applicable fixes upstream and return Citry to released Vize crates without local source forks.
Upstream work
- Rebase each Citry regression against current Vize
mainand the newest compatible release; identify fixes already present upstream. - Split the remaining behavior into focused Vize issues or pull requests with minimal reproductions.
- Submit the modifier-key escaping fixes and regression coverage.
- Submit the
template v-forruntime-directive and keyed-child fixes and regression coverage. - Submit the keyed
template v-ifelement/component/slot fixes and regression coverage. - Track the upstream release containing every required fix.
Removal work
- Update
citry_vue_compilerto the released upstream crates. - Remove the root
[patch.crates-io]overrides and local path dependencies. - Delete
third_party/rust/vize_atelier_coreandthird_party/rust/vize_s1_to_s2. - Remove the copied Vize wheel-license artifact if the released dependency metadata makes it unnecessary, or regenerate it from the final dependency license inventory.
- Retain Citry-facing regression coverage for the compiler behavior on which prepared Vue rendering depends.
- Run the native compiler, Python binding, Vue rendering and packaging/license gates.
Acceptance criteria
- Citry builds against an immutable released Vize version with no local Vize source override.
- All currently documented Citry patch cases pass against that release.
- The vendored directories are removed.
- Provenance and wheel-license output identify the released dependency and
contain no stale+citry.1source-fork identity.
Added by #159
#159 updated the local copies (now labelled 0.420.0+citry.2) with three more fixes to send upstream:
- Read an event handler as a list of statements only when it contains
;, as@vue/compiler-coredoes, and report any other statement (:title="a; b",{{ a; b }},v-if="a; b",@click="if (ok) run()") as an invalid expression. Before this, any text that failed to parse as one expression was retried as statements, which produced JavaScript that does not parse, with no error. - Write line comments in an event handler as block comments, so a trailing
// notecannot hide the closing}of$event => {...}or the,before the next prop. - With TypeScript on, keep
@click="foo!"and@click="handler as any"as handler references (decide after removing the type syntax), so Vue calls them instead of returning them.
Regression tests for these are in vize_atelier_core/tests/event_handler_statements.rs and vize_s1_to_s2/tests/citry_event_handler_statements.rs.
Known Vize bugs Citry does not hit
Citry compiles without TypeScript and with prefixed identifiers, so these don't affect it, but they are worth reporting upstream:
-
(x as any).run(); yanda!; b()are wrapped twice and lose their_ctx.prefixes. -
foo! // notewith no newline after the comment produces broken output. - Without prefixed identifiers,
() => run() // noteis wrapped as$event => (...), so it never callsrun.
Stale upstream tests in the local copies
- Six upstream tests in the local copies fail: five expect output from before Vendor patched Vize compiler crates #140's patches, and one needs fixture files that exist only in the upstream repository. CI never runs these crates' own tests, which is why nobody noticed. Update or drop them when the copies are next refreshed, or retire them together with the copies.
Event modifier parity
-
(Fixed in Citry's patched copy,
0.420.0+citry.3, Vue migration 4/4: replace the Alpine runtime with Vue #137; still to send upstream)v-on: Vize wraps a static non-keyboard event inwithKeysfor any modifier it doesn't recognise (@click.foo,@click.enter), so the listener never fires; Vue addswithKeysonly forkeyup/keydown/keypressor dynamic event names (compiler-domvOn,isKeyboardEvent). The patch flag differs too (40 vs 8). Citry first needs its@c-*.enter/.escapekey matching to stop relying on this behaviour. -
v-on: Vize drops.native(Vue reads it as a key name), and@click.nativestill getsNEED_HYDRATIONwhere Vue gives flag 8.
Activity
chore(third_party): bring later Vize expression and comment patches
chore(third_party): label the patched Vize crates 0.420.0+citry.2
chore(third_party): match the patched Vize crates to #159
fix(third_party): match Vue's key-modifier handling in the patched Vi…