Vize

Architecture Overview

This page explains how Vize's packages reach the Rust compiler and developer tools. Use it to identify the part that owns a behavior before debugging an integration or contributing a fix. For installing Vize in an app, start with Getting Started.

Follow the relationship map from your entry point—for example, @vizejs/vite-plugin—to the crate responsible for the output. Then use the Source Guide to find files and the Crate Reference to identify APIs.

The diagrams describe the existing product pipeline under crates/. The experimental level pipeline lives separately under davinci/; its roadmap and migration gates are recorded in the level restructure decision. Internal architecture continues to change.

Project Relationship Map

JavaScript integrations call the native bindings; compiler and developer-tool crates reuse shared parsing and analysis infrastructure. Follow the arrows from the package you are working with.

Vue apps
real projects

@vizejs/vite-plugin

@vizejs/nuxt

vize CLI

Editors

vize_maestro
LSP

Playground & docs

@vizejs/wasm

Musea gallery

@vizejs/vite-plugin-musea

Oxlint

oxlint-plugin-vize

vize_vitrine
NAPI bridge

Rust workspace

vize_armature
parser

vize_relief
AST

vize_croquis
semantic sketch

Atelier compilers

vize_atelier_dom

vize_atelier_vapor

vize_atelier_ssr

vize_atelier_sfc

vize_canon
type checking

vize_patina
linting

vize_glyph
formatting

vize_musea
gallery core

OXC

corsa-bind

Lightning CSS

This relationship map is about ownership and reuse, not every call edge. The important invariant is that parser, AST, and semantic analysis stay shared, while the compiler backends and developer tools remain replaceable workshops around that shared language model.

Lanes

Source .vue

Armature
Parser

Relief
AST

Croquis
Semantic Analysis

Atelier

VDOM Compiler

Vapor Compiler

SSR Compiler

Output JS

Stage Details

  1. Source — A .vue file containing <template>, <script>, and <style> blocks
  2. Armature (Parser) — Tokenizes the raw source into a stream of tokens, then parses them into a structured AST. The tokenizer handles Vue-specific syntax: directives (v-if, v-for, v-bind), expression interpolation ({{ }}), and SFC block boundaries.
  3. Relief (AST) — The intermediate representation. All downstream stages operate on this shared AST, eliminating redundant parsing.
  4. Croquis (Semantic Analysis) — Resolves template expressions, tracks variable scopes, detects binding types (setup, data, props, inject), and validates expression correctness. Uses OXC for JavaScript/TypeScript AST parsing.
  5. Atelier (Compilation) — Transforms the analyzed AST into JavaScript output. Three backends serve different targets:
    • VDOM (vize_atelier_dom) — createVNode/h calls with patch flag optimization and static hoisting
    • Vapor (vize_atelier_vapor) — Fine-grained reactive code with direct DOM manipulation (no VDOM)
    • SSR (vize_atelier_ssr) — String concatenation with hydration markers
  6. Output — Generated JavaScript code with source maps

Tool Lanes

Beyond compilation, Vize provides additional tools that reuse the same parsing and analysis infrastructure:

Source .vue

Armature
Parser

Relief
AST

Croquis
Analysis

Atelier
Compiler

Patina
Linter

Glyph
Formatter

Canon
Type Checker

Musea
Art & Docs Core

Maestro
LSP

Sharing parsing and AST infrastructure reduces duplicated language handling. Compatibility still needs fixture and integration tests for each compiler and tool surface.

For type checking, vize_canon adds one more step: it generates virtual TypeScript from Vue SFCs and asks Corsa project sessions from corsa-bind for native diagnostics, then maps those results back onto the original files.

The implementation workflow is documented in Language Engineering Practices, which maps parser, compiler, analyzer, type-checker, formatter, LSP, and release changes to the fixture, snapshot, parity, benchmark, and readiness evidence expected for review.

Crate Responsibilities

Layer Crate Role
Foundation vize_carton Shared utilities, arena allocator, string interning
AST vize_relief AST node definitions, error types, compiler options
Parsing vize_armature Tokenizer + recursive descent parser
Analysis vize_croquis Semantic analysis, scope tracking, binding detection
Compilation vize_atelier_core Shared transform lane, codegen utilities, source maps
Compilation vize_atelier_dom VDOM code generation
Compilation vize_atelier_vapor Vapor mode code generation
Compilation vize_atelier_sfc SFC orchestration (script + template + style + HMR)
Compilation vize_atelier_ssr Server-side rendering compilation
Bindings vize_vitrine Node.js (NAPI) + WASM bindings
CLI vize Command-line interface (clap + rayon)
Type Checking vize_canon Native TypeScript and Vue diagnostics via corsa-bind
Linting vize_patina Vue.js linter with i18n (en/ja/zh)
Formatting vize_glyph Vue.js formatter (template + script + style)
LSP vize_maestro Language Server Protocol (tower-lsp)
Musea vize_musea Art parsing, docs, palette, autogen, and VRT core
TUI vize_fresco Terminal UI framework (crossterm + taffy)

The gallery UI and dev-server integration for Musea live in the JavaScript package @vizejs/vite-plugin-musea; the Rust crate focuses on the parsing and generation core.

Naming Convention

The existing product crates are named after art and sculpture terminology, reflecting how each component shapes and transforms Vue code. This naming system is more than aesthetic — it encodes the role and relationships between crates. See Philosophy for the full rationale.

Name Origin Art Analogy Technical Role
Carton /kɑːˈtɒn/ Artist's portfolio case — stores and organizes tools Shared utilities — the foundational toolbox that every crate depends on
Relief /rɪˈliːf/ Sculptural technique that projects from a flat surface The AST — a structured surface that gives shape to raw source code
Armature /ˈɑːrmətʃər/ Internal skeleton supporting a sculpture The parser — the structural framework that supports the AST
Croquis /kʁɔ.ki/ Quick gestural sketch capturing the essence of a subject Semantic analysis — a quick sketch that captures the meaning of code
Atelier /ˌætəlˈjeɪ/ Artist's workshop where creation happens Compiler workspaces — where code is transformed into its final form
Vitrine /vɪˈtriːn/ Glass display case in a museum Bindings — a transparent layer that exposes the compiler to external consumers
Canon /ˈkænən/ Standard of ideal proportions in classical sculpture Type checker — ensures code conforms to the standard of correctness
Patina /ˈpætɪnə/ Aged surface finish that indicates quality and care Linter — polishes code by identifying problems that affect quality
Glyph /ɡlɪf/ Carved symbol or letterform with precise proportions Formatter — shapes code into consistent, readable letterforms
Maestro /ˈmaɪstroʊ/ Master conductor who orchestrates an ensemble LSP — orchestrates all language features into a unified editor experience
Musea /mjuːˈziːə/ Plural of museum — a space for exhibiting art Component gallery — a space for exhibiting and exploring components
Fresco /ˈfrɛskoʊ/ Painting technique applied to wet plaster walls TUI framework — painting interfaces onto the terminal surface

Why Art Terminology?

The analogy between software compilation and artistic creation is surprisingly deep:

  • A parser (Armature) provides the internal skeleton — the structure that everything else builds upon, just as a sculptor's armature supports the clay
  • Semantic analysis (Croquis) is like a quick sketch — it captures the essential meaning without committing to a final form
  • The compiler (Atelier) is a workshop where raw material is transformed into a finished work
  • The AST (Relief) is a projection — it gives three-dimensional structure to what was originally flat text
  • Bindings (Vitrine) are a glass display case — they let you see and interact with the work inside without directly touching it
  • The linter (Patina) examines the surface finish — finding imperfections that affect the overall quality
  • The formatter (Glyph) ensures consistent proportions — like a typographer carving letterforms with precise spacing

This naming convention makes the crate hierarchy intuitive: when you see vize_atelier_dom, you immediately understand it is a workshop that produces VDOM output.

External Dependencies

Vize integrates with the broader Rust ecosystem for specialized tasks:

Dependency Purpose Used By
OXC JavaScript/TypeScript AST parsing vize_croquis, vize_atelier_core
Rayon Data-parallel multi-threading vize, vize_vitrine
bumpalo Arena allocation for AST nodes vize_carton
LightningCSS CSS parsing and transformation vize_atelier_sfc
corsa-bind Native TypeScript project sessions and diagnostics vize_canon, vize_maestro, vize_patina
tower-lsp LSP server framework vize_maestro
clap CLI argument parsing vize
wasm-bindgen WASM-JavaScript interop vize_vitrine
napi-rs Node.js native addon bindings vize_vitrine