Get in Touch

What changes make Angular 4 different from its Predecessor?

blog image

Google surprised everyone when they announced the launch of Angular 4 instead of Angular 3. Angular 4 was announced on March 2017 when they jumped to version 4 from version 2 ignoring Angular 3. This step was taken to avoid confusion due to the misalignment of router package version which was already available on the market. Google has also promised to release the next version i.e., Angular 5 by October 2017, yeah, you heard it right and version 5 is scheduled to release by next month.

There are many mind blowing features in Angular 4 and the main among them is that they support backwards compatibility feature. This meant that Angular 2 things will be compatible with Angular 4 and runs perfectly saving a lot of time in juggling between 2 frameworks due to their compatibility issues. Another important fix was, they replaced Typescript 1.8 with advanced 2.1 and 2.2 Typescript.

The main reason behind the release of Angular 4 was to add new features and some tweaks to enhance old capabilities:

  • Angular Universal

Universal, a community driven project was taken over by an Angular team and together the Angular, as well as the Universal team, did a lot of research on internal and external work for months before release. With this feature, JavaScript is no longer required for rendering the page content allowing the website to optimize for better search engines. @angular/platform-server contains the majority of these codes. You can also go to Rob Wormald’s Demo Repository for learning more about Angular Universal.

  • Animation package

Animation has been taken out of @angular/core and added to their own packages, which means that even when you don’t use animation this extra load won’t be in your production bundles. As a result, documentation can be easily found and can take the advantage of auto completion. Animation can also be added to main NgModule by importing Browser Animation Module from @angular/platform-browser/animations. This function allows making the modification for the existing application if they have any animations.

  • Faster and Smaller

When compared with their previous versions, the programs in Angular 4 need much lesser space and run faster than the latter. According to reports, the team behind this improvement are working vigorously and Angular 5 will be having similar features with greater outputs.

  • Source Maps for Templates

Meaningful texts are automatically created if there is any error caused from the templates with the help of source maps.

  • Typescript 2.1 and 2.2 Compatibility

 Angular team has updated to 2.1 and 2.2 from existing version 1.8 for improving the speed of ngc Compiler and better type security of the angular application.

  • View Engine

The AOT generated codes were modified by the development team. They reduced the size by 60% of the generated codes for the components making major improvements on mobile applications. The codes are reduced higher if the templates are more complex. This feature made many developers switch to Angular 4 as they saved the production bundles with hundreds of kilobytes. Garbage data was also reduced significantly due to this and performance was also improved.

Some of the necessary adjustments to be taken for making the existing Angular 2 project work with Angular 4 are:

  • Dependencies Update
  • Changing Lifecycle Events
  • Renaming Template Tags
  • Use of Animation
  • Access to Renderer

Google officials have confirmed that the upcoming versions won’t be having such drastic change like Angular 4. They even made a statement that they want a fine balance between stability and update. The next version i.e. Angular 5 will be available in October, Angular 6 in March 2018. Every major update will be released in a time period of 6 months but in between, there will be some bug fixes and minor releases. There are some commendable works done by google in which, the features marked as “deprecated” will be discarded from the next release, giving developers a time period of six months to change if they wanted to update to next major version.

The future of Angular looks promising and this platform has the potentials to do great things. Angular 4 will be a bit confusing for amateurs but for experienced developers, it would be very helpful and easy to use. Google is thinking of releasing a tool for the public which is currently used for automated code migration in house. This development shows how Angular has grown into a professional and mature framework which can be utilized by agile and small teams as in large organization. It would be a great pleasure to see how the upcoming versions are going to manifest in the current ecosystem.

Add new comment

Related Blogs

Get in Touch