Google Engineer on the Future of Angular

Google says that they are working on features such as more support for full standalones and better treeshaking in Angular’s next release.

Google’s new Angular version is released in November, with a feature that will allow developers to identify errors, who can also use the latest tools to optimize images and get the site up faster.

Twersky presented on Angular at this month’s Progress 360 conference in Boston, Mass. The talk mostly focused on what’s new with Angular and how recent updates helped prepare for the new changes Google will bring to the next version of Angular.

Google engineer explains what’s next for Angular

Angular is a rapidly evolving framework, and version 14 was released recently. Much of this work was for the purpose of laying a strong foundation for future improvements. One upcoming improvement is Ivy: Angular’s next-generation compilation and rendering pipeline, which took over from View Engine as the default with version 9.

Twersky seemed to have mixed thoughts about Project Ivy–it was something that took a lot of time for Twersky and his team to work on, but was also announced prematurely. Twersky questions how long it will take before the public is aware of the new release.

The new engine gave Angular better type checking, error reporting, debugging, smaller bundle sizes. It also enabled future improvements Google has planned. With Ivy complete, Google saw a 90% reduction on computational resources and this led to about 50 minutes of reduced build time for the largest Angular app at Google.

How the Angular revolution is continuing to grow

The Angular team rolled out requests for comments, which give developers a chance to offer feedback and also introduce experimental changes. In version 14 Google has begun rolling out developer previews, which lets developers try out new features before an update is live, aware that some changes may be reversed.

The Angular JS team is using content found on Stack Overflow to create a shared design document. This design doc will be battle tested against the millions of developers using Angular, and considered before any new content is introduced.

Google launches about 15 RFCs at a time, but two of them stand out the most. Some of these features include: -Standalone components which are modules that configure the injector and compiler, specifically for Angular.

Angular tool support has also been improved to provide better debugging, guidance on errors, and debugging with Angular dev tools.

Standalone Components

NG Modules are one more thing new developers have to learn about Angular, but it’s confusing because other programming languages use the term ‘modules’ to mean something else, Twersky said.

“Standalone is designed to simplify all of that and streamline the steps to getting started,” she said. “By introducing the standalone true flag, you can bootstrap your component directly and you don’t need a module.”

The idea is that an entire app can now be standalone, she said. It’s a major change, supported by new APIs Google created, she added; it also promised that any changes to the APIs would be backward compatible.

Angular Version 15: Reaping the Benefits

“Now we enter into phase three, which is the fruits of our hard work,” Twersky said. “This phase has yet to happen, frankly. Version 15 is scheduled for November, so this is very speculative and early preview. But the idea here is […] everything that we unlocked.”

Version 15 will see support for full standalones and support for that, she said.

“We have something that will benefit everyone, which is zone JS-enabled async stack taking by default, but we’re just calling it better stack traces,” she said. This is through another collaboration with Chrome and will make it easier to pare down to what’s relevant even when using open source code a developer didn’t write and where errors occur.

Version 15 also promises to make the router tree shakable, which basically removes unused code from the code base. In writing a standalone version of the router, the team was able to integrate a lot of things about the router module that are no longer needed, making it more tree shakable, she said. The new config API allows developers to tree shake major pieces of the router API, she said.

“What we want to do and what the Northstar is delivering [is] only what you need, at that end stage, and we got to tree shake a lot of the router away, so if you’re not using it, we’re no longer having to supply you with it. In Angular is this idea that we have a lot of code, but your apps don’t use all that code. And so at some point in compilation, we can get rid of a lot of the code that you’re not using.”

Other changes Google is considering:

  • Hiding CLI configs by default
  • MDC. MDC Web is a library created by the Google Material Design team that provides reusable primitives for building Material Design components. The Angular team is incorporating these primitives into Angular Material, according to their road map. “So if you use Angular Material, MDC is like the newest shiniest most accessible specs for that, that’s happening under the hood by default,” she said.
  • Request for comments around hydration and other development trends.

Recent Articles

Related Stories

Stay on op - Ge the daily news in your inbox