上級者向け 30 分サマリ
AI 生成による付録
この付録は chibivue 本編の内容をもとに GPT-5.5 で草案化したものです.学習ルートとして利用し,正確な実装や詳しい説明は本編と実装コードを参照してください.
これは,ソースコードを読む前に本全体を 1 回で俯瞰したい人向けの圧縮 map です.1 checkpoint あたり 1 分くらいで眺めてください.明らかなら先に進み,曖昧ならリンク先の章を開きます.
30 checkpoints
- この本は 1 行の rendering から始まる: Vue を完全 clone することではなく,考え方を手で再構築することが目的です.
- Vue の core pieces: runtime,renderer,reactivity,compiler,SFC tooling は別の関心事です.
- Project setup: package boundary は学習 path を見えるようにします.
- createApp: app API は mount を包み,user に 1 つの entry point を渡します.
- Package architecture: runtime-core は platform neutral,runtime-dom は browser operation を担当します.
- h と VNode: render output は DOM ではなく data structure です.
- Events and attributes: DOM patching には platform specific な prop handling が必要です.
- Minimum reactivity: Proxy read は track,Proxy write は trigger です.
- Minimum Virtual DOM: patch は old VNode と new VNode を比べて DOM を更新します.
- Minimum components: component VNode は instance を作り,render を実行することで mount されます.
- Props: parent data は normalize された入力として child component に渡ります.
- Emits: child event は,命名規則に沿った parent handler として扱えます.
- Template compiler overview: template は render function になります.
- Compiler implementation: parse,transform,codegen が compiler pipeline の中心です.
- Template binding: compiler output は render context から値を読む必要があります.
- SFC parse:
.vuefile は script,template,style block に分解されます. - SFC template/script/style: Vite plugin が SFC transform を development に接続します.
- Keyed patching: stable key によって renderer は child を移動し,再利用できます.
- Shape flags: bit flag は繰り返しの type check を安くします.
- Scheduler: reactive change は work を queue に積み,update を batch できます.
- ref, computed, watch: reactivity は object から value container と user-facing effect に広がります.
- Reactive proxy handlers: collection,ref,readonly,shallow value には handler の nuance が必要です.
- Effect cleanup and scope: effect には rerun だけでなく lifecycle management が必要です.
- Component lifecycle: component instance は user hook を呼ぶ場所を runtime に与えます.
- Provide/Inject and setup context: component tree には構造化された dependency と context の channel が必要です.
- Slots: children は lazy render function として渡せます.
- Template transforms: directive は syntax を VNode data に変える compiler plugin です.
- Structural directives:
v-if,v-for,fragment,comment,slot は generated tree の形を決めます. - SFC compiler macros:
script setup,defineProps,defineEmits,scoped CSS,type-based macros は compile-time convenience です. - Application essentials and optimizations: router,store,SSR,built-ins,static hoisting,patch flags,tree flattening,Vapor Mode は,同じ core ideas がどう拡張されるかを見せます.
サマリ後に読む source path
止まらずに 1 回流して読むなら,この順番がおすすめです.
txt
packages/reactivity -> packages/runtime-core -> packages/runtime-dom -> packages/compiler-core -> packages/compiler-sfcその後で 本家のソースコードをデバッグする を読み,chibivue の簡略化された選択と vuejs/core を比較してください.
