1. Design goals
Updates that do not solve the actual business pain points are hooligans. Let’s list Vue3
the problems we may face before
-
Code for complex components becomes harder to maintain as functionality grows
-
Lack of a "clean" mechanism for extracting and reusing logic across multiple components
-
Type inference is not friendly enough
-
bundle
too long
And Vue3
after two or three years of preparation, what did you do?
We deduce from the result
- smaller
- faster
- TypeScript support
- API design consistency
- Improve self-maintainability
- Open up more underlying functions
In a word, it is smaller, faster and more friendly
smaller
Vue3
Remove some unusedAPI
Introduced tree-shaking
, you can "clip" useless modules, and only package what you need, making the overall volume of the package smaller
faster
Mainly reflected in the compilation:
- diff algorithm optimization
- static boost
- event listener cache
- SSR optimization
In the next article we will introduce more
more friendly
vue3
in vue2
bothoptions API