Code Monkey home page Code Monkey logo

gb-vue's Introduction

gb-mini-vue(记录学习vue3源码过程)

huochunyang-mini-vue对于《Vuejs设计与实现》实现思路,在mini-vue中是对于另一个库《mini-vue》+ vue3源码的实现,将vue3源码逻辑抽离出来但又保证主要实现逻辑。不同模块提取中...,直接通过mini-vue/main.html运行调试,//忽略compiler-sfc

  • 响应式
响应式是vue3的核心,是学习vue3的一个重点,相比较于vue2,vue3通过proxy实现数据劫持。
  • dep
  • initDepMakers
  • fininalizeDeoMakers
  • ReactiveEffect
  • effect
  • computed
  • readonly
  • ref
  • shallowRef
  • unRef
  • isRef
  • customRef
  • reactive
  • shallowReactive
  • readonly
  • shallowReadonly
  • toRaw
  • toReactive
vue3通过位运算实现依赖的收集与清除,相比较于直接cleanuEffect提升了较多性能。 
  • 编译器
主要通过三个阶段的编译过程
  • ast

  • transform

    • transformElement
    • transformText
    • transformIf
    • transformFor
    • transformOn
    • transformBind
  • generate

  • 渲染器

vue3使用快速diff算法实现dom最小化更新
  • 简单diff
  • 双端diff
  • 快速diff

diff算法的实现在runtim-core/diff中,文件分别对简单diff和双端diff以及快速diff做了实现,简单diff和双端diff实现基于《Vue.js的设计与实现》中代码实现,快速diff基于源码+《Vue.js的设计与实现》实现。

gb-vue's People

Contributors

bug-codergb avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.