Angular 4 Released Reply

Rick HerrmannLast week, Google released the newest version of their Angular framework, Angular 4.0. The biggest changes seem to be around creating smaller builds and faster code. Our Solutions Group has several Angular 2 applications in production that we have already upgraded to Angular 4, and I am happy to report that the upgrade was smooth in each case.

If you are wondering if upgrading to Angular 4 is a good idea, I have put together a list of potential questions to help you decide.

What’s different about Angular 4?

As I mentioned, it is smaller and faster. But there are a variety of other changes you may find useful

  1. if…else syntax in HTML templates
  2. Separate animation module
  3. Angular Universal is now part of @angular/core
  4. Supports the latest version of Typescript

Why should I upgrade?

In most cases, your Angular 2 code should run fine with Angular 4, so there is little risk in upgrading your projects. As far as the amount of time it takes, each project we have upgraded took less than an hour to complete. The basic steps to upgrading are as follows:

  1. Update all of the @angular/xxx references in your package.json to use version ^4.0.0
  2. Delete the node_modules folder
  3. Run npm install (or yarn if you are using that)
  4. Test your app

Another reason to upgrade is that if you are using the angular-cli (which also hit version 1.0 last week), new cli-generated projects are using Angular 4.

Why did the version jump from 2 to 4?

At some point during the development of Angular 2, the router moved to version 3. Moving to Angular 4 was the solution to bring the router and the rest of the libraries back to the same major version.

Conclusion

Every project is different and you have to weigh the risks against the benefits, but I think for most projects it will make sense to upgrade to Angular 4.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s