Angular 2 is now officially released! This is an exciting time to be an Angular 2 developer. Not only do you have a brand new front-end framework but also an entire platform all created specifically for you to put your next application together. Google invested a serious amount of time and effort into putting together the Angular 2 Framework. With over 25+ employees and over 320+ contributors, Angular 2 is a new tool to keep in mind for your next project.
The making of Angular 2 was not an easy path, ever since Angular 1 showed up 6 years ago, the web-application landscape has never been the same. You might be wondering why in the world did they just not improve Angular 1 and keep that going? The web is constantly changing and the more demands that users have on the web the more tools that you have to create to meet that demand. The main purpose of Angular 2 was a simple one SPEED to achieve this, it could not be done in the old code base, The Angular 2 team had to build Angular 2 from scratch using TypeScript.
Before you jump right into Angular 2 code, you might want to take some time and reflect on why you need Angular 2 in the first place. You have a wide range of options for choosing a frontend framework, why go with Angular? The big takeaway for me was typings! You might not think that’s not that important. If the application you are building expands more than a couple of thousands of lines of code you will run into some problems that JavaScript has. The first and most obvious one, no wide support for all ES6 and ES7 features, TypeScript takes care of this with transpiling down to ES5 code but still allowing you to write modern ES7 Code.
Here are three concepts you need to be aware of before you get started with Angular 2.
#1 Dealing with loss (Denial, Anger, Bargaining, Depression, Acceptance)
You might experience each of these emotions or only a couple of them whichever it might be, take the time to reflect and see how you feel about the loss of losing Angular 1. Coming to grasp with a loss can take some serious time so please prepare to spend some time dealing with any pent up emotions now.
Denial: if you are here, I want you to think of 5 reasons why you no longer need to use Angular 1?
- __________
- __________
- __________
- __________
- __________
Anger: Is an emotion that feeds anger towards yourself or others. The best way that I found to work out through this part is to go take a long walk get some exercise and really feel that anger in the process. This will help you relieve that emotion.
- Go out for a 30-minute walk or 30-minute exercise session
Bargaining: what are you talking about my Angular 1 skill still work! No need to learn ES6 and Angular 2. My skills are solid, no need to transpile anything. I’m happy, no need to learn anything new. If this is you, you’re going to have to break out of this pattern and stop bargaining with yourself and really commit to mastering the new changes that are happing with Angular 2. Take the time and answer the following questions.
- How is having the skill of ES5/Angular 1 skills benefiting you?
- What are the pain points of not learning ES6 and Angular 2?
- Are you willing to learn ES6 and Angular 2? If so how will this benefit you?
Depression: I was stuck here for a really long time, I got familiar enough with ES6 and Angular 2, but kept using ES5 and Angular 1 even though I was more than capable of writing Angular 2 code. You can call this depressing code if you are here like I was. My recommendation is just to work through it. Give the following a try
- Slowly write all new code in ES6
- Learn TypeScript
- Convert an Angular 1 project to Angular 2
Acceptance: Here is the thing, I can tell you that Angular 1 is the only loss that you will experience and nothing like this will ever happen again. This would be a lie though because Angular 2 is the current NOW and the future surely awaits, even more, changes.
#2 TypeScript
You will need to learn to use TypeScript, this isn’t the standard JavaScript code that you might be used to writing, TypeScript is very much the same as ES7+ extra features that are included right out of the box. Here are some of my favorite features of TypeScript.
- ES5, ES6 and ES7 support
- Typings!
- IDE Support (Code completion)
- Quick Edit
- Quick Jump
- Quick Find Definition
- Syntactic coloring and indentation
- Error reporting
- Project level configuration
The list goes on you will have to give it a try and see how you like it.
#3 Webpack
Wepack is a beast of an application, it provides you with many functionality that can be overwhelming when you first start to learn about it. The main idea here is Hot Module Replacement, this provides you the functionality of swapping out modules that I have not seen in any other bundler before. Webpack is great for module replacement and for automating some of the build process that was typically done with Gulp or Grunt. All of this tools are now going away and Webpack is taking the lead on how to accomplish this.
Right now as you read this blog post, you have the opportunity to take advantage of all the amazing things that are about to happen. It’s your job to figure out how you want to get involved, imagine going back to 2010 when Angular 1 was released, what amazing things would you have built? Here is your golden opportunity to create the next generation of tools and applications.
Will you step up and take that step?
Talk to you soon,
Rick Hernandez.
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More