AngularJS
What is AngularJS?
Well, AngularJS is a popular JavaScript Frontend Framework for creating web application which was released by Google in
the year 2010. It became quite popular because of its rich features and
built-in functionality to create reactive and responsive web apps.
Problems with AngularJS
Then, around year 2012–14 frameworks like ember.js and react.js
(developed by Facebook) popped in with a better benchmark results and
performance, highlighting the AngularJS drawbacks to the developer
community.
Inception of the new Angular (Version 2)
Now,
the angular team decided to create a new framework instead of upgrading
AngularJS by incorporating all their hard learned lessons from
AngularJS. Hence, Angular 2 was released in Sept’ 2016 which is a
complete re-write of AngularJS.
Confusion because of names and versions
Now,
the team decided to go ahead with the same name except the ‘JS’ part.
So, the new angular is called as just angular and follows a semantic
version approach for versioning. According to it, a new major version of
angular will be released in every six months (upgraded version, not a
rewrite i.e. Angular version 2/4/5 are all same and should be referred
as ‘angular’ only). The current version is 5.
Adoption and Worldwide Response
Since
the new angular is a complete re-write, it demands you to re-write your
old AngularJS application from scratch using the new Angular (in case
you want to update your app as per the current angular). This is a huge
challenge for the companies. Also, the new angular has a bit steep
learning curve (PS, if follow proper structure, its not that hard as
people say). Besides these, angular is quite good in terms of
performance and provides you an end-to-end solution, from testing to hybrid-mobile-apps to animations. Also, the entire angular app development process is suitable for large teams and large projects.
Features of New Angular:
- Backward Compatibility: So, application written using Angular 2 will be compatible with Angular 4 as well.
2. TypeScript: The
version of TypeScript is upgraded from 1.8 to 2.1. This will improve
the speed of ngc (angular compiler) and you will get better type
checking throughout your application.
3. In-Built Compiler:
Angular 4 comes with the inbuilt compiler to report the template errors
right in the IDE. Google emphasizes improvements in tooling as well as
reduced code generation.
4. Reduction of Code:
They have made changes to AOT generated code such that you will find
reduction in the size of the generated code for the components by around
60% in most of the cases.
5. Animation Package: They
have segregated animation package from @angular/core as a separate and
dedication package. Therefore, if you don’t use animations, this extra
code will not end up in your production bundles.
6. Improved *ngIf and *ngFor: if/else style syntax has been introduced where you can assign local variables such as when unrolling an observable.
7. Flat ES Modules: Modules
are shipped as flattened version that helps in tree-shaking and reduce
the size of generated bundles. It also speeds up the building process,
transpilation and loading in the browser in certain scenarios.
Comments
Post a Comment