The popular JavaScript UI building framework Vue.js has pushed out a new version 3.2 with promising users performance improvements along with presenting a technique for making custom components through the tool’s component APIs. The release date of Vuejs 3.2 is 5th August 2021 with a fixed import usage and no public API breakage.
The version is being nicknamed as "Quintessential Quintuplets" which includes many significant new features and contains no breaking changes in VueJs 3.2. Without further ado, let's know what’s new in Vuejs 3.2!
Vuejs 3.2 features two new components for Single File Components (SFCs, aka .vue files) that have been upgraded from experimental status to a stable stage.
<script setup>
import { ref } from 'vue'
const color = ref('red')
<script><template>
<button @click="color = color === 'red' ? 'green' : 'red'">Color is: {{ color }} </button></template>
<style scoped>
button {
color: v-bind(color);
}
</style>
While <script setup> is a compile-time syntactic sugar that exposes all top level bindings to a template eventually improving the ergonomics , <style> v-bind allows the connection of a component’s state and style and enables dynamic CSS values in SFC <style> tags.
Other than the adjustment and stabilization work being crucial to abandon the test status, <script setup> was fitted with help for namespaced segment tags and non-unequivocal type imports.
Vuejs features another defineCustomElement strategy for effectively making native custom components utilizing Vue component APIs.
import { defineCustomElement } from 'vue'
const MyVueElement = defineCustomElement({
// normal Vue component options here
})
// Register the custom element.
// After registration, all `` tags
// on the page will be upgraded.
customElements.define('my-vue-element', MyVueElement)
This API permits Vue developers to make Vue-controlled UI component libraries that can be utilized with any system, or no structure in any way, which is valuable when components are wanted to be integratable into various innovation stacks. The team have additionally added another part in the documentation on consuming and making Web Components in Vue.
The strategy acknowledges similar contentions as defineComponent, yet returns a custom component constructor that broadens HTMLElement. It likewise works with Vue's single-file components (SFC), however, this use case requires a bit of extra consideration with style tags.
Vue.Js maker Evan You also vigorously featured the performance improvements that got sent with the new delivery, taking note of "huge performance upgrades to Vue's reactivity framework". Vue.Js 3.2 has a better working template compiler that is a more aggressive constant hoisting.
Along with this, v-memo directive gives the capacity to memoize some portion of the format tree.A v-memo hit permits Vue to skip the Virtual DOM diffing along with the production of new VNodes altogether. Although rarely required, it gives a getaway hatch to crush out most extreme execution in specific situations, for instance enormous v-for lists.
Another feature of Vue.Js 3.2 is the @vue/server-renderer package sends an ES module construct which is also decoupled from Node.js built-ins. This makes it possible to package and use @vue/server-renderer for use inside non-Node.js runtimes like CloudFlare Workers or Service Workers.
The expansion additionally fills in as the establishment for some experimental compile-time macros that are intended to work on responsive code a bit by offering approaches to utilize refs without value — something that has been a hotspot for complications previously.
The team has additionally developed the streaming render APIs, with new techniques for delivering to the Web Streams API.
Vue.js 3.2 features another Effect Scope API for straightforwardly controlling the removal timing of receptive impacts (computed and watchers). It makes it simpler to use Vue's reactivity API out of a component setting, and furthermore opens some high level use cases inside components.
This is a low-level API to a great extent expected for library authors as opposed to Vuejs 3.0 where Composition API improved the quality of the code and co-exist with the Options API. Hence, it's prescribed to peruse the component's RFC for the inspiration and use cases of this element.
Library authors are urged to look at the recently added Effect Scope API for @vue/reactivity. The interface is a deliberation of the event collection and disposal capacities accessible in a component’s arrangement(). Prior to its introduction, effects were required to be manually gathered when utilized outside of components or as a standalone, since they should be arranged when a component is unmounted.
This release does not have any public API breakage however contains a few compatibility related notes:
The team is excited to have been able to launch Vue.Js 3.2 after halting for nearly half a year to just stabilize the Vue.js 3 release. The transition period is now over and we are off to better things with fundamental improvements that opens up avenues for future iterations. It is certainly a pleasure for Vue development company to see what new ideas and tools are yet to be embarked upon for a new chapter in the Vue.js roadmap.
Version | Release date | Title |
---|---|---|
3.2 | August 5, 2021 | Quintessential Quintuplets |
3.1 | June 7, 2021 | Pluto |
3.0 | September 18, 2020 | One Piece |
2.6 | February 4, 2019 | Macross |
2.5 | October 13, 2017 | Level E |
2.4 | July 13, 2017 | Kill la Kill |
2.3 | April 27, 2017 | JoJo's Bizarre Adventure |
2.2 | February 26, 2017 | Initial D |
2.1 | November 22, 2016 | Hunter X Hunter |
2.0 | September 30, 20n6 | >Ghost in the Shell |
1.0 | October 27, 2015 | Evangelion |
0.12 | June 12, 2015 | Dragon Ball |
0.11 | November 7, 2014 | Cowboy Bebop |
0.10 | March 23, 2014 | Blade Runner |
0.9 | February 25, 2014 | Animatrix |
0.8 | January 27, 2014 | |
0.7 | December 24, 2013 | |
0.6 | December 8, 2013 |
This website uses cookies to analyze website traffic and optimize your website experience. By continuing, you agree to our use of cookies as described in our Privacy Policy.