对象已移动

可在此处找到该文档 New Vue js features – Vue 3+ overview – New Self New Life
New Self New Life
No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices
New Self New Life
No Result
View All Result
Home Softwares

New Vue js features – Vue 3+ overview

by admin
4 days ago
in Softwares
New Vue js features – Vue 3+ overview
Share on FacebookShare on Twitter


Now we have all been ready for this second for a very long time and it lastly occurred – the brand new main launch of Vue is right here! The Vue 3 brings numerous new Vue js options and makes good on the guarantees of the previous 2 years. On this article, I’m going over the brand new Vue options, discussing the way forward for this JavaScript framework and making suggestions on tips on how to begin studying Vue in 2021.

* The article has been up to date to mirror the adjustments launched within the newest variations as much as Vue 3.04 launched in December 2020. Close to the tip of the article, you will see that an summary of what’s modified in Vue since Vue 3.0 was launched.

Vue js is now one of the widespread open supply frameworks for constructing consumer interfaces of contemporary internet purposes. It was created in 2014 by ex-Google developer Evan You. It has now round 157k stars on Github and numerous group members. A number of days in the past, Vue 3.0 was launched. It’s referred to as “One Piece” – a reference to {the japanese} manga by the identical title. What does the brand new Vue js launch for internet purposes? How will the Vue js growth change?

On this article, I’ll undergo the Vue js launch notes and present you an important Vue new options and probably the most exceptional adjustments within the Vue 3 core library. As a developer who does internet growth with Vue every day, I may even give my very own opinion about these adjustments, which embody points equivalent to state administration, information binding, creating customized parts and plenty of others . I may even inform you a factor or two about the way forward for the Vue framework and its place on this planet of frontend growth. Earlier than we get to that although, have you ever questioned why this and different variations of Vue are named after anime/manga titles?

Vue launch names – why manga & anime?

As you might need already seen, Vue makes use of widespread Japanese manga and anime titles to call the next releases of its framework. Vue 3 is known as after the massively widespread shonen collection One Piece. And the older releases embody titles equivalent to Dragon Ball, Ghost within the Shell, Hunter X Hunter, Preliminary D or JoJo’s Weird Journey. The place is that this coming from?

It’s all due to the unique creator of the Vue Framework – Evan You. As a giant fan of manga, he began the custom of blessing every launch with a manga/anime title, beginning with Animatrix for Vue 0.9 and shifting ahead in alphabetical order. It implies that the subsequent Vue launch ought to obtain a “P” title. Are you able to guess what title it may very well be?

The favored manga and anime Dragon Ball is without doubt one of the titles honoured within the Vue model naming conference

Vue new model – lengthy overdue Vue 3

We needed to wait about 2 years for the steady launch of Vue 3. The primary details about Vue 3 appeared on September twenty first, 2018 on the Vue.js convention in London. The primary alpha model was launched at first of 2020. Vue Core Workforce determined to maneuver all of the work relating to Vue 3 to a separate repository referred to as vue-next and rewrite the Vue core from scratch utilizing TypeScript insteafd of vanilla JavaScript. This allowed the creators to rethink and enhance a number of the core mechanisms within the Vue js framework.

Throughout these 2 years of onerous work, round 100 contributors did a extremely nice job by making ready over 30 RFC, over 600 pull requests and over 2600 commits to the Vue 3 repository. Spectacular!

Vue.js London is a significant world convention for frontend builders

Vue 3 migration points

Here’s a listing of an important breaking adjustments within the Vue 3 JavaScript framework:

  • To create a Vue app, we have to use a particular createApp operate as an alternative of making a Vue object occasion,

Creating app in Vue 2:

Creating app in Vue 3:

  • As you possibly can see within the instance above, the information choice in Vue 3 ought to at all times be a technique.
  • International Vue elements in Vue 3 must be now hooked up to the applying object as an alternative of attaching them to the Vue occasion.

Mounting world Vue element in Vue 2:

Mounting Vue world element in Vue 3:

  • Different elements of the Vue ecosystem in Vue 3 additionally must be hooked up to the applying object as an alternative of attaching them to the Vue occasion.

Mounting router and retailer in Vue 2:

Mounting router and retailer in Vue 3

  • When you use the Vue Transition element in your app, you’ll want to change the naming of particular courses associated to dealing with transitions.

If you wish to see all breaking adjustments in Vue 3, you possibly can test the Vue migration information.

Composition API – a great various to React Hooks?

With the intention to construct Vue elements in Vue 2, we’re utilizing the Choices API. It implies that we will set varied choices throughout the element configuration (equivalent to information, pc, strategies, watch and so on).

Element configuration in Vue 2 with Choices API:

As you possibly can see, this API generates 2 primary issues:

  1. Logically associated fragments of code are separated from one another into many choices within the element.
  2. Reusing code between elements is troublesome and cumbersome. After all, in Vue 2 we will use mixins to reuse some logic between elements, however it nonetheless doesn’t resolve the primary drawback.

In Vue 3, the answer for these issues is the brand new Composition API. It replaces information, computed, strategies and watch choices with the setup technique of the element.

Element configuration in Vue 3 with Composition API:

The actually cool reality about Composition API is that it’s completely elective. You’ll be able to nonetheless use Choices API in case you really need, however the Composition API is now the really useful resolution for constructing elements.

Reusing logic between elements is resolved by utilizing composition features, which seems to be so much like React Hooks. Nevertheless, the composition features work a bit bit otherwise, however the thought is just about the identical.

Instance of easy composition operate:

Vue Fragment – no want for a prime stage component in your template!

One of many new options in Vue 3 is the Vue Fragment. It permits us to place many root parts within the template of our element. It is a very fascinating characteristic as a result of in lots of instances we don’t want this redundant block component that we should add to wrap all the weather in our element. From now in Vue 3, we don’t have to do that anymore!

Template script in Vue 2 earlier than implementing Vue Fragment:

Template script in Vue 3 with Vue Fragment carried out:

Teleport element – place your elements wherever within the DOM tree

One other fascinating new characteristic supplied in Vue 3 is the Teleport element. This element permits us to position HTML parts code of our element wherever within the DOM tree (even close to the ‘#app’ container).

It is a cool characteristic for every kind of dialog and modal elements. Any further, they don’t need to be deeply nested within the DOM tree, however we will as an alternative “teleport” them on to the physique component (close to the #app container). That’s superior!

Learn extra about Teleport within the Vue 3 documentation.

Experimental new options in Vue 3

Vue 3 brings two new experimental options devoted to the Single File Parts. They’re carried out as proposals to collect some suggestions from the group about them:

  • <script setup> – sugar syntax for utilizing Composition API inside SFCs,
  • <type vars> – state-driven CSS variables inside SFCs.

One other experimental characteristic accessible in Vue 3 is the <Suspense> element. Documentation for this element is just not prepared but, however it permits ready for nested async dependencies on preliminary render or department swap.

Vue Typescript assist out of the field

As I discussed at first of this text – the codebase of Vue 3 is now written from scratch in TypeScript. It positively improves the assist for utilizing TypeScript in tasks based mostly on Vue, as a result of the Vue sort definitions are routinely generated, examined, and at all times up-to-date. An necessary factor to notice is that TypeScript utilization in Vue tasks will nonetheless be totally elective. That’s superior!

One other fascinating incontrovertible fact that the Vue Core Workforce talked about is that after together with TypeScript into the Vue codebase, the system structure is now considerably simplified and have become a lot simpler to take care of.

Efficiency enhancements in Vue 3

The whole construct of Vue 3 weights round 20 kB, which is similar because the Vue 2 construct, however Vue 3 has extra options included. Nevertheless, we will lower the burden of Vue 3 construct utilizing the tree-shaking world API. It permits us to pick what options of Vue we actually want, utilizing particular flags.

One other secret of efficiency enhancements in Vue 3 is utilizing the Compiler-Knowledgeable Digital DOM. On this mechanism, the template compiler performs aggressive optimizations and generates render features code that hoists static content material, leaves runtime hints for binding sorts, and most significantly, flattens the dynamic nodes inside a template to scale back the price of runtime traversal.

What’s subsequent? The way forward for Vue

In the interim, Vue 3 core was completed and is now steady, however another elements within the Vue ecosystem equivalent to VueRouter or Vuex are nonetheless in beta levels. The documentation web sites, GitHub branches, and npm dist tags for Vue 3 and v3-targeting tasks will stay underneath next-denoted standing. Which means that npm i vue command will nonetheless set up Vue 2.x and npm i vue@subsequent will set up Vue 3. The Vue staff plans to launch steady variations of all of the Vue ecosystem elements and swap default variations and tags by the tip of 2020.

The Vue core staff has additionally began planning for model 2.7, which would be the final deliberate minor launch of Vue 2. Vue 2.7 will embody backporting suitable enhancements from v3, and emit warnings on the utilization of APIs which might be eliminated/modified in v3 to assist with the migration course of to Vue 3. The deliberate launch of Vue 2.7 will likely be in Q1 2021, which is able to instantly grow to be a LTS model upon launch with a upkeep lifespan of 18 months.

The creator of Vue.js Evan You stated that “Vue will likely be a framework that grows with the consumer”. It implies that everybody who has primary information of HTML, CSS and JavaScript can begin studying and dealing with Vue utilizing this HTML CSS JavaScript basis. That mission additionally assumes that the Vue developer won’t ever be a newbie on a regular basis, shifting from primary HTML and CSS in direction of extra superior ideas. We’re always studying about new methods so the purpose of Vue is just not solely to offer a easy studying curve, however to offer all the required instruments and methods to create more and more difficult Vue tasks.

Vue 3 new updates – December 2020

Since we revealed this Vue new options article, the framework has acquired a complete of 4 minor updates with Vue 3.0.4 being the most recent one, launched simply three weeks in the past. They embody varied bug fixes present in Vue 3 in addition to many enhancements that enhance efficiency and stability.

An necessary piece of knowledge for the Vue ecosystem is a brand new steady (4.0) model of the package deal vue-router, which got here out on December seventh this 12 months. It’s suitable with Vue 3 and works with TypeScript.

The vuex package deal continues to be within the Launch Candidate state. It implies that the options are there, however some optimization is so as earlier than it’s production-ready. In accordance with the discharge observe of Vue 3, all packages of the Vue ecosystem ought to totally assist Vue 3 by the tip of this 12 months. It’s a great motive to imagine that very quickly we’re going to listen to in regards to the launch of Vuex 4. After which, the entire ecosystem will likely be good to go!

Increasingly more of the favored Vue packages, libraries and instruments (together with packages with ready-made graphical elements) have gotten suitable with the brand new model of Vue. Sadly, the introduction of a brand new means of mounting elements in a Vue software made older variations (e.g. these with graphical elements) incompatible with Vue 3. Fortunately, their authors are working onerous to make mandatory changes. Quickly, the overwhelming majority of libraries ought to assist Vue 3 with none hiccups!

Vue new options – conclusions

In my humble opinion, Vue 3 might within the nearest future make a distinction on this planet of frontend frameworks and grow to be a extremely sturdy various for React relating to selecting a expertise to your app.

As we will learn within the “State of Frontend” by TSH, Vue.js is a really trending frontend framework. It was 2nd on the listing of frameworks that respondents wish to write with, use or study sooner or later. The report makes it clear that React nonetheless is the “King of frontend”, however I believe that Vue is really turning into a worthy competitor for React and much more devs are going to make use of it sooner or later.

Vue can be an excellent various for newbie builders, as a result of it has a low entry stage and gentler studying curve relative to React. You’ll be able to rise up to hurry with growing a Vue app actually rapidly. I believe that the Vue 3 launch helps it so much due to the introduction of the composition API and out-of-the-box assist for utilizing TypeScript along with your app, which is utilized by over 75% respondents of the “State of Frontend” report.

If you wish to study Vue now, I actually counsel you begin studying from Vue 3, as a result of there aren’t numerous breaking adjustments in Vue 3. and the best way it really works with third get together libraries can be the identical. On the identical time, it’s turning into clear that that is the way forward for how Vue internet apps will likely be developed. In my view, studying in regards to the new options launched on this Vue js newest model now will make your future work with Vue a lot simpler.

See additionally: New Node options

The submit New Vue js options – Vue 3+ overview first appeared on .



Source link

Tags: featuresOverviewVue
Previous Post

Chance The Rapper Opens Up About Co-Parenting After Divorce

Next Post

LinkedIn Expands Newsletter Access, Teases Premium SMB Package

Related Posts

NFT Aggregator Marketplace Development: Complete Overview
Softwares

NFT Aggregator Marketplace Development: Complete Overview

by admin
August 15, 2025
How agile is your crypto? Interview study explores opportunities and challenges of cryptographic update processes
Softwares

How agile is your crypto? Interview study explores opportunities and challenges of cryptographic update processes

by admin
August 12, 2025
20+ Best Free Futuristic Fonts in 2025 — Speckyboy
Softwares

20+ Best Free Futuristic Fonts in 2025 — Speckyboy

by admin
August 13, 2025
This week in AI dev tools: GPT-5, Claude Opus 4.1, and more (August 8, 2025)
Softwares

This week in AI dev tools: GPT-5, Claude Opus 4.1, and more (August 8, 2025)

by admin
August 9, 2025
How Agentic AI Powers Webkul eCommerce Marketplaces
Softwares

How Agentic AI Powers Webkul eCommerce Marketplaces

by admin
August 11, 2025
Next Post
LinkedIn Enables Users to Add Secondary Names for ID Verification

LinkedIn Expands Newsletter Access, Teases Premium SMB Package

Queen Elizabeth’s Press Secretary Tells Prince Harry To ‘Stop Being The Victim’ In Brutally Honest Doc!

Queen Elizabeth's Press Secretary Tells Prince Harry To 'Stop Being The Victim' In Brutally Honest Doc!

  • Trending
  • Comments
  • Latest
More than 400 Canadian artists sign letter denouncing ‘anti-trans’ policies

More than 400 Canadian artists sign letter denouncing ‘anti-trans’ policies

April 1, 2024
Taylor Swift’s ‘Eras Tour’ movie: How and when you can stream in Canada – National

Taylor Swift’s ‘Eras Tour’ movie: How and when you can stream in Canada – National

November 27, 2023
Jacklyn Zeman, longtime ‘General Hospital’ actor, dies at 70 – National

Jacklyn Zeman, longtime ‘General Hospital’ actor, dies at 70 – National

May 11, 2023
Greyson Chance says Ellen DeGeneres ‘abandoned’ him, calls her ‘manipulative’ and ‘opportunistic’ – National

Greyson Chance says Ellen DeGeneres ‘abandoned’ him, calls her ‘manipulative’ and ‘opportunistic’ – National

September 26, 2022
Robert De Niro shows up to troll Donald Trump outside hush-money trial – National

Robert De Niro shows up to troll Donald Trump outside hush-money trial – National

May 29, 2024
Anne Heche to be taken off life support after compatible organ recipient found – National

Anne Heche to be taken off life support after compatible organ recipient found – National

August 15, 2022
Mike ‘The Situation’ Sorrentino saves 2-year-old son from choking in home video – National

Mike ‘The Situation’ Sorrentino saves 2-year-old son from choking in home video – National

February 5, 2024
‘Nope’ movie review: Jordan Peele does it again in masterful spectacle – National

‘Nope’ movie review: Jordan Peele does it again in masterful spectacle – National

July 22, 2022
‘Stranger Things’ Creators are Jumping Ship to Paramount

‘Stranger Things’ Creators are Jumping Ship to Paramount

August 16, 2025
Celebs Whose Kids Don’t Know They’re Famous

Celebs Whose Kids Don’t Know They’re Famous

August 16, 2025
25 Classic Movies That Got Bad Reviews From Critics

25 Classic Movies That Got Bad Reviews From Critics

August 16, 2025
Hip-Hop’s Biggest First-Week Sales for Projects in 2025

Hip-Hop’s Biggest First-Week Sales for Projects in 2025

August 15, 2025
HyperX’s claims its latest headset lasts 250 hours on a single charge

HyperX’s claims its latest headset lasts 250 hours on a single charge

August 15, 2025
5 Albums I Can’t Live Without: Steve Jones of the Sex Pistols

5 Albums I Can’t Live Without: Steve Jones of the Sex Pistols

August 16, 2025
Kate Middleton, Prince William Rare Message Amid Summer Break

Kate Middleton, Prince William Rare Message Amid Summer Break

August 15, 2025
9 Wardrobe Hacks For Men

9 Wardrobe Hacks For Men

August 16, 2025
New Self New Life

Your source for entertainment news, celebrities, celebrity news, and Music, Cinema, Digital Lifestyle and Social Media and More !

Categories

  • Celebrity
  • Cinema
  • Devices
  • Digital Lifestyle
  • Entertainment
  • Music
  • Social Media
  • Softwares
  • Uncategorized

Recent Posts

  • ‘Stranger Things’ Creators are Jumping Ship to Paramount
  • Celebs Whose Kids Don’t Know They’re Famous
  • 25 Classic Movies That Got Bad Reviews From Critics
  • Home
  • Disclaimer
  • DMCA
  • Privacy Policy
  • Cookie Privacy Policy
  • Terms and Conditions
  • Contact us

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites. slotsfree  creator solana token

No Result
View All Result
  • Home
  • Entertainment
  • Celebrity
  • Cinema
  • Music
  • Digital Lifestyle
  • Social Media
  • Softwares
  • Devices

Copyright © 2021 New Self New Life.
New Self New Life is not responsible for the content of external sites.

New Self New Life