ElementRef may soon become a thing of the past. The State of JavaScript survey has published its findings. TypeScript 5.5 introduces inferred type predicates, and there's a proposal on the table to distinguish between business and rendering effects.
Proposal: DOM Interaction
A fresh RFC put forward by the Angular team suggests swapping out ElementRef for a new type called DomRef. Currently, ElementRef wraps the native DOM element, and it's a critical dependency for UI libraries that need direct DOM access.
Jeremy Elbourn argues that this change is essential to unlock more advanced hydration methods, such as streaming or partial hydration.
The community's initial response to the RFC has been somewhat cautious.
https://github.com/angular/angular/discussions/56498
State of JavaScript 2023
The State of JavaScript survey, which gathered responses from roughly 24,000 developers, has now published its results. In usage numbers, Vue has climbed past Angular into second place. Meanwhile, Angular's share in the interest category grew from 20% up to 23%.
Liquid error: internal
TypeScript 5.5
TypeScript 5.5 is now out, and it will be included in Angular 18.1.
One of the key additions is inferred type predicates. When you have a function that checks a type and returns a boolean based on that check, TypeScript will automatically treat it as a type predicate. As a result, running that function on a union type will cause TypeScript to narrow the union according to your function's logic.
Beyond that, the release brings improved regular expression validation and enhanced type support when accessing object properties dynamically.
Business vs. Rendering Effects
When working with effects, the typical intention is to manage which Signals the effect function is watching. In real-world application development, it would be sensible to specify those Signals directly.
Alex Rickabaugh, who leads Angular's framework team, noted on GitHub that the effect was originally designed for Rendering Effects, where implicit tracking is the right approach. For Business Effects, however, explicit tracking would be more suitable.
At this point, Angular Core doesn't have the support needed to handle this distinction.
https://github.com/angular/angular/issues/56155#issuecomment-2177202036
