Ubugeeei / chibivue

chibivue is minimal Vue.js v3 core implementations (Reactivity System, Virtual DOM, Component, Compiler (Template, SFC)). An online book for building your own Vue.js.

Home Page:https://ubugeeei.github.io/chibivue/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


chibivue is minimal vuejs/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.)

example

πŸ‘œ Package Manager

This project uses pnpm as a package manager.

And use ni .

# if you don't have ni yet
npm i -g @antfu/ni

πŸ“” Online Book

Pages Deploy

total: 370,000 chars ↑ (japanese)

book url (GitHub Pages)

English: https://ubugeeei.github.io/chibivue/en

Japaneses: https://ubugeeei.github.io/chibivue

open book on localhost

$ git clone https://github.com/Ubugeeei/chibivue
$ cd chibivue
$ ni
$ nr book:dev

view on github

English | Japanese

πŸŽ₯ playground

$ git clone https://github.com/Ubugeeei/chibivue
$ cd chibivue
$ ni

# generate playground files to ~/example/playground (git ignored)
$ nr setup:dev

# listen localhost
$ nr dev

⚠️ status

This online book is currently a work in progress.

Please refer to the information below for the progress status.

Reactivity System

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 βœ… βœ…

Virtual Dom & Renderer

feature impl book
h function βœ… βœ…
patch rendering βœ… βœ…
key attribute βœ… βœ…
scheduler βœ… βœ…
nextTick βœ… βœ…
ssr

Component System

feature impl book
Options API (typed) βœ… βœ…
Composition API βœ… βœ…
lifecycle hooks βœ… βœ…
props / emit βœ… βœ…
expose βœ… βœ…
provide / inject βœ… βœ…
slot (default) βœ… βœ…
slot (named/scoped) βœ… βœ…
async component and suspense

Template Compiler

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 βœ… βœ…

SFC Compiler

feature impl book
basics (template, script, style) βœ… βœ…
scoped css
script setup βœ…
compiler macro βœ…

Extensions and Other Builtin

feature impl book
store βœ…
router βœ…
keep-alive
suspense

πŸ—“οΈ Big Plans

  • 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

πŸŽ‰ Bonus Track

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"

Online Book | Actual Source

Contributing

Please see contributing.md.

About

chibivue is minimal Vue.js v3 core implementations (Reactivity System, Virtual DOM, Component, Compiler (Template, SFC)). An online book for building your own Vue.js.

https://ubugeeei.github.io/chibivue/


Languages

Language:TypeScript 98.8%Language:Vue 0.5%Language:HTML 0.4%Language:CSS 0.2%Language:JavaScript 0.1%Language:Shell 0.0%