Thursday, May 13, 2021

The 3 Most Popular Front-end Frameworks Compared

 






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.

Using the .Net Core Template Engine to Create Custom Templates and Projects

 






Key Takeaways

  • The .NET CLI includes a template engine, which can create new projects and project items directly from the command line. This is the “dotnet new” command.
  • The default set of templates covers the essential project and file types you need for default console and ASP.NET-based apps, and test projects.
  • Custom templates can create more interesting or bespoke projects and project items, and can be distributed and installed from NuGet packages or directly from the file system.
  • Custom templates can be very simple or much more complex, with substitution variables, command-line parameters and conditional inclusion of files or even lines of code.
  • Maintenance and testing of custom templates is easy, even with conditional code, by making sure a project template is always a runnable project.
  • This article is part of our .NET educational series which explores the benefits of the technology and how it can help not only traditional .NET developers but all technologists that need to bring robust, performant and economical solutions to market.

    With the release of .NET Core 3.0, Microsoft has the next major version of the general purpose, modular, cross-platform and open source platform that was initially released in 2016. .NET Core was initially created to allow for the next generation of ASP.NET solutions but now drives and is the basis for many other scenarios including IoT, cloud and next generation mobile solutions. Version 3 adds a number of oft-requested features such as support for WinForms, WPF and Entity Framework 6.

    The tooling story changed dramatically with .NET Core, because of its serious emphasis on the command line. This is a great fit for .NET Core's cross-platform, tooling-agnostic image. The dotnet CLI is the entry point to all of this goodness, and it contains many different commands for creating, editing, building, and packaging .NET Core projects. Here, we’ll focus on just one aspect of the dotnet CLI — the dotnet new command.

    This command is mainly used to create projects, and you can often create a simple boilerplate project and then forget about it. We’ll look at how to get the most out of this command, by passing arguments to modify the generated projects, and seeing how we can use the command to create files as well as projects. We'll also see that this tool is a full-fledged template engine, and can be used to install custom templates, as well as make personal templates.

    dotnet new in action

    So how do you use dotnet new? Let's start at the beginning and work up to the most interesting stuff. To create a simple console application, start up the command line, change directory to a new empty folder (an important step, explained below), and call dotnet new console:

    > dotnet new console The template "Console Application" was created successfully. Processing post-creation actions... Running 'dotnet restore' on /Users/matt/demo/MyNewApp/MyNewApp.csproj... Restoring packages for /Users/matt/demo/MyNewApp/MyNewApp.csproj... Generating MSBuild file /Users/matt/demo/MyNewApp/obj/MyNewApp.csproj.nuget.g.props. Generating MSBuild file /Users/matt/demo/MyNewApp/obj/MyNewApp.csproj.nuget.g.targets. Restore completed in 234.92 ms for /Users/matt/demo/MyNewApp/MyNewApp.csproj. Restore succeeded.

    As I mentioned before, make sure you're in a new, empty folder first. By default, dotnet new will create files in the current folder and will not delete anything that's already there. You can make it create a new folder by using the --output option. For example, you could create a project in a new folder called ConsoleApp42 by typing:

    > dotnet new console --output ConsoleApp42 The template "Console Application" was created successfully. Processing post-creation actions... Running 'dotnet restore' on ConsoleApp42/ConsoleApp42.csproj... Restoring packages for /Users/matt/demo/ConsoleApp42/ConsoleApp42.csproj... Generating MSBuild file /Users/matt/demo/ConsoleApp42/obj/ConsoleApp42.csproj.nuget.g.props. Generating MSBuild file /Users/matt/demo/ConsoleApp42/obj/ConsoleApp42.csproj.nuget.g.targets. Restore completed in 309.99 ms for /Users/matt/demo/ConsoleApp42/ConsoleApp42.csproj. Restore succeeded. Looking at what you’ve created

    At this point, dotnet new has created a new console project and restored NuGet packages — it's all ready to run. But let's take a look at what's been created:

    > ls ConsoleApp42/ ConsoleApp42.csproj Program.cs obj/

    As you can see, you now have a project file based on the name of the output folder. If you wish, you could use the --name parameter to specify a different name:

    dotnet new console --output ConsoleApp42 --name MyNewApp

    This would create the project files in a folder called ConsoleApp42, and would use MyNewApp as the name of the console application being created — you'd get MyNewApp.csproj. If you take a look at Program.cs, you'll also see that the name parameter is used to update the namespace:

    using System; namespace ConsoleApp42 { class Program { static void Main(string[] args) { Console.WriteLine("Hello World!"); } } } Prepping for another project

    But, if you take a look at the folder structure of the project you've just created, you might spot  something missing — there's no solution file. You've only got a single project, and while this works fine with dotnet run, it will cause problems when you want to add another project. You can easily create one:

    dotnet new sln

    This will create a new, empty solution file. Then, it’s another step to add a project to it.If you created your solution in our demo's root folder, it would look like:

    dotnet sln add ConsoleApp42/MyApp.sln

    You can also use the dotnet sln command to remove or list projects in a solution. If you want to add or remove references to a project, you need to use the dotnet add command. I suggest reading Jeremy Miller's article on the extensible dotnet CLI for more details, or type dotnet help sln or dotnet help add.

    Adding another project is very easy also, but you must do it in this two-step fashion — create, then add. For example, you could add a test project to your solution:

    dotnet new nunit --output Tests --name MyAppTests dotnet sln add Tests/MyAppTests.csproj Adding new files to a project

    Adding new files to a project is even easier, mostly thanks to the improvements .NET Core made to MSBuild files. You no longer need to explicitly list C# files in the .csproj file, because they're automatically picked up through wildcards. You just need to create a file in the folder and it will automatically become part of the project. You can create the file manually, but you can also use dotnet new to provide a template file. For example, you could add a test file to your test project using the nunit-test item template:

    dotnet new nunit-test --output Tests --name MyNewTests

    Speaking of templates, how do you know what templates are available? How can you tell the difference between a project template and an item template? That's a job for dotnet new --list, which outputs a list of available templates:

    Templates Short Name Language Tags Console Application console [C#], F#, VB Common/Console Class library classlib [C#], F#, VB Common/Library Unit Test Project mstest  [C#], F#, VB Test/MSTest NUnit 3 Test Project nunit [C#], F#, VB Test/NUnit NUnit 3 Test Item nunit-test [C#], F#, VB Test/NUnit xUnit Test Project xunit [C#], F#, VB Test/xUnit Razor Page page [C#] Web/ASP.NET MVC ViewImports viewimports [C#] Web/ASP.NET MVC ViewStart viewstart [C#] Web/ASP.NET ASP.NET Core Empty web [C#], F# Web/Empty ASP.NET Core Web App (Model-View-Controller) mvc [C#], F# Web/MVC ASP.NET Core Web App razor [C#] Web/MVC/Razor Pages ASP.NET Core with Angular angular [C#] Web/MVC/SPA ASP.NET Core with React.js react [C#] Web/MVC/SPA ASP.NET Core with React.js and Redux reactredux [C#] Web/MVC/SPA Razor Class Library razorclasslib [C#] Web/Razor/Library/Razor Class Library ASP.NET Core Web API webapi [C#], F# Web/WebAPI global.json file globaljson   Config NuGet Config nugetconfig   Config Web Config webconfig   Config Solution File sln   Solution

    This lists all templates. You can use the --type parameter to filter this down, using --type project, --type item, or --type other. Project templates will create a project, item templates create a single file, while other is really only useful for the sln template to create a solution file.

    The short name (2nd column above) in this list is the name you use in the call to dotnet new (e.g. dotnet new console, dotnet new classlib, dotnet new mvc, etc). Some templates support multiple languages, with the default shown in square brackets (spoiler — it's always C#). You can choose a different language with the --language option, but be careful of the # symbol! Some command-line shells treat this as a comment character and parsing can fail with --language F#. This can be handled by quoting the value - "--language F#".

    Finally, each template has one or more tags. These are a way of classifying templates, but aren't currently used as part of the command-line tooling. However, they could be used for grouping or filtering by other hosts. Yes, that's right, the dotnet new template engine can be used in other hosts, such as IDEs. More on that later.

    Customising templates

    So far, we've just looked at a very simple Hello World console app, and added some tests. Let's take a look at something more interesting. Say you want to create a new ASP.NET project. Looking at the list of templates above, you have a few choices. You could create an empty web project, an MVC project, a project with Angular, or one with React.js. But these are fairly rigid templates. Can you customise these at all? The good news — yes, you can.

    Templates can take in parameters that change what's being generated. The -- help command will provide details on the parameters this template understands. Let's start with a simple example:

    > dotnet new classlib --help Class library (C#) Author: Microsoft Description: A project for creating a class library that targets .NET Standard or .NET Core Options: -f|--framework The target framework for the project. netcoreapp2.1 - Target netcoreapp2.1 netstandard2.0 - Target netstandard2.0 Default: netstandard2.0 --no-restore If specified, skips the automatic restore of the project on create. bool - Optional Default: false / (*) true * Indicates the value used if the switch is provided without a value.

    Here you can see that the classlib template has two parameters: --framework to specify what target framework is written to the project file; and --no-restore, to control if NuGet restore is performed when the project is created.

    dotnet new classlib --framework netcoreapp2.1 --no-restore

    The web templates have similar parameters, but there are many more of them than we have space to list here. Try dotnet new mvc --help to get an idea of what's available. There are parameters to decide what type of authentication you want, whether to disable HTTPS or not, whether to use LocalDB instead of SQLite, and so on. Each of these parameters changes how the template code is generated, either replacing content in files or including/excluding files as appropriate.

    While we're talking about help, here are two very useful commands: dotnet help new, which opens a web page on the dotnet new command itself; and dotnet new {template} –help, which shows help for the named template and its parameters.

    Adding customised templates

    The real power of the dotnet new command is the ability to add new, custom templates. Even better, templates can be distributed and shared, simply by packing them into a NuGet package and uploading to nuget.org. This makes it very easy to get started with a framework, or automate the boilerplate of creating new projects or project items.

    To add a new custom template, use the dotnet new --install {template} command, passing in either the name of a NuGet package, or a file folder for a local template. But how do you find new templates?

    One way is to search for the framework you're using and see if templates are available, but that's a bit hit and miss. Fortunately, you can instead visit dotnetnew.azurewebsites.net and search for templates by keywords. There are over 500 templates tracked on the site, which makes it a good discovery resource.

    For example, you could install a set of templates for AWS Lambda projects with dotnet new  --install Amazon.Lambda.Templates. One very nice feature of installing templates via NuGet packages is that each package can contain more than one template. This AWS Lambda package contains 28 different templates, including a tutorial project.

    Of course, if you no longer want to use the template, simply uninstall it with dotnet new  --uninstall {package}. The name passed here is the name of the installed template package, and if you're not sure of the  name, simply run dotnet new --uninstall to get a list.

    Creating your own templates

    You can also create your own custom templates. These don't have to be for popular frameworks, but might be for internal or personal projects. Essentially, if you often find yourself creating a specific folder structure, set of references, or boilerplate files, consider creating project or item templates. Project templates are simply plain text files, including the .csproj files — there's no requirement that the generated templates are .NET Core specific, and they can be made to target any framework.

    It’s very easy to create a new template and they are surprisingly easy to maintain. Traditionally, templates that can perform text substitution use a special syntax, like $VARIABLE$ markers that will be replaced when the template is evaluated. Unfortunately, this is usually invalid syntax for the file type, which makes it impossible to run the project to test that the template is correct. This leads to bugs and slow iteration times, and basically, a bit of a maintenance headache.

    Fortunately, the designers of the template engine have thought about this, and come up with a much nicer way of working: running templates.

    The idea is simple — the template is just plain text files. No special formats, no special markers. So, a C# file is always a valid C# file. If a template wishes to substitute some text, such as replacing a C# namespace for one that's based on the project name, this is handled with simple search and replace. For example, imagine we had a template that looked like this:

    namespace RootNamespace { public static class Main { // ... } }

    The template's JSON configuration defines a symbol that will replace the namespace. The symbol value would be based on the project name, possibly with a built-in transform applied to make sure it only contains valid characters. The symbol would also define the text it was replacing — "RootNamespace." When the template engine processes each file, if it sees "RootNamespace," it will replace it with the symbol value.

    This simple search and replace is usually based on a symbol that is based on a parameter, such as the template name, the output name, or an actual custom parameter. But, it's also possible to create symbols based on generators, to create GUIDs, random numbers, or the current timestamp, and so on.

    But no template is complete without conditional code — something that's added or removed based on a parameter. How does dotnet new handle this and keep "running templates" as an option? This is actually handled on a per-file-type basis, with some default config built in, and the ability to define your own style for unknown file formats. Essentially, the idea is to use the file-specific pre-processor (such as #if for C# or C++) for those file types that support it, and specially formatted comments for those that don't, such as JSON.

    ```cs public class HomeController : Controller { public IActionResult Index() => View(); public IActionResult About() { ViewData["Message"] = "Your application description page."; return View(); } #if (EnableContactPage) public IActionResult Contact() { ViewData["Message"] = "Your contact page."; return View(); } #endif public IActionResult Error() => View(); } ```

    All of the metadata for a template lives in a template.json file. This includes the template's short name, description, author, tags, and supported language. Because a template can only target a single language, it also includes a "group identity" option, which multiple templates can specify, one for each language. The metadata file can also include optional information about source and target of files to be copied or renamed, conditional file copies, substitution symbols, command-line parameters and post-creation actions such a package restore. But by default, the template engine will copy and process all files in the template’s file structure.

    { "author": "Matt Ellis", "classifications": [ "Hello world" ], "name": "Hello world template", "identity": "Matt.HelloWorldTemplate.CSharp", "shortName": "helloworld", "guids": [ "d23e3131-49a0-4930-9870-695e3569f8e6" ], "sourceName": "MyTemplate" }

    The template.json file must be placed at the root of the template's folder structure, in a folder called .template.config. The rest of the folder structure is entirely up to you — the template engine will keep the same folder structure when evaluating the template. In other words, if you add a README.md file to the root of your template's folder structure, then the template engine will create a README.md in the root of the output folder when you call dotnet new. So, if you use --output MyApp, you will get a file called MyApp/README.md.

    > tree -a . ├── .template.config │ └── template.json ├── MyTemplate.csproj ├── Program.cs └── Properties └── AssemblyInfo.cs

    2 directories, 4 files

    To install and test your template, simply call dotnet new --install {template} as you would to install a custom template, but this time, pass in the path to the root of the template folder structure. To uninstall, use dotnet new --uninstall {template}. Again, if you're not sure of what to pass, use `dotnet new --uninstall` to get a full list.

    Distributing your templates

    Once you're ready to distribute your template, you can pack it into a NuGet package and upload to nuget.org. You'll need to create a .nuspec file as normal, but with two slight tweaks: add a packageType element and set the name attribute to "Template," then make sure  the template folder structure is copied into a folder called "content"

    <package> <metadata> <id>MattDemo.HelloWorldTemplate</id> <version>1.0</version> <authors>Matt Ellis</authors> <description>Hello World template</description> <packageTypes> <packageType name="Template" /> </packageTypes> </metadata> <files> <file src=".template.config/template.json" target="content/.template.config" /> <file src="MyTemplate.csproj" target="content/" /> <file src="Program.cs" target="content/" /> <file src="Properties/*" target="content/Properties/" /> </files> </package>

    Additionally, it's possible to include multiple templates in a single package — simply create multiple folders under "content" and add a .tempate.config/template.json for each template.

    There are many more options and capabilities in the template.json file, but covering them all is beyond the scope of this article. But, based on all we’ve covered here, you can see that the template engine is very powerful, flexible, and yet fairly straightforward to use. Please check out the Microsoft docs site as well as the wiki for the dotnet/templating GitHub site.

    The Template Engine

    One of the most interesting things about dotnet new is that it’s designed to be used from multiple hosts. The dotnet new CLI tool is simply one host — the template engine itself can be used as an API from other applications. This is great for those of us who prefer to work with an IDE instead of the command line, but still want to be able to easily add custom project templates, something that isn't always easy with an IDE.

    We can see this in action in JetBrains Rider. The New Project dialog is powered by the template engine APIs, listing all the available templates, even custom templates. When the user wishes to create a project, the template engine is used to generate the files.

    Angular vs. Vue vs. React: A Comprehensive Guide



     The pandemic has made several companies go digital, which gives rise to one of the most important questions about which is the best out of the top three frameworks for building web applications that every front-end developer has heard about: Angular which is a TypeScript-based open-source web application framework, Vue.js which is a progressive JavaScript framework, and finally React which is an open-source, front end, JavaScript library. This article will help you with comparison to choosing the right JS framework

    Although either of them can be used alternatively to build front-end applications, they’re not completely the same, and each has strengths and weaknesses on different grounds. To understand the differences and the requirement that the developer needs to fulfill, a comparison needs to be done.

    Moreover, all of the frameworks have similarities that it is component-based and allows the rapid creation of UI features, they all have a different structure and architecture.

    Architecture

    Projects in Angular are mostly structured into Modules, Components, and Services where each one of the applications has at least one root component and one root module. Each component in Angular consists of a Template, a Class that defines the application logic, and MetaData (Decorators). Angular is built using TypeScript, so its use is recommended to get the smoothest experience, but plain JavaScript can also be used.

    On the other hand, React has the same architecture as Vue, i.e. interaction with DOM. It doesn’t enforce an architecture pattern and its code can be done in just a few lines to build complex user interfaces. It can be used as a UI library to render element that takes input data and returns what to display. React is based on JavaScript – A declarative, efficient, and flexible JavaScript library. The interesting part with react is, its all components may hold a state, which is not mandatory and can keeps on changing from time to time, depending on the action taken by your user. Thus can track the data for making the application work.

    The final comparison is with Vue.js is a library for powerful and interactive web interfaces. Vue.js is focused on the ViewModel layer of the MVVM pattern. It’s known as a progressive framework, which means this framework allows you to create any app structure that you want. This can’t be done in Angular. Vue.js uses DOM-based templating where each Vue instance is connected with a corresponding DOM element.

    Popularity

    Angular mainly used in enterprise projects, and according to BuildWith’s data, it powers over 97,000 websites. Among all the three frameworks, Angular has the least stars in GitHub with 68k when compared with the other two. According to BuiltWith, Vue is used by over 1 million websites. It’s a very strong, independent project developed and led by an ex-Googler Evan You in the open-source community. Leading with the most stars on GitHub, Vue comes with 176k stars.

    Finally, the most used based on BuildWith’s usage statistics, React powers over 2 million websites. Developed and maintained by Facebook, it is also used in many of their projects. Running on the second position is React, one of the most popular JavaScript projects with 160k stars on GitHub.

    Performance

    According to the results of JS Framework Benchmark, although each of them performed quite well, there are some differences. In the case of selecting rows, Vue is considerably slower than Angular and React. But at the same time, Angular and React are considerably inefficient at swapping rows. In most cases, the differences in rendering benchmarks won’t produce noticeable results. React and Vue are powerful in memory and booting time but Angular is a bit slower. It has slower performance than React and Vue due to the many features of this framework that makes the heavier application and slower performance.

    The 3 Most Popular Front-end Frameworks Compared

      There’s an outsized number of front-end frameworks available today, each with different strengths and weaknesses. This makes it tricky to ...