Vue.JS Review: Can It Beat React.JS?

JetRuby Agency
JetRuby Agency
Published in
5 min readAug 24, 2017

Vue.JS is a simple, flexible, and fast JavaScript framework that allows you to develop interactive web applications with very little effort. But that’s not the only reason why everybody is so hyped up by Vue.JS. In addition to being fast, Vue.JS boasts some of the best features absorbed from other frameworks and libraries like React.JS, Angular.JS, Ember.JS, etc.

One of the coolest things Vue.JS has borrowed is the idea of using virtual DOM. In simple words, virtual DOM is a lightweight copy of DOM, which allows you to manipulate objects without having to draw them on the screen. Every time you render an element, every single virtual DOM object is updated. When you update the virtual DOM, React compares it with its previous version. Doing that allows React to see exactly which virtual DOM objects have been changed. Finally, React updates only those objects on the real DOM.

Same as React’s core, the core of Vue.JS includes only basic features. Such compactness makes it easy to integrate Vue.JS with other libraries and frameworks including jQuery. But there is more! The creators of the Vue.JS have also borrowed several things from Angular.JS, including two-way data binding.

Vue.JS provides you with a set of plugin modules, allowing for a better approach to web development. For example, almost every React.JS application is created using Redux, a framework that controls states of JavaScript apps. The creators of Vue.JS came up with their own way of controlling states and called it Vuex. In a nutshell, it’s very similar to Redux. However, Vuex can boast a much deeper level of integration with Vue.JS compared to Redux and React.JS. This results in a better performance and overall convenience.

Ok, so Vue.JS is fast and easy to use. However, does Vue.JS offer the same number of perks as React.JS? Well, given that the framework was created not long ago, the answer to this question is “no”. But that’s only for now. Vue.JS is becoming more and more popular every day, which means the community support also grows in proportion.

Vue.JS example

The idea of giving Vue.JS a try had been lingering in our mind for quite some time. We knew that Vue.JS offered some very cool perks. But that was on paper. So eventually our team decided to find out if the framework is really that good in practice.

In one of our recent projects, we needed to implement an interface with a map, some filtering features, and a few interaction elements, with all of them having to be placed on the same page. Using Vanilla JavaScript or jQuery wasn’t an option since either of them could eventually turn into a challenge. Why didn’t we use React.JS? The task was to develop a simple interface, so there was absolutely no reason to use some heavy framework.

Overall, the idea of trying Vue.JS had been lingering in our minds for quite some time. On paper, Vue.JS offers some very cool perks. So eventually our team decided to give the framework a try.

Below is an example of Vue.JS app initialization.

In app.js, we created the “app” variable as a Vue.JS object. What happens here is that the constructor analyzes template.haml and does all required bindings.Thanks to Vue.JS being a very declarative framework, we were able integrate it into a monolithic web application.

In this piece of code, the class ‘‘rentbuy__filters — open’ is either deleted or added to the element depending on the ‘filtersOpen’ flag.

Two-way data binding in Vue.JS allowed us to bind elements of the filter fields with the fields of a single object. This resulted in selection options being always up-to-date. In addition, it simplified the procedures of validation and filter resetting.

Here, the values of the input fields are being bound to the fields of the “data” object with the help of two-way data binding. The object field changes every time the value in the input field is changed.

Using simple predicates defined in the template allowed us to quickly switch between sets of fields. Below you can see that the box containing the input field becomes available when the condition is met.

Thanks to virtual DOM, the components aren’t drawn every time something changes. We leveraged that when implementing the feature to output the list of results. For users, this means more comfortable and fast website experience.

The elements of the array “properties” are rendered in the Vue.JS component “proposal”. The set of elements on the page changes automatically, according to the changes in the array. The “proposal” component is a common HTML template, the code of which is enclosed in the “script” tag of the “text/x-template” type.

Ultimately, Vue.JS allowed us to develop the interface without much effort and within deadlines. The code of the application is now very compact and easy-to-extend.

Advantages of Vue.JS

After using this framework for a while, we can outline the following advantages:

  • The library of Vue.JS is simple and versatile. You don’t need much experience to come to grips with it.
  • Vue.JS can be used in any project since it doesn’t depend from other technologies.
  • The framework is very lightweight, which benefits many things like page load time, conversion, UX, SEO, etc.
  • Vue.JS is all about fast development. It not only comes with comprehensive documentation, but also allows you to use any template engines.
  • Short learning curve of Vu.JS makes it really easy to work with the framework. Any developer who is even slightly familiar with frontend development can start using Vue.JS.

Disadvantages of Vue.JS (compared to React.JS)

  • In Vue.JS, all operations on application state are hidden from a developer. When it comes to large-scale projects, this often leads to confusion as to how things exactly work, which makes debugging a more complicated procedure and slows down the overall development process.
  • The component approach in Vue.js is not as flexible and obvious.
  • In terms of rendering, Vue.JS definitely lags behind React.JS.
  • Templating could be more flexible (JS vs DSL).

Vue.JS review: conclusion

Apart from the fact that Vue.JS has accumulated some of the best web development approaches, it’s also an incredibly versatile, highly integrable, and easy-to-learn framework. Vue.JS allows you to create fully-featured applications that meet all modern standards without actually spending much resources. Another thing we like about Vue.JS is that it allows you to track the lifecycle of a component. You can apply any methods to a component after it’s been initialized and attached to the DOM tree.

The architecture of a Vue.JS application provides a simple and clear separation of methods, components, and data. It makes your code easier to read and extend. Moreover, it allows you to integrate third-party technologies directly into the methods of the application. Of course, in terms of creating complex interfaces (e.g. corporate websites) React.JS will be a better choice. Other than that, using Vue is not just justified, but preferred.

Surely, when it comes to developing complex interfaces (e.g. corporate websites), React.JS will be a better choice. Other than that, using Vue is not only justified, but preferred.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Published in JetRuby Agency

We believe sharing knowledge pushes the industry forward and creates communication bridges. Our technical expertise includes Agritech, Healthcare, and many more.

Written by JetRuby Agency

JetRuby is a Digital Agency that doesn’t stop moving. We expound on subjects as varied as developing a mobile app and through to disruptive technologies.

Responses (1)

What are your thoughts?