There are three frameworks for building any web application that every frontend developers knows about:- React, Vue and angular.
React is an UI library, Angular is a fully fledged front end framework, while Vue is a progressive framework.
Each framework is component based and allows to create UI features rapidly.
They all have different structures and architectures, so let's have a look at their differences:-
React:-
React is not strictly a framework because it can be used as a UI library to render elements, without enforcing a specific project structure.
React doesn't enforce a specific project structure, to understand this, let's have a look in it's simple coding:-
ReactDOM.renderC
<h1> Hello, world! </h1>
document.get Element By Id C'
);
Its elements are the smallest building blocks of react applications. They are more powerful than DOM because ReactDOM often updates its efficiency whenever something changes.
It is based on JavaScript but it is mostly combined with JSX, i.e, JavaScript XML, a syntax extension that allows to create elements that contain HTML and JavaScript at the same time.
Whatever we create with JSX could also be created with the React JavaScript API, but most developers prefer JSX as it is more convenient.
Vue:-
It is a core library that focuses on the view layer only. It is called progressive framework because its functionality can be extended with official and third-party packages, such as Vue Router or Vuex, to turn it into an actual framework.
Although vue is not strictly based on MVVM, i.e, Model-View-View-Model pattern. Its design was somehow inspired by it. With vue, the working is mostly done on View Model Layer, to ensure that the application data is processed in a way that allows the framework to render an up-to-date view.
Components in vue are small, self-contained and can be reused throughout the application. Single file components (SFCs) with the .vue extension contain HTML, CSS, JavaScript so that all relevant code resides in one file. SFCs are mostly recommended to organize code in vue projects.
Angular:-
Angular is the original framework based on MVC,i.e, Model View Controller framework. Structure of the projects in angular are Modules, Components and Services.
Each angular application contains atleast one root component and one root module. Angular templates are written in HTML but can also include Angular template syntax with special directives to output reactive data and render multiple elements, among other things.
Services in angular are used by components to delegate business logic tasks such as fetching data or validating output. They are a distinct part of angular applications. While angular doesn't enforce their use, it's highly suggested to structure apps as a set of distinct services that can be reused. Angular is built in TypeScript, so its use is recommended to get the most seamless experience, but plain JavaScript is also supported.
Comments
Post a Comment