Webii Introduction To Javascript Framework Lesson004
Webii Introduction To Javascript Framework Lesson004
Angular
Angular is a framework designed to help developers create modern applications
with complex requirements in simple ways.
Angular offers a zip download but the easiest way is to clone angular from Git and
install it with npm.
Angular also offer a quick start seed for beginners which includes a playground to
ease the user into learning the architecture.
If the user were to use Angular in a professional environment, generating a project
through the Angular command line tool would be preferable.
Installing the quick start seed is as simple as the following four commands
Vue
Vue.js was designed to be a lightweight framework focused on the view part of an
application that could be integrated into the system incrementally. 1 Vue.js is
similar to React more so than Angular because of this.
Vue.js has gained traction the past years because of its ability to be powerful while
staying lightweight and simple. No need to learn typescript or JSX, plain
JavaScript is all you need.
Vue provides either a downloadable version or a CDN that the user can include
easy and fast in their index file.
$ npm install --global vue-cli
$ vue init webpack my-project
1
$ cd my-project
$ npm install
$ npm run dev
Here is how the folder should look like, we can see the simplicity in the src/ folder
with only an App.vue file and a HelloWorld.vue component.
Vue does not force you to use any JavaScript extensions or the like when writing
code. Vue supports JSX and even typescript but it is in no way required to use
when utilizing Vue. This makes development in Vue familiar due to the basic
knowledge needed to create something. It also makes it easier for already existing
projects to implement Vue in its ecosystem without having to write additional code
to accommodate.
React
React is a JavaScript framework designed to allow users to build user interfaces
capable of handling data with speed, efficiency and scalability. The applications
created are dynamically loaded without having to refresh the page.
Compared to other JavaScript frameworks, React does not adhere to the MVC
(model- view controller) pattern. Instead, React is focused on the view in MVC.
The core purpose is to create reusable interface components to enhance and help
create powerful views, much like directives in Angular.
The “Create React App” is the fastest and easiest way to get right into developing
applications. The create-react-app is basically a module used to create react
projects without having to configure build options like babel and webpack. If the
user is starting from scratch, the Create React App is the best way to go. Node.js
and npm is a requirement.
Four commands is all it takes to get started
The more troublesome way of installing React is when trying to implement React
into an already existing project. This is a process which requires a package
manager like npm to install React, a bundler to optimize the apps performance and
a compiler to enable JSX and ES6 features in your project.
React uses an extension to JavaScript called JSX. With JSX, users can define
react elements for rendering to the scene with a syntax similar to html.
React elements function the same as a regular JavaScript objects. They work
similar when used in conjunction with conditional statements and loops which
means being able to be returned, used as an argument and assigned to a variable.
using React with JSX provides an easier experience and learning curve to the
framework. Programmers with JavaScript backgrounds will have no problem to
get into React and its syntax. The fact that JSX is optional and can be expressed in
regular JavaScript and newer ES6 features as well makes the framework attractive
to all kinds of developers.