资料内容:
Improvements to the framework
There are numerous improvements to the Vue framework in this new release; all of them
focused on making the framework better in every way possible. Here are some of the
improvements that can impact the everyday development and usage of the framework by
users and developers.
Under the hood
The outer shell looks the same as the old one, but the engine is a piece of art. In the new
version, there is no leftover code from Vue 2. The core team built the framework from the
ground up using TypeScript and rewrote everything geared to the maximum performance
of the framework.
TypeScript was chosen to create a more maintainable code base for the Vue core team and
the open-source community, and to improve the autocomplete features, such as
IntelliSense or typeahead that the IDEs and code editors provide, without the need for
special plugins and extensions.
Render engine
For Vue 3, a new render engine was developed using a new algorithm for the shadow
DOM. This new render is totally exposed by the core of the framework by default, without
the need to be executed by the framework. This makes it possible for new implementations
of a completely new render function that can be injected into the framework and replace the
original render engine.
In this new version of Vue, a new template compiler was written from scratch. This new
compiler uses a new technique for cache manipulation and to manage the rendered
elements, and a new hoisted method is applied to the creation of VNodes.
For cache manipulation, a new method is applied to control the position of the element,
where the element can be a dynamic element with computed data or a response to a
function that can be mutated