Git Product home page Git Product logo

kamen-design-vite-vue3's Introduction

写在前面

  • 为什么要使用Vite来写Vue3组件库
    • 1.Vite很快,非常快,原因如下:
      • 1.Vite是基于esbuild与构建以来。esbulid是用go语言编写的,go的操作是纳秒级别,而js是毫秒级别,所以Vite运行速度比基于js的webpack要快
      • 2.Vite启动服务器请求模块是按需动态编译显示,所以编译时间一般来说远远短于webpack。【热更新不需要想webpack将模块以及模块依赖全部编译一次】
    • 2.暂时不去谈它和React的比较吧,Vue3比Vue2要优秀,原因如下:
      • 1.diff算法的优化。---Vue3新增了静态标记(patchflag),只会比较动态数据所在节点。
      • 2.hoistStatic静态提升。---Vue3对于不参与更新的元素,会做静态提升,只会被创建一次(放到渲染函数之外)
      • 3.cacheHandlers时间帧听器缓存(添加了静态标记)
      • 4.SSR渲染
      • 5.更好的TS支持
      • 6.组合API(类React写法)
      • 加上Vue2应该是在23年年底会停更吧,Vue3是会逐渐替代Vue2
    • Vite强大的生态,Vitepress和Vitest,可以形成一个生态圈
  • 什么是组件库?
    • 我们通过Vite将一个组件封装为组件库,组件库可以被其他Vue项目作为插件直接进行使用
    • 这就是造轮子,这样就可以让自己的代码被别人方便的使用
    • 一个好的组件库,可以大大加速我们的开发速度

一次很棒的工程化实践

使用vite搭建的vue3组件库,有详细的从零到一的组件库搭建记录,是一次很棒vite和vue3的工程化实践

kamen-design-vite-vue3's People

Contributors

kamenrider41 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.