5 Star 13 Fork 10

vweb8 / minivue3

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

mini-dev-vue3

介绍

深入学习vue3源代码,基于TypeScript语言开发、lerna + monorepo多包管理实现一个mini版的vue3框架。

安装依赖

npm 不支持 workspaces,安装依赖必须使用 yarn 安装依赖

yarn # 必须

开发

测试范例文档目录:./packages/vue/examples/

yarn dev <name> -s  # '<name>打包目标[为空默认vue,]'; -s '是否开启souceMap'

启动docs

vue3源码详细说明文档、lerna、pnpm、rollup相关使用说明。

yarn doc:dev

测试

yarn test

构建

构建输出文件目录:./packages/*/dist/

yarn build <name>  # '<name>构建目标[为空默认全部]'

功能实现

vue

  • [✔️] vue打包入口 区分runtime/full-build构建

reactivity

  • [✔️] reactive 的实现
  • [✔️] ref 的实现
  • [✔️] readonly 的实现
  • [✔️] 支持 isReactive
  • [✔️] 支持嵌套 reactive
  • [✔️] 支持 toRaw
  • [✔️] 支持 unref
  • [✔️] 支持 toRef
  • [✔️] 支持 toRefs
  • [✔️] 支持 isReadonly
  • [✔️] 支持 isProxy
  • [✔️] 支持 shallowReadonly
  • [✔️] 支持 proxyRefs
  • [✔️] track 依赖收集
  • [✔️] trigger 触发依赖
  • [✔️] 支持 effect.stop
  • [✔️] 支持 effect.scheduler
  • [✖️] computed 的实现

shared

  • [✔️] 工具库,通用方法

runtime-dom

  • [✔️] 浏览器的runtime,处理原生DOM API

runtime-core

  • [✔️] 支持组件类型
  • [✔️] 支持 setupRenderEffect
  • [✔️] 初始化 props
  • [✔️] setup 可获取 props 和 context
  • [✔️] 支持 component emit
  • [✔️] 支持 proxy
  • [✔️] 可以在 render 函数中获取 setup 返回的对象
  • [✔️] 支持 getCurrentInstance
  • [✔️] 支持 provide/inject
  • [✔️] 支持 $el api
  • [✔️] 支持 element 类型
  • [✔️] 支持 Text 类型节点
  • [✔️] nextTick 的实现
  • [✖️] 支持最基础的 slots

compiler-core

  • [✖️] Parse AST的实现
  • [✖️] Transform AST优化
  • [✖️] Codegen 生成render函数

compiler-dom

  • [✖️] compiler 浏览器编译模块

vue3源码思维导图

Vue3源码思维导图

学习借鉴

1、vue-next 源码
2、mini-vue 源码

MIT License Copyright (c) 2021 pan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

深入学习vue3源代码,基于typescript语言开发、lerna + monorepo多包管理实现一个mini版的vue3框架。 展开 收起
TypeScript 等 3 种语言
MIT
取消

发行版 (3)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
TypeScript
1
https://gitee.com/yiyi520/minivue3.git
git@gitee.com:yiyi520/minivue3.git
yiyi520
minivue3
minivue3
dev_pan

搜索帮助