Code Monkey home page Code Monkey logo

mini-vue-shr's Introduction

mini-vue-shr

简易版 Vue3 实现,代码是深入阅读 《Vue.js设计与实现》 后的产物,感兴趣的读者可自行参考。测试用例只保证了框架的基本功能,代码问题欢迎PR。

开启 vitest

npm run test

已开发功能模块(持续更新中...)

响应式系统

  • 副作用函数编写
  • computed 计算属性
  • watch 监听属性
  • reactive
  • shallowReactive
  • readonly
  • shallowReadonly

渲染器

  • 实现挂载与更新操作
  • 实现虚拟DOM简单diff算法
  • 实现虚拟DOM双端diff算法

组件初始化

  • 组件生命周期钩子处理
  • 组件 setup 函数处理及 props,renderContext 处理
  • 组件实例 instance 处理

模板编译器

  • parse(通过有限状态自动机构造一个词法分析器,生成模板 AST)
  • transform(将 模板 AST 生成JS AST并挂载到 node.jsNode 上)
  • generate(代码生成,使用字符串拼接把 node.jsNode 转为渲染函数代码字符串)

need marker or review

  • set集合的拦截操作
  • 事件冒泡与更新时机问题

如果对你有帮助,请给个star

mini-vue-shr's People

Contributors

pursuit01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mini-vue-shr's Issues

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.