Angular v7 under the microscope: What’s changed and what’s next

Share
  • October 31, 2018

AngularJAXenter: Today we are talking about Angular v7 and what has changed since we last talked when Angular v6 was released. What’s interesting about Angular v7?

Manfred Steyer: Angular v7 is a very stable transition, something that has been requested very often in the past. I would say that the biggest change is that the latest version of TypeScript is supported: We have support for TypeScript 3.1, which is officially a breaking change because it means we have to exchange a dependency.

The update is also very simple since the CLI has the ng update command. You run it once, it does rattle a bit and you are already on the latest version. Besides that, there are some bug fixes and smaller features, which are quite nice, but nothing really ground-breaking.

JAXenter: You just mentioned the CLI, which was introduced in Angular v6. What’s your impression of it? 

Manfred Steyer: I would say that the CLI continues to dramatically lower the entry hurdle when it comes to working with Angular. Plus, by now it is also possible to automate tedious, monotonous and repetitive work by using the CLI. There is a code generator called Schematics included under the hood for this and this code generator does not only generate a basic framework, but it also generates a boilerplate for the libraries you include. This means that if a library supports schematics, you can simply add the library with ng add, another new command, and everything will be generated automatically, which would otherwise have to be done step by step by hand using a README file. Also, the CLI can now prompt the user to get further information about the code to generate.

The biggest change in Angular v7 is that the latest version of TypeScript is supported.

JAXenter: This does sound practical! Another new and exciting feature is the Ivy Renderer. What do you think about this one?

Manfred Steyer: To give you a small example: Imagine that you want to use Angular Material. With Angular CLI, you can just use ng add with the name of Material and it will be installed, the style sheets will be inserted. Furthermore, the corresponding modules are imported into your main Angular module. It’s really great to finally get rid of all that annoying tasks.

I think that Ivy Renderer is the biggest innovation since Angular entered the market and I also really dare to use the “innovation” in this case. The word is often used very thoughtlessly, but by definition, innovation is something which goes three times faster or works three times better or something that wasn’t possible before. And that is actually true when we talk about Ivy Renderer.

The best part about it is the fact that it is not a breaking change. The compiler is simply replaced in the background. Then the regular Angular application compiles better. To compile better means that Angular – I say it quite casually – brushes itself away when Angular is compiled down. This means that in the end, the code you get with Ivy is very close to vanilla JS code, to DOM code that looks as if you wrote it by hand instead of using Angular. So you have the best of both worlds! You have the comfort of the framework, but also the lightweight of a solution that you would have optimized and written by hand.

JAXenter: But if that’s not a breaking change, it’s clear that it doesn’t have to be released with a new major version.

Manfred Steyer: Exactly, that’s why it probably comes with 7.x. It’s really important for the Angular team to avoid breaking changes. The current project status is 93%, which I looked up today, measured by the tasks that are open and closed, but the last steps are the hardest, as you will probably know from your own projects. What’s going on now is basically that the people from Google are testing Ivy on some of their 600 Angular projects, gaining some experience, and making sure that there won’t be any breaking changes for the rest of us.

SEE ALSO: Angular 7 has arrived: An overview of all new features

JAXenter: Is there any kind of practical experience already, maybe with the preliminary version of Ivy, which has been available so far?

Manfred Steyer: You can certainly try it. It’s very well hidden though, and in my experience, when the Angular team hides a feature or has some great features at hand without talking about them, they have a good reason for that. So, they really want to hold back Ivy right now and wait until all the breaking changes are eliminated.

But if you want to experiment a little bit with it – I wouldn’t use it in production – then just take a look at the flags you have, when you create a new project with CLI. Just call ng new –help, then there’s a whole lot of flags and there you’ll find a new flag, like –experimental-ivy. If you use this, then you have a project based on Ivy.

JAXenter: What we keep reading about Ivy is that the Angular team is trying to move closer towards React. How would you comment on this?

Manfred Steyer: I think that it combines the best of both worlds. The power of the framework which we have before the compiling, and a very narrow code base, which we have after the compiling. This code base is quite similar to React when you take a look at what a React component actually looks like. It’s just a class with some metadata in it and so on. Something very similar comes out at the end of the compiling.

JAXenter: So there are many changes to Angular. What does this mean for the framework world in general: Which framework should you choose for what kind of project; how can you decide which one is the best choice?

Manfred Steyer: That’s a good question. Considering the “change” part: From our point of view it doesn’t change much, just the resulting code is much more compact. So Angular manages to move from its traditional area, namely large business applications, to other areas as well, where you only need lightweight components. They have already ventured in these areas before for a little bit, with server-side rendering.

The Angular team really wants to hold back Ivy right now and wait until all the breaking changes are eliminated.

Now it continues with the fact that Ivy also supports Web Components stores. Then I have a very narrow web component which has been compiled down to the bare essentials with Ivy and can be reused with all possible frameworks.

JAXenter: How about the selection of frameworks? How can you know which framework is right for your project?

Manfred Steyer: As an Angular person, my position is clear: Always use Angular. Because Angular is not only the best solution, but it also makes you look slender and attractive – nonsense! I’m not a big fan of these framework wars and in my opinion, nowadays it almost doesn’t matter which framework you use, as long as you use one which has some presence on the market. I’d look at soft criteria, such as who stands behind the framework? Is he depended on whether the framework lives or not and how does the community look like?

Angular is in a good spot in this regard, with over 600 applications by Google. Probably other frameworks are also well positioned. I’d say that if you get used to it, you’ll reach your goal with all frameworks. In this respect, I don’t really understand the framework wars. The truth is that the framework selection depends on personal taste.

What I like about Angular, for example, is that it provides a complete business package for applications. I’ve got everything in there: From the components, which others might provide too, to the sophisticated solutions for HTTP access, to the internationalization and management of forms at different levels with different strategies.

SEE ALSO: Angular v7 is here but 7.1.0 is already breathing down its neck

JAXenter: Well, then let’s close with the same question I asked you half a year ago – what else would you like Angular to have in the future?

Manfred Steyer: What do I wish from Angular? Good question! I think that Ivy fulfills a lot of wishes because through Ivy we also move towards this lightweight solutions. Thus we will again be covering use cases, which were covered by AngularJS – the lightweight. What I’m really looking forward to is the new internationalization solution, that is bundled with Ivy. It goes hand in hand with the Ivy compiler, where you can exchange language texts at the last second.

That’s something I’m looking forward to. We already have an official solution for this at the moment, but many people are still switching to an unofficial solution because the official one still has a few limitations, which will then be blown up with Ivy and the new internationalization.

JAXenter: That’s an exciting aspect to look forward to! Thank you for the interview!

The post Angular v7 under the microscope: What’s changed and what’s next appeared first on JAXenter.

Source : JAXenter