Expand description
§vize_croquis
Croquis - The semantic analysis layer for Vize.
§Name Origin
Croquis (/kʁɔ.ki/) is a French term for a quick, sketchy drawing that captures
the essential features of a subject. Like how artists use croquis to rapidly
capture the essence of a pose or scene, vize_croquis quickly analyzes Vue
templates to extract semantic meaning from the syntactic structure.
§Purpose
This crate bridges the gap between parsing (vize_armature) and transformation (vize_atelier_core) by providing:
- Scope Analysis: Track variable scopes across templates and scripts
- Binding Resolution: Resolve identifiers to their declarations
- Reactivity Tracking: Understand ref/reactive dependencies
- Symbol Tables: Fast lookup of bindings and their metadata
§Architecture
vize_armature (Parse)
↓
vize_relief (AST)
↓
vize_croquis (Semantic Analysis) ← This crate
↓
vize_atelier_core (Transform)Re-exports§
pub use analysis::AnalysisStats;pub use analysis::BindingMetadata;pub use analysis::Croquis;pub use analysis::ImportStatementInfo;pub use analysis::InvalidExport;pub use analysis::InvalidExportKind;pub use analysis::ReExportInfo;pub use analysis::TemplateExpression;pub use analysis::TemplateExpressionKind;pub use analysis::TypeExport;pub use analysis::TypeExportKind;pub use analysis::UndefinedRef;pub use analysis::UnusedTemplateVar;pub use analysis::UnusedVarContext;pub use analysis::COMPILER_MACRO_NAMES;pub use analyzer::Analyzer;pub use analyzer::AnalyzerOptions;
Modules§
- analysis
- Analysis summary for Vue SFC semantic analysis.
- analyzer
- High-performance Vue SFC analyzer.
- builtins
- Vue built-in identifiers for semantic analysis.
- call_
graph - Function call graph for tracking Vue API calls and composables.
- cross_
file - Cross-file semantic analysis for Vue projects.
- css
- CSS analysis for Vue SFC styles.
- declaration_
ts - Declaration TypeScript generation from Croquis analysis.
- display
- Display types for VIR (Vize Intermediate Representation) output.
- hoist
- Static hoisting analysis for Vue templates.
- import_
resolver - Import resolution for TypeScript type definitions.
- macros
- Compiler macro analysis.
- naming
- Naming convention utilities for Vue components and properties.
- optimization
- Optimization tracking for Vue template compilation.
- provide
- Provide/Inject tracking for Vue components.
- reactivity
- Reactivity tracking for Vue templates.
- reactivity_
tracking - Ultra-strict Reactivity Tracking System.
- script_
parser - OXC-based script parser for high-performance AST analysis.
- setup_
context - Setup context violation tracking.
- types
- TypeScript type resolution for Vue compiler macros.
- virtual_
ts - Virtual TypeScript code generation for Vue SFC type checking.
Structs§
- Binding
Flags - Binding flags for tracking usage and mutation
- Block
Scope Data - Data specific to block scope (if, for, switch, etc.)
- Callback
Scope Data - Data specific to callback scope
- Client
Only Scope Data - Data specific to client-only scope (onMounted, onBeforeUnmount, etc.)
- Closure
Scope Data - Data specific to closure scope (function declaration, function expression, arrow function)
- Event
Handler Scope Data - Data specific to event handler scope
- External
Module Scope Data - Data specific to external module scope
- JsGlobal
Scope Data - Data specific to JavaScript global scope
- NonScript
Setup Scope Data - Data specific to non-script-setup scope (Options API, regular script)
- Scope
- A single scope in the scope chain
- Scope
Binding - A binding within a scope
- Scope
Chain - Manages the scope chain during analysis
- ScopeId
- Unique identifier for a scope
- Script
Setup Scope Data - Data specific to script setup scope
- Span
- Source span
- Symbol
- A symbol in the symbol table
- Symbol
Flags - Flags for symbol properties
- Symbol
Id - Unique identifier for a symbol
- Symbol
Table - Symbol table for the entire compilation unit
- Universal
Scope Data - Data specific to universal scope (SSR - runs on both server and client)
- VFor
Scope Data - Data specific to v-for scope
- VSlot
Scope Data - Data specific to v-slot scope
- VueGlobal
Scope Data - Data specific to Vue global scope
Enums§
- Binding
Type - Binding type from script setup.
- Block
Kind - Block kind for block scopes
- JsRuntime
- Runtime environment for JavaScript globals
- Scope
Data - Scope-specific data
- Scope
Kind - Kind of scope
Constants§
- PARAM_
INLINE_ CAP - Maximum parameters typically seen in v-for/v-slot/callbacks Stack-allocated up to this count, heap-allocated beyond
Functions§
- is_
builtin_ directive - Check if a directive is a built-in directive
- is_
builtin_ tag - Check if a tag is a built-in tag
- is_
html_ tag - Check if tag is a valid HTML tag
- is_
math_ ml_ tag - Check if tag is a valid MathML tag
- is_
native_ tag - Check if tag is a native tag (HTML, SVG, or MathML)
- is_
reserved_ prop - Check if a property name is reserved
- is_
svg_ tag - Check if tag is a valid SVG tag
- is_
void_ tag - Check if tag is a void (self-closing) tag
Type Aliases§
- Param
Names - Type alias for parameter name lists (stack-allocated for small counts)
- Parent
Scopes - Parent scope references (typically 1-2 parents)