Skip to main content

Crate vize_croquis

Crate vize_croquis 

Source
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§

BindingFlags
Binding flags for tracking usage and mutation
BlockScopeData
Data specific to block scope (if, for, switch, etc.)
CallbackScopeData
Data specific to callback scope
ClientOnlyScopeData
Data specific to client-only scope (onMounted, onBeforeUnmount, etc.)
ClosureScopeData
Data specific to closure scope (function declaration, function expression, arrow function)
EventHandlerScopeData
Data specific to event handler scope
ExternalModuleScopeData
Data specific to external module scope
JsGlobalScopeData
Data specific to JavaScript global scope
NonScriptSetupScopeData
Data specific to non-script-setup scope (Options API, regular script)
Scope
A single scope in the scope chain
ScopeBinding
A binding within a scope
ScopeChain
Manages the scope chain during analysis
ScopeId
Unique identifier for a scope
ScriptSetupScopeData
Data specific to script setup scope
Span
Source span
Symbol
A symbol in the symbol table
SymbolFlags
Flags for symbol properties
SymbolId
Unique identifier for a symbol
SymbolTable
Symbol table for the entire compilation unit
UniversalScopeData
Data specific to universal scope (SSR - runs on both server and client)
VForScopeData
Data specific to v-for scope
VSlotScopeData
Data specific to v-slot scope
VueGlobalScopeData
Data specific to Vue global scope

Enums§

BindingType
Binding type from script setup.
BlockKind
Block kind for block scopes
JsRuntime
Runtime environment for JavaScript globals
ScopeData
Scope-specific data
ScopeKind
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§

ParamNames
Type alias for parameter name lists (stack-allocated for small counts)
ParentScopes
Parent scope references (typically 1-2 parents)