MCPcopy Index your code
hub / github.com/cuixiaorui/mini-vue

github.com/cuixiaorui/mini-vue @main

repository ↗ · DeepWiki ↗ · + Follow
250 symbols 550 edges 101 files 0 documented · 0% updated 2y ago★ 10,56516 open issues
README

EN / CN

mini-vue

Implement the simplest vue3 model for in-depth study of vue3 source code

Usage

Bilibili Provides a video explaining how to use it

Can follow my Bilibili,Interpretation of live source code from time to time

Discuss

You can join the group to discuss the vue3 source code

image.png

with WeChat

Service

Provide one-to-one video teaching services, and take you to see the mini-vue source code hand in hand

Can add group communication

Why

When we need to learn vue3 in depth, we need to look at the source code to learn, but like this kind of industrial-level library, there are a lot of logic in the source code for processing edge cases or compatible processing logic, which is not conducive to our learning.

We should focus on the core logic, and the purpose of this library is to separate the core logic from the vue3 source code, leaving only the core logic for everyone to learn.

How

Based on the function points of vue3, split it out bit by bit

The code naming will remain consistent with the source code, so that you can find logic in the source code through naming.

Tasking

  • [x] support component type
  • [x] support element type
  • [x] init props of component
  • [x] context can get props and context in setup
  • [x] support component emit
  • [x] support proxy
  • [x] can get the object returned by setup in the render function
  • [x] Implementation of nextTick
  • [x] support getCurrentInstance
  • [x] support provide/inject
  • [x] support basic slots
  • [x] support text type

roadmap

  • [ ] support english
  • [ ] normalize console.log

build

yarn build

example

Open index.html under example/* use server

 Recommended Use Live Server

Initialization

flow chart

初始化流程图

Key function call graph

关键函数调用图1

关键函数调用图2

The source code content can be quickly searched based on the function name

update

flow chart

update流程图

Key function call graph

update关键函数调用图

The source code content can be quickly searched based on the function name

Core symbols most depended-on inside this repo

h
called by 92
packages/runtime-core/src/h.ts
reactive
called by 18
packages/reactivity/src/reactive.ts
ref
called by 16
packages/reactivity/src/ref.ts
push
called by 15
packages/compiler-core/src/codegen.ts
effect
called by 13
packages/reactivity/src/effect.ts
baseParse
called by 13
packages/compiler-core/src/parse.ts
isReactive
called by 11
packages/reactivity/src/reactive.ts
patch
called by 9
packages/runtime-core/src/renderer.ts

Shape

Function 231
Method 7
Class 6
Enum 6

Languages

TypeScript100%

Modules by API surface

packages/runtime-core/src/renderer.ts20 symbols
packages/compiler-core/src/codegen.ts16 symbols
packages/reactivity/src/ref.ts14 symbols
packages/compiler-core/src/parse.ts14 symbols
packages/reactivity/src/effect.ts13 symbols
packages/runtime-core/src/component.ts10 symbols
packages/shared/src/index.ts9 symbols
packages/runtime-dom/src/index.ts9 symbols
packages/reactivity/src/reactive.ts9 symbols
packages/runtime-core/src/scheduler.ts7 symbols
packages/runtime-core/src/apiWatch.ts6 symbols
packages/reactivity/src/baseHandlers.ts6 symbols

Dependencies from manifests, versioned

@mini-vue/compiler-coreworkspace:^1.0.0 · 1×
@mini-vue/reactivityworkspace:^1.0.0 · 1×
@mini-vue/runtime-coreworkspace:^1.0.0 · 1×
@mini-vue/runtime-domworkspace:^1.0.0 · 1×
@mini-vue/sharedworkspace:^1.0.0 · 1×
@rollup/plugin-commonjs13.0.0 · 1×
@rollup/plugin-node-resolve8.1.0 · 1×
@rollup/plugin-replace2.3.3 · 1×
@rollup/plugin-typescript8.2.5 · 1×
@vue/reactivity3.0.5 · 1×
cypress11.0.1 · 1×
pixi.js6.2.0 · 1×

For agents

$ claude mcp add mini-vue \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact