DEV Community

VInicius Schuelter
VInicius Schuelter

Posted on

Angular Primitives extending the power of Angular Signals

Image description
Hey guys, it's a pleasure to be here for the first time, today my goal is to talk a little about angular and who knows how to invite the whole community. As we all know, in May angular v16 was released with several new features, one in particular generated a lot of controversy in the community as we can see in the RFC itself. Angular Signals despite a theoretically simple idea, which would be a wrapper around a simple value that registers what depends on that value and notifies those dependents whenever its value changes(check it out), has been scaring part of the community who feel this new feature could affect the declarative way (FRP) we code around RxJs.

Image description

I've been working with Angular for more than five years and RxJs have always provided me the necessary comfort to work, I just love coding with support from all the pipes and operators of RxJs to help me. In my opinion, RxJs will still continue to be a protagonist in Angular development and that Angular Signals came only to help compose this ecosystem.

Anyway, I'm here to talk about Angular Signals and the possible uses for this new feature. In my opinion, the best way to validate the power of Angular Signals is inevitably to use it as much as possible. Thinking about it, I see that a good starting point for us is to base ourselves on communities that are already familiar with the Signal Pattern, in particular, I will highlight here the Solid.js community that has been using this pattern to create new derivative primitives.

That's it, we can create new Primitives derived from Angular Signals according to our needs.

Image description

Well, since the climax of the post has been reached, here's the invitation

I invite the entire Angular community to make Angular Primitives a reality

For this, we will need an initial collective effort, mainly focused on the definitions of how the flow of Contributions and Requests will be. We have a lot of work to do and many issues to create, I count on the collaboration of the entire community to make this work.

Image description

The kickoff was given, I took the liberty of creating a repository Angular Primitives, so we could start this idea. In addition, I created the first primitive (which must be approved by the community) "fromVisibilityObserver", which is a simple boolean signal that shows whether an HTML element is in the observed intersection or not. Below is the stackblitz for testing:


Code link, Package link

I'll be honored to help with whatever it takes, the time has come to "get your hands dirty", let's do this. At first I created some RFCs so that we can all participate, I'll leave the link below:

RFC - General ideas and suggestion
RFC - Planned Primitives definition
RFC - Primitives Names definition
RFC - Contribution Process definition

Image description

Thank you all for making it this far, I sincerely hope the idea appealed to you, or at least the GIF's made you smile. Anyway, jokes aside, I'm looking forward to building this together, have a great week!

Discord Chat
Contact me
Follow me
Link me

Top comments (0)