The popularity of front-end frameworks keeps growing every year. And nowadays one can hardly imagine the process of front-end development without any of the JavaScript frameworks. Since recently, there was a tough opposition between two major players: Google-released Angular and Facebook?s React.js. Though, in 2018 a significant change happened in the world of front-end, as one more strong player joined the competition ? Vue.js.
As we have already discussed Angular and React in our previous article, let?s have a look at Vue.js and estimate its chances to take the place of one of the front-end behemoths ? React.
Background
Before we start digging deeper, let?s outline some general information about two frameworks.
Being developed and maintained by a tech giant Facebook to target its needs, React has been a major player in the front-end arena for a long time, guaranteeing stability and long-term support.
Vue.js was created by a former Google employee, Evan You, whose aim was to develop a framework that would integrate the best features from already-existing frameworks.
Core differences
To stay unbiased, I would suggest starting looking at the differences between React and Vue.js in Vue.js documentation(which is quite good and addresses the topic quite well). It was written by Evan You in cooperation with Dan Abramov(from the React team).
Both Vue and React use virtual DOM(each of them has different implementation though).
The main difference between Vue.js and React is that Vue.js uses templates with declarative rendering while React uses JSX, which is a pretty much a JS extension that allows using HTML within it. That means React requires more complex implementations for even simple tasks(comparing to Vue.js or even Angular), at the very end one needs more time to develop a complex component too.
Here is a simple login implementation example for Vue:
Same for React:
At the same time, Vue.js is more high-level and has a much lower entry point as Vue.js does not require one to deeply understand JS Core to perform.
Both React and Vue.js are suitable for small and mid-sized projects.
Popularity
React has been a leader in popularity among JavaScript frameworks. It takes the first place with the number of 48,718 dependents, whereas, Vue.js is the second most popular JavaScript framework with half as many dependents ? 21,575, as reported by Node Package Manager. Though, if we take a look at statistics at the end of 2018, we will see that Vue?s dependents had tripled, while React?s had doubled.
The number of downloads also shows the increasing popularity of React, while Vue almost doesn?t change positions.
Stack Overflow gives the following data based on the number of questions asked by the developers currently working within the particular platform:
Though we can see that the number of questions about Vue.js is going up, it?s doubtless that React is still on the top spot of the podium.
According to the fourth edition of JavaScript Rising Stars that estimates the number of stars added on Github during each year, Vue has taken the first place in 2019.
This statistics is quite confusing as it doesn?t correspond to any aforementioned numbers. Maybe the Vue community is just obsessed with GitHub stars.
Community support
Relying on the Github statistics, we can make a conclusion about how popular Vue.js is among its open source community, even without the support from a top-level corporate.
Facebook engineers are continuously working on React maintenance and coding, improving it and investing in it which makes React the most rapidly growing tool in the developers? world.
Flexibility and learning curve
One of the biggest advantages of React is flexibility. As React is not a full-fledged framework but a library, it?s also quite easy to learn. Instead of working in a set pattern, a developer can add any library according to their preferences. MobX and Redux are also widely used by developers while working with React to support state management tasks.
Vue.js is also flexible and has no restrictions on how to build your application. It also offers official support for a variety of build systems, moreover, the learning process won?t take much time: acquaintance with such basics as HTML and ES5 JavaScript are the only basics you need to get started.
Framework size
The size of the framework is a crucial criterion that directly influences the productivity of projects, the smaller the framework is, the better it is for a project. If to round off the size of frameworks, React is around 100 Kb whereas Vue.js is around 80 Kb. Both of them have a relatively small size which makes them convenient for the development of small applications.
Use cases
When choosing a technology for a project, it?s also vital to know where this technology has been already used.
React.js app development:
Vue.js app development:
- Gitlab
- 9Gag
- Nintendo
- Grammarly
To sum up, React is currently more popular than Vue. It has a strong and influential mentor that improves and maintains it, while Vue doesn?t. Vue.js and React.js provide high flexibility, easy learning curve, and both are small in size.
So, is Vue going to take over React? Not in 2020, definitely but feel free to ping inVerita in case you have tough times deciding what is best for your product.
Originally published at inveritasoft.com on February 27, 2020