chibivue is minimal Vue.js v3 core implementations.
(Reactivity System, Virtual DOM and Patch Rendering, Component System, Template Compiler, SFC Compiler)
"chibi
" means "small
" in Japanese.
This project began in February 2023 with the goal of simplifying the understanding of Vue's core implementation.
Currently, I am still in the process of implementation, but after implementation, I intend to post explanatory articles as well.
(For now, I plan to post Japanese first.)
This project uses pnpm as a package manager.
And use ni .
# if you don't have ni yet
npm i -g @antfu/ni
total: 360,000 chars β (japanese)
English: https://ubugeeei.github.io/chibivue/en/
Japaneses: https://ubugeeei.github.io/chibivue
$ git clone https://github.com/Ubugeeei/chibivue
$ cd chibivue
$ ni
$ nr book:dev
$ git clone https://github.com/Ubugeeei/chibivue
$ cd chibivue
$ ni
# generate playground files to ~/example/playground (git ignored)
$ nr dev:setup
# listen localhost
$ nr dev
original vue.js 3.3 playground
$ nr vue:setup
$ nr vue
This online book is currently a work in progress.
Please refer to the information below for the progress status.
feature | impl | book |
---|---|---|
ref | β | β |
computed | β | β |
reactive | β | β |
readonly | β | β |
watch | β | β |
watchEffect | β | β |
isRef | β | β |
unref | β | β |
toRef | β | β |
toRefs | β | β |
isProxy | β | β |
isReactive | β | β |
isReadonly | β | β |
shallowRef | β | β |
triggerRef | β | β |
shallowReactive | β | β |
customRef | β | β |
toRaw | β | β |
effectScope | β | β |
getCurrentScope | β | β |
onScopeDispose | β | β |
template refs | β | β |
feature | impl | book |
---|---|---|
h function | β | β |
patch rendering | β | β |
key attribute | β | β |
scheduler | β | β |
nextTick | β | β |
ssr |
feature | impl | book |
---|---|---|
Options API (typed) | β | β |
Composition API | β | β |
lifecycle hooks | β | β |
props / emit | β | β |
expose | β | β |
provide / inject | β | β |
slot (default) | β | β |
slot (named/scoped) | β | β |
async component and suspense |
feature | impl | book |
---|---|---|
v-bind | β | β |
v-on | β | β |
event modifier | β | β |
v-if | β | β |
v-for | β | β |
v-model | β | |
v-show | ||
mustache | β | β |
slot (default) | ||
slot (named) | ||
slot (scoped) | ||
dynamic component | ||
comment out | β | β |
fragment | β | β |
bind expressions | β | β |
resolve components | β | β |
feature | impl | book |
---|---|---|
basics (template, script, style) | β | β |
scoped css | ||
script setup | β | |
compiler macro | β |
feature | impl | book |
---|---|---|
store | β | |
router | β | |
keep-alive | ||
suspense |
- Complete Basic Template Compiler
- Slots
- Complete Basic SFC Compiler
- script setup
- compiler macro
- Overall restructuring
- Fixing typos and errors
- Reviewing English version of the text
- Making explanations more understandable
- Implementation and explanation of SSR / SSG
- Implementation and explanation of compile-time optimization
Tree flattening and static hoisting, among others - Incorporate refactoring of the parser that will likely be included in Vue.js 3.4
γvuejs/core#9674 - Incorporate refactoring of the reactivity package that will likely be included in Vue.js 3.4
vuejs/core#5912 - π Implementation and explanation of **Vapor Mode**
Since the official version has not been released, we will implement it based on our predictions.
https://github.com/vuejs/core-vapor/tree/main
This is bonus track on writing Vue.js in 15 minutes because chibivue has gotten so big.
This chapter implements createApp / virtual dom / patch / reactivity / template compiler / sfc compiler in just 110 lines of source code.
The title is "Hyper Ultimate Super Extreme Minimal Vue - writing Vue.js on 15 minutes"
Please see contributing.md.