There’s an outsized number of front-end frameworks available today, each with different strengths and weaknesses. This makes it tricky to make a decision which one you ought to invest some time in learning, or which is best suited for your next project.
In this article, I’ll compare five of the foremost popular front-end JavaScript frameworks out there. I’ll offer a high-level overview of every , examining their main features, tooling, learning curve, and other pros and cons to require under consideration .
Of course, I won’t be ready to tell you which of them is that the best framework: that’s subjective, and depends on factors like your current level of JavaScript experience and what quite app you’re performing on . What i will be able to do, though, is quickly get you up to hurry with the most players and assist you make an informed decision about which framework you ought to start digging into more.
How Did I Measure Popularity?
Popularity decided by framework usage consistent with the State of JavaScript Survey 2020. The survey was completed by 23,765 respondents and saw the contenders pile up like this:
React: 80%
Angular: 56%
Vue.Js: 49%
Svelte: 15%
Preact : 13%
I’ve also taken under consideration “framework awareness” from an equivalent survey:
React: 100%
Angular: 100%
Vue.Js: 99%
Ember: 88%
Svelte: 86%
And I’ve cross-referenced these results with framework usage consistent with the Stack Overflow developer survey, 2020. This was completed by 65,000 respondents, and it just about corroborates the findings from the State of JavaScript — although, unfortunately, it doesn’t distinguish between front-end and back-end frameworks.
There are, of course, many other metrics one could draw upon, like job availability, GitHub stars, npm downloads, GitHub “Used by”, and so on. If you’d like an summary of a number of these (for the large three, at least), please consult this GitHub Gist.
For an interactive view of how the frameworks pile up against one another , you'll consult this graph from npmtrends.
How Are We Defining Front-end Framework?
The elephant within the room is that the foremost popular framework on the list (React) defines itself as a “library”.
I don’t want to travel too at heart this rabbit burrow , as there are complete articles dedicated to explaining the difference between frameworks and libraries. For the needs of this text , I’ll use the subsequent definition provided by Martin Fowler:
A library is actually a group of functions that you simply can call, lately usually organized into classes. Each call does some work and returns control to the client.
A framework embodies some abstract design, with more behavior inbuilt . so as to use it you would like to insert your behavior into various places within the framework either by subclassing or by plugging in your own classes. The framework’s code then calls your code at these points.
In my opinion, React conforms more to the behavior of a framework than a library. And while it technically isn’t one, developers normally adopt variety of tools and packages from its ecosystem to form it function intrinsically .
1. React
Initially released by Facebook in 2013, React is way and away the foremost popular front-end JavaScript framework available today. React is employed in production by companies like Facebook, Netflix and Airbnb, and it's an enormous developer following — meaning that it’s easy to seek out help and resources online.
The main purpose of React is to compose interactive user interfaces from reusable components. It uses JSX (a syntax extension to JavaScript) for templating, and implements a one-way data flow model to populate components with data. Whenever component data changes, React uses its virtual DOM to quickly and efficiently update the page.
Developer tooling is sweet . The React team has built and maintains a CLI (Create React App) to quickly and simply scaffold out a replacement project, also as a developer tools extension for both Chrome and Firefox. There are very many third-party packages available to accomplish a good array of tasks (such as routing, handling forms, and animation), also as several React-based frameworks, like Next.Js and Gatsby.
React subscribes to a “Learn once, write anywhere” philosophy. It can power mobile apps using React Native, and it can render on the server using Node. this suggests excellent SEO support, which can only recover as something called server components makes its way down the pipeline.
One of the most criticisms of React is that it's too unopinionated: it’s only concerned with the view layer of your application and leaves everything else to the developer. Some people just like the freedom this offers, but others — especially new developers — can become overwhelmed by the unstructured approach to coding a React app this encourages.
React features a moderate learning curve. It encourages the utilization of varied functional programming paradigms (such as immutability and pure functions), meaning that developers would had best to possess a basic grasp of those concepts before attempting to create anything serious.
If you’re comfortable with React’s unopinionated approach and therefore the incontrovertible fact that it leaves a large a part of the event process to the developer, then it’s a superb choice for data-driven apps of any size.
2. Angular
Angular is Google’s offering within the front-end framework space. It started life in 2010 as AngularJS (or Angular 1) and was an instantaneous hit, primarily because it had been the primary framework that enabled developers to create what we now ask as single-page applications.
To address performance concerns and therefore the challenges of building large-scale JavaScript applications, Google rewrote AngularJS from the bottom up and, in 2016, released Angular 2 (nowadays just Angular). There was no easy migration path between the 2 , and consequently AngularJS and Angular became two separate frameworks. AngularJS is now end-of-life and shouldn’t be used for brand spanking new projects.
As for Angular, it’s something of a heavyweight within the front-end framework world. It’s employed by companies like Google and Microsoft in production, so is certainly well battle tested. There also are many resources available online (such because the excellent Tour of Heroes tutorial) and there are an honest number of Angular-related questions on Stack Overflow.
Unlike React, which only handles the view layer, Angular offers an entire solution for building single-page client applications. Angular components can implement a two-way data binding, which allows them to concentrate for events and update values simultaneously between parent and child components. Templates are chunks of HTML that let the utilization of special syntax to leverage many of Angular’s features. TypeScript is that the primary language for Angular development, making the framework particularly suited to enterprise-grade applications.
Tooling is sweet . Angular offers a highly polished CLI to initialize, develop, scaffold, and maintain Angular applications. There also are Chrome and Firefox Dev Tools extensions available for debugging Angular applications. Out of the box, Angular features a solution for handling many common tasks, like forms and routing, but there’s still an upscale ecosystem of third-party libraries.
In my opinion, Angular has the steepest learning curve of all the frameworks listed here. Developers will got to be conversant in TypeScript, also as concepts like decorators and dependency injection, to be ready to work effectively with the framework. For this reason, it’s not an honest choice for brand spanking new developers. Rather, it lends itself more to putting together large-scale apps as a part of a team.
If you’d sort of a full rundown of the differences between React and Angular, please see “React vs Angular: An In-depth Comparison”.
3. Vue.Js
Please note that these stats are for Vue v2. Version 3 is out there , but has got to be installed as vue@next.
Third on our list is Vue.Js, a Model–view–viewmodel (MVVM) front-end framework used for building user interfaces and single-page applications. it had been written by Evan You and saw its first release in 2014. Vue features a very dedicated following of developers (it has more GitHub stars than React, for example), which is possibly thanks to the very fact that it slotted so nicely into the gap left by AngularJS when this was rewritten to become Angular.
Vue is developed and maintained by a core team of some twenty developers, and although it’s indirectly backed by one among the web giants, it’s utilized in production by companies like Alibaba, Gitlab and Adobe. Vue has arguably the simplest documentation of any of the frameworks on the list, and its forums are an excellent resource for getting help with coding issues. Vue is additionally popular within the PHP world and ships as a part of the Laravel framework.
One of Vue’s selling points is that it’s designed from the bottom up to be incrementally adoptable. this suggests that you simply can sprinkle Vue into regular sites to reinforce their functionality, otherwise you can go beat and use it to create a full-blown single-page app. Vue.Js uses an HTML-based template syntax which allows you to effortlessly bind attributes to the underlying data model. It also offers file components which keep template, JavaScript code and scoped CSS within the same file.
Tooling around Vue is great . There’s a politician CLI to scaffold and develop Vue apps, and there’s a devtools extension available for both Chrome and Firefox to assist in debugging. In sharp contrast to React, Vue offers official packages for routing and state management, which presents a pleasingly standardized way of doing things. There’s also a good range of third-party tools, also as frameworks based upon Vue, like Nuxt.Js and Gridsome (Vue’s answer to React’s Next.Js and Gatsby).
The barrier to entry for working with Vue is low, partly thanks to its incremental approach to putting together apps, and partly thanks to the very fact that it’s supported HTML, CSS and JavaScript — technologies that ought to be familiar to any developer.
Vue is a superb choice for apps of all sizes. It’s suitable for fewer experienced devs, also as people who prefer a touch more structure and guidance from their framework.

No comments:
Post a Comment