How cuixiaorui/mini-vue works
Project Type and Purpose
• The project is a modular, monorepo implementation of Vue 3’s core modules aimed at learning and exploring Vue’s fundamental architecture. It is not an industrial application but a deliberately simplified version that strips out peripheral logic to focus on core concepts.
• The README highlights that its purpose is to let learners “从零到一实现一遍” (build the core logic themselves) in order to understand the inner workings of Vue 3—covering reactivity, runtime component handling, and template compilation.
File Structure
• There are several top-level packages under a “packages” folder:
– compiler-core: Deals with parsing templates (e.g., transforming interpolations, elements, and text nodes) and generating code (via codegen, transform, parse, etc.).
– reactivity: Implements the reactive system including reactive/ref, computed, dependency tracking, shallow/readonly mechanisms, etc.
– runtime-core: Manages the component system such as component instantiation, props/emit, component proxy, slot management, scheduler (e.g., nextTick), and instance retrieval.
– runtime-dom: Provides support for custom DOM renderers.
– runtime-test: Contains tests that validate runtime-core logic.
– shared: Exposes common utilities and type definitions (like shapeFlags) that are used across the system.
– vue: Acts as an aggregate package with examples and likely integration glue to demonstrate how these modules work together in a real application.
• Additionally, there are configuration files for pnpm (monorepo setup), Rollup, TypeScript, and Vitest, indicating use of modern build and test tooling.