重磅|vue3.0终于来了

重磅|vue3.0终于来了

重磅|vue3.0终于来了

点击蓝字 「前端小苑」关注我

在10月5日凌晨,vue作者尤雨溪在微博上宣布Vue3.0的源码开放了。期待已久的Vue3.0终于如约与大家见面了。是不是有些小激动!

点击文末左下角 阅读原文,直接跳转到vue3.0源码!

重磅|vue3.0终于来了

尤雨溪表示,Vue3.0目前依然是pre-alpha状态,但主要的架构改进、优化和新功能都已经完成,剩下的主要是完成一些Vue2现有功能的移植。

接下来我们看一下Vue3.0都已经完成了哪些架构改进和新功能。

  • Compiler

  1. Modular architecture

  2.  "Block tree" optimization

  3.  More aggressive static tree hoisting

  4.  Source map support

  5.  Built-in identifier prefixing (aka "stripWith")

  6.  Built-in pretty-printing

  7.  Lean ~10kb brotli-compressed browser build after dropping source map and identifier prefixing

  • Runtime

  1. Significantly faster

  2.  Simultaneous Composition API + Options API support, with typings

  3.  Proxy-based change detection

  4.  Fragments

  5.  Portals

  6.  Suspense w/ async setup()

未完成的Vue2现有功能的移植有:

  1.  Server-side rendering

  2.  <keep-alive>

  3.  <transition>

  4.  Compiler DOM-specific transforms

    1.  v-on DOM modifiers

    2.  v-model

    3.  v-text

    4.  v-pre

    5.  v-once

    6.  v-html

    7.  v-show


可见,Vue3.0

更小!

去除source map和identifier prefixing后的核心库代码将在10kb上下。

更快!

基于Proxy的数据监测,性能整体优于getter/setter

采用Block Tree,突破了传统vdom的性能瓶颈。

是不是等不及了? 点击左下角阅读原文,将跳转到vue3.0源码。

重磅|vue3.0终于来了