graph LR
src_compiler_index_baseCompile["src.compiler.index.baseCompile"]
src_compiler_parser_index_parse["src.compiler.parser.index.parse"]
src_compiler_optimizer_optimize["src.compiler.optimizer.optimize"]
src_compiler_codegen_index_generate["src.compiler.codegen.index.generate"]
src_compiler_create_compiler_createCompiler["src.compiler.create-compiler.createCompiler"]
src_compiler_to_function_compileToFunctions["src.compiler.to-function.compileToFunctions"]
src_compiler_parser_html_parser_parseHTML["src.compiler.parser.html-parser.parseHTML"]
src_compiler_directives_model_model["src.compiler.directives.model.model"]
src_compiler_index_baseCompile -- "calls" --> src_compiler_parser_index_parse
src_compiler_index_baseCompile -- "calls" --> src_compiler_optimizer_optimize
src_compiler_index_baseCompile -- "calls" --> src_compiler_codegen_index_generate
src_compiler_parser_index_parse -- "leverages" --> src_compiler_parser_html_parser_parseHTML
src_compiler_codegen_index_generate -- "interacts with" --> src_compiler_directives_model_model
src_compiler_create_compiler_createCompiler -- "exposes" --> src_compiler_to_function_compileToFunctions
The Vue.js compiler subsystem orchestrates the transformation of template strings into optimized render functions. The baseCompile component serves as the central orchestrator, initiating the parsing of raw templates by src.compiler.parser.index.parse, which in turn leverages src.compiler.parser.html-parser.parseHTML for low-level HTML parsing. The resulting Abstract Syntax Tree (AST) is then optimized by src.compiler.optimizer.optimize to identify static content. Subsequently, src.compiler.codegen.index.generate converts the optimized AST into executable JavaScript code. During this code generation, specific directive logic, such as that for v-model encapsulated in src.compiler.directives.model.model, is applied. Finally, src.compiler.create-compiler.createCompiler provides the public interface to the compiler, exposing src.compiler.to-function.compileToFunctions to convert the generated code into callable functions for the runtime. This structured flow ensures efficient and optimized template compilation.
The orchestrator and primary entry point for the template compilation process. It coordinates the parsing, optimization, and code generation stages.
Related Classes/Methods:
Responsible for parsing the raw template string into an Abstract Syntax Tree (AST), representing the template's structure and content.
Related Classes/Methods:
Analyzes the generated AST to identify static parts of the template that do not need re-rendering on data changes, marking them for optimization to improve runtime performance.
Related Classes/Methods:
Takes the optimized AST and traverses it to generate a JavaScript code string, which will become the render function.
Related Classes/Methods:
Provides the public API for the compiler, allowing external modules or build tools to initiate the compilation process and access its functionalities.
Related Classes/Methods:
A utility component that finalizes the compilation by converting the generated JavaScript code string into actual executable functions, ready for the runtime.
Related Classes/Methods:
A low-level parser specifically designed to parse raw HTML, forming the foundational step for the higher-level template parser.
Related Classes/Methods:
Encapsulates the specific logic for handling the v-model built-in directive during the compilation process, influencing both parsing and code generation.
Related Classes/Methods: None