Episode 23/22: Signal Components, TypeScript 5.1
ng-news
Posted on June 8, 2023
Joshua Morony discusses Signal Components in Angular 17, highlighting benefits like fine-grained change detection and simplified input handling. TypeScript 5.1 is released, allowing the omission of return statements in functions returning undefined.
Signal Components with Joshua Morony
Joshua Morony, a highly regarded Angular YouTuber, recently released a video discussing Signal Components, a feature expected in Angular 17. These components serve a similar role for Signals as Standalone API does for Standalone Components, forming an integral part of the Signal story.
In his video, Joshua highlights four key benefits of Signal Components. Firstly, Signal components allow us to build applications without zone.js, enabling fine-grained change detection and reducing bundle size.
Furthermore, the new input function, replacing the @Input decorator, provides the value as a Signal, eliminating the need for NgOnChanges or RxJs patterns that rely on Subject for emitting input changes. Two-way binding also becomes more straightforward, as we can create a new value using a model function and immediately use it for two-way binding, removing the requirement for separate Input and Output properties. Additionally, traditional queries for ViewChild or ContentChild can be replaced with regular function calls.
Joshua's explanation makes it clear why many lifecycle hooks become boilerplate code when using Signal components.
TypeScript 5.1
TypeScript 5.1 has been released. The release model of TypeScript doesn't follow the schematic versioning where a major version comes with breaking changes and a minor one adds new features. In fact, given the quite TypeScript's crucial role, breaking changes are avoided at all costs.
Notably, TypeScript 5.1 introduces the ability to omit return statements in functions returning undefined. Previously, omitting return statements were only possible in functions returning void. This change aligns TypeScript with JavaScript's behaviour, as JavaScript always returns undefined during runtime.
Other changes were more in the area of JSX. So this release is more interesting for React developers rather than for us.
Minor Releases
We had new minor releases such as Nx 16.3, an alternative to Angular.
And a CSS dinosaur, namely Bootstrap, was released in version 5.3.
Posted on June 8, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.