I used Angular's signals to build an actual app

  Рет қаралды 40,524

Joshua Morony

Joshua Morony

Күн бұрын

My modern Angular course: angularstart.com/
I refactored one of my existing Angular applications that relied heavily on RxJS and observables, to signals. This made me change my opinion on what I think is the likely fate of RxJS integration in Angular.
Source code (signals): github.com/joshuamorony/quick...
Source code (observables): github.com/joshuamorony/ionic...
Previous signals video: • Angular is about to ge...
Get weekly content and tips exclusive to my newsletter: mobirony.ck.page/4a331b9076
Learn Angular with Ionic: ionicstart.com
#angular #rxjs #signals
0:00 Introduction
0:31 The application
0:56 What makes it declarative?
1:42 Refactoring to signals
4:06 What about RxJS?
7:03 Conclusion
- More tutorials: eliteionic.com
- Follow me on Twitter: / joshuamorony

Пікірлер: 130
@JoshuaMorony
@JoshuaMorony 11 ай бұрын
Join my mailing list for more exclusive content and access to the archive of my private tips of the week: mobirony.ck.page/4a331b9076
@ktech4246
@ktech4246 Жыл бұрын
I just want to say thank you for making the effort on these videos especially Angular signals. Most videos on Angular Signals is just some dude doing a twitch feed, which is hard/frustrating to follow. You have taken the effort to curate a script and give clear concise discussion on the topic which does take time and effort to so thank you!
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
I think this video is really great. Makes me wanna do videos about angular myself. It compressed all of the important topics of signals (that are relevant at this stage for angular) quite nicely together. I think it just could go a little bit more into the ease of use of signals compared to rxjs. With signals it is a lot less likely to get yourself into a hard to debug mess (especially if there are devtools to visualize the reactive graph like soon available in solidjs). It is always possible to visualize the reactive graph in two dimensions (in your mind or on a whiteboard or even with devtools) because unlike with rxjs the reactive graph itself never has to deal with async stuff.
@kkarssing
@kkarssing Ай бұрын
Signals have actually helped me to get a better understanding of rxjs
@lionardo
@lionardo Жыл бұрын
I agree 80% of rxjs I really use is listening to some observable and update variable states. Happy to see that this will be simplified.
@EER0000
@EER0000 Жыл бұрын
Interesting video, thanks! I think signals may have quite an impact on our business frontend, although by now I am mostly used to RxJS already ;)
@alan614
@alan614 Жыл бұрын
Great hot takes!!!!
@santosharakere
@santosharakere Жыл бұрын
Nice video, thanks.
@nevaknowmanamesame5089
@nevaknowmanamesame5089 Жыл бұрын
What I like about signals is that it seems that all of a sudden multiple frameworks started to adopt this. Vue had something that feels like signals since Composition API came out. Preact, SolidJS, Angular. All of them have singals. I think it is a good thing. Most of RxJS code that I saw was overly complex and unasked for, to be honest. Yes, it is a powerful tool, but it seems to me that it was used like a golden hammer.
@luxiansheng2268
@luxiansheng2268 Жыл бұрын
vue was started with signal like,
@enriqueruiz320
@enriqueruiz320 Жыл бұрын
Excelente... seguiré usando RxJs 😉
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
The biggest advantage of signals is probably the easy and intuitive mental model. The mental model can be much simlper compared to what it actually does (performant glitch free updates are actually not that easy). In rxjs the mental model is more complex and therefor a lot more confusing for unexperienced devs (for everything else than really simple cases it can even grow to a huge leap if it should be glitch free). If we can get control over the scheduling in signals (for the pull phase) it could replace even more usecases of rxjs. You could think of it as batching. But even then it will still work with a really intuitive mental model. And for everything else we will have a really good way to fall back to rxjs...
@ferlezcano
@ferlezcano Жыл бұрын
Excellent content as always! I've learned a lot about RxJs with your videos and started to implement it in my projects... I don't see using Signals until I understand at least 74 % of RxJs
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Signals will be much simpler conceptually than RxJS, so prob makes sense to throw it into the mix right away when it's available (if you can)
@ferlezcano
@ferlezcano Жыл бұрын
​@@JoshuaMorony Thanks for your advice! I'll give it a try 💪
@brianmorgan5880
@brianmorgan5880 Жыл бұрын
To be a reactive programmer you need to change the way you approach problems. Although Signal's syntax is friendlier than RxJS. Signals will not make you a reactive programmer. The improved syntax will not be the epiphany that some hope it will. People will still struggle with Signals the same way they struggle with RxJS. To be a successful reactive programmer, you need to begin with the output(s) and work your way back to the input(s). Imperative programming is the other way around. In my opinion it should be the default way we think. It is probably a function of the way we were taught from childhood. That should change.
@hieudocong2209
@hieudocong2209 Жыл бұрын
i like your thoughts
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
I think the mental model for signals is a lot more intuitive while mostly keeping you from making common mistakes that can really easily happen in rxjs. As mentioned in the video it will be powerful enuoght for most usecases. And it is easy to fall back to rxjs for the rest.
@senor_m6673
@senor_m6673 Жыл бұрын
i think you are mostly right, but i would argue that there are some things that will be much more straightforward. and of course there are also the performance benefits and the potential to (altough probably not very soon) ditch zone.js altogether
@keep_coding
@keep_coding Жыл бұрын
Well said.
@Afdac247
@Afdac247 Жыл бұрын
signals make me feel like a beginner already, they look like react hooks, why the new stuff when we can just build on what we have, dozens of beautiful rxjs operators put to no use. Tbh even though I dont know them all I rather would like to one day then learn new library, learn new library. But tbh rxjs docs is not down to earth at all thats why no one can learn them. We need some down to earth rxjs docs tbh
@zoltanboros8963
@zoltanboros8963 Жыл бұрын
mutate is a nice feature. Thanks for showing.
@ShaharHarshuv
@ShaharHarshuv Жыл бұрын
Async stuff can actually be modeled to be sync if you have some value to model the "loading" state. So maybe it will be possible to use signals instead of observables for http as well
@Billiam112
@Billiam112 Жыл бұрын
I will never stop using RxJs. The enterprise application I'm architecturing is allin on declarative RxJs. Love it!
@rudolfmayer01
@rudolfmayer01 Жыл бұрын
Hi Josh, great video once again. Actually excited about being able to use signals and not having to explain RxJS to colleagues new to it. Idea: I am working on an Angular Library for work and I'm thinking of creating schematics for easier & faster use of the library. Schematics that would alleviate the boiler plate code-writing. Would you make a video on that with your knowledge?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Check out DecodedFrontend if you haven't already, probably already has a video on this and will do a better job/has better knowledge in that area than I do
@rudolfmayer01
@rudolfmayer01 Жыл бұрын
@@JoshuaMorony Thanks, will do!
@bvx89
@bvx89 Жыл бұрын
I'm currently creating a schematic for a library at work as well. Schematics are brilliant for reducing boiler plate, but I found the documentation of it quite lacking. I suggest you try to read some schematics from other open source projects to get a feel for what's available with the Angular libraries when creating schematics. I recommend the DecodedFrontend video as well, as that was a good starting point 👍
@nvahalik
@nvahalik Жыл бұрын
Signals sounds neat. For small stuff, it sounds like it could make a lot of sense. Especially how Angular is seemingly want to incentivize the creation of smaller components much more easily. That said, what RxJS has fundamentally changed for me and my team is that we now have a stream of information that you can literally follow through any component. You can trace the "source of truth" for a piece of data up to whatever source observable it is, whether it be a route param or the result of a service. That said, I think RxJS will still continue to do the "heavy lifting" on large pages because the flow of data will make more sense.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
This is what I like about RxJS too, but you can still get this same effect with signals by using computed - the only part you can't do with signals in this way is the situations where some kind of async process is involved (e.g. http), so it still makes sense to keep RxJS around - either converting to/from signals where required, or maybe starting your data in observables in your services etc. and then convert those to a signal at the component level.
@cztest153
@cztest153 Жыл бұрын
have you found any change in the bundle size after using the signals?
@sammunro710
@sammunro710 Жыл бұрын
I completely agree with you that it's beneficial not to require new developers to use RxJS. However, my personal opinion is that if you already know and are comfortable with RxJS and declarative programming, there's no need to mix and match it with signals. In my view, it's best to stick with RxJS for consistency in your architecture and design patterns. To support this argument, while signals are more straightforward, they offer fewer tools and are considerably less powerful than RxJS on the whole when considering all the operators. Additionally, signals do not natively support async operations as you mentioned. Personally, I have used RxJS from the beginning with Angular, and I found it relatively easy to learn. I think the complexity of RxJS comes from the fact that its native documentation may not be intuitive for most people, me included. In my experience, I have found tutorials to be a more helpful resource for learning and understanding how RxJS works, I think it's a language barrier more than anything in most cases.
@sebuzz17
@sebuzz17 Жыл бұрын
I guess Rxjs will still be a lot useful to deal with api calls and responses, but in other hand, signals will surely bring better performance and maybe ease the learning curve with state management in Angular apps.
@AlbertoBasalo
@AlbertoBasalo Жыл бұрын
Good video, as always, Josh. 👍🏼 I am trying to replace my RxJS Subjects with signals too. Specifically, I am working in an Exception signal that can be emitted from anywhere (ErrorHandlers and interceptors as preferred places), But I faced a problem when a Promise or any async timeout code throws an error. Then, even being watched and emitted, do not get rendered, just like when using OnPush without the pipe async.¿Do I need to use the cdr with signals?. Thanks.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I haven't got into this specific circumstance yet, but no you shouldn't need to use CDR, but also the current implementation of signals is a super early prototype and still relies on zone.js under the hood. At the moment I think the preview is more about just exposing the API to us - so it could be that there is some problem in the code you're using, or maybe it's just something unhandled/unimplemented in the signal API
@michaelcorleone1832
@michaelcorleone1832 Жыл бұрын
The problem with RXJS is that it is not being used in other JS frameworks. You can reuse your skill in this hard-to-learn library. I will use this is this is what Vue, React, Svelte developers are using.. In addition, Angular is not beginners friendly. Take note, I have tried other libraries in production.
@keep_coding
@keep_coding Жыл бұрын
What vue was offering is similar to signals for a long time. I would say it is not enough for good application development. Even a simple case like debouncing api calls while searching will get complex with signals compared to Rxjs. Rxjs has elegant solution for most cases. I don't want to deal with effects and write a lot of imperative logic :/
@sulaimantriarjo8097
@sulaimantriarjo8097 Жыл бұрын
Good video like always. Now, I wonder, shall I change behaviourSubject in service with signals too? 🤔
@JoshuaMorony
@JoshuaMorony Жыл бұрын
When signals are generally available, I think swapping BehaviorSubjects with signals will probably make sense for most people most of the time - but in some cases you might need more RxJS stuff, so might make sense to stay in "observable land" and convert to a signal closer to the template. I think signals by default is going to be a good idea though.
@AlainBoudard
@AlainBoudard Жыл бұрын
@@JoshuaMorony yeah my thought exactly, Signals seem to target the direct view update, not the overall app state.
@miroslavjakovcic4585
@miroslavjakovcic4585 5 ай бұрын
Regarding that 90% of situations that can be covered by Signals... what would be your recommendation on implementing signals in reactive forms? Form input fields are most common part of any angular application and I still didn't see any good implementation of angular reactive form (with custom validations) that would be supported by Signals.
@JoshuaMorony
@JoshuaMorony 5 ай бұрын
This is sort of cheating I guess because it uses my signalSlice utility but here's something I've been playing with (I have a video on it coming out in a week or two): github.com/joshuamorony/signal-slice-forms/blob/main/src/app/home/home.component.ts
@EarlWagner
@EarlWagner Жыл бұрын
When signals are released will you add a course on EliteIonic building something declaratively with NX and Signals?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I will probably slowly migrate all of my content on all of my platforms to use signals by default (with RxJS in places where needed still) - might take a little while though!
@g-luu
@g-luu Жыл бұрын
Great video as always. I am just a little bit on the fence now with signals cause i am not a fan of mutable work flows. Makes following code extremely difficult. Not sure how this is a step foward or perhaps i need to play around with them a little bit more.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
It doesn't need to be mutable - you can just not use "mutable" and the flow is more or less the same as RxJS (e.g. composing signals with computed, rather than composing observables with pipes). Still reactive/declarative in the same way RxJS is, just less power than RxJS has available.
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
@@JoshuaMorony I am not sure if it is really fair to say it signals have less power than rxjs. I think in terms of perf optimization and glitch prevention signals are much more powerful than rxjs. They just are not as powerful in some cases that rxjs shines. But as you said in the video it is it is not a replacement for rxjs. They are meant to really work together and make complement each other.
@aracon9721
@aracon9721 7 ай бұрын
6:53 hey, wehre did you get that picture of my brain?
@AlainBoudard
@AlainBoudard Жыл бұрын
Love your content Josh. Great take on this hot topic. I even watch you on holydays 😅
@jhadesdev9576
@jhadesdev9576 Жыл бұрын
I think this is awesome, that RxJs has become optional. This will benefit the vast majority of developers and projects. The few cases where RxJs is beneficial, like auto-completion search can be wrapped in a component library and used transparently. Is there a third-change detection mechanism to use signals, like default, OnPush? Or is it meant to be used at the same time as those? Does a whole component need to be declared a signal based, is there a way to tell Angular that a certain component only uses signals? Thank you for sharing.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
These implementation details have not been settled yet - maybe eventually signals become the default CD strategy, in the short term maybe we have a "Signal" CD strategy that we can define per component or something like that, but that remains to be seen!
@tinnick
@tinnick Жыл бұрын
@JHades Dev @Joshua Morony I’m both confused with this question and answer. Assuming we’re using OnPush strategy, I understood CD as something that it can be triggered. In many cases were they triggered by observables (for example when you use an async pipe in your template) but they didn’t have to be. You can also mutate a Component’s field with a @Input decorator or inject the ChangeDetectorRef in your constructor and then later trigger CD by calling detectChanges on a synchronous operation. My point is, the change detection lifecycle has nothing to do with weather you’re using observables, async/await or signals. But I’m here to learn and I’d like to know why that is not the case (if that is true)
@JoshuaMorony
@JoshuaMorony Жыл бұрын
​@@tinnick if we ignore backwards compatibility stuff/usual deprecation schedules etc (which won't be ignored of course, this isn't going to be a breaking change) - but for explanation sake - what signals would allow Angular to do is get rid of OnPush entirely, as you've mentioned it is this kind of special approach to CD where you follow certain rules and it will mark sub trees of your application as not requiring the normal global dirty checking that Angular does. If we make signals the default change detection strategy in Angular then we don't need zone.js, we don't need to worry about checking things like input bindings/references, we don't need a mechanism like the async pipe that will make a component to be checked. Angular will know what parts of your application need to be updated just by virtue of the fact that a signals value has changed, and it will be able to more precicesly target/update just the specific part of the app that updated, without having to dirty check the entire component tree - just that one component or perhaps even just part of that one component.
@jhadesdev9576
@jhadesdev9576 Жыл бұрын
@@JoshuaMorony So in the example you shown in this video, neither zones default change detection OR OnPush was active, neither was active, it was all just signals, correct? and how do you turn that on on Angular 16 RC branch, is there a special API property that you need to set in a component? Thanks for sharing, love the videos, cheers
@JoshuaMorony
@JoshuaMorony Жыл бұрын
@@jhadesdev9576 no this has not been implemented yet, the Signals API right now just uses the default change detection mechanism/Zone.js - I think the general API is the first focus, then CD stuff. This is a very early prototype (though I suspect it will only be in the order of months until we see a full/stable release of signals)
@marcel5235
@marcel5235 Жыл бұрын
I think, that Google team is aware of that and it is intentional. Signals will make for react developers much easier the transition to angular, and honestly will love the angular ecosystem. RxJs is the only thing that is preventing people to try to learn angular, if they have the option to not choose angular
@latribu99
@latribu99 Жыл бұрын
I used a lil bit of rxjs with a vue2 app
@manit77
@manit77 11 ай бұрын
cleans up the code. I was never a fan of the syntax required in rsjx.
@raulrothschild5876
@raulrothschild5876 Жыл бұрын
IMO for those developers who has a good experience with RXJS and done a lot o features using it, maybe when Signals arrive they will use those 10% or even more to do the same feature again. What i think for those developers who understood RXJS used a few times but not enough to build a lot of features with it, i think for them will be more hard to fit RXJS stuff into new features because of lack of experience in general, sometimes they just want to do the easy way instead the best way. And last, for incoming developers to the Angular with experience or not at other frameworks, i think they migth barely use RXJS because what they do today is subscribe everywhere and get things done and because of the "similarity" of the Signals API to others fws reactive APIs is high they will not be forced to understand too much about declartive code, race conditions and gerenera rxjs stuff.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Yeah I think we have more or less the same sentiment: people who like/use RxJS now will continue to do so (and integrate signals to varying degrees), people who use RxJS now but only because they have to will probably migrate entirely to signals, and I also agree that very few new Angular developers will adopt RxJS. So overall, a significant decrease in RxJS usage overall I think.
@amenhotepv4460
@amenhotepv4460 Жыл бұрын
Great video! One thing comes to my mind when I observe this evolution to signals and this drive to simplicity at a cost of control over events. Isn't it just simplier to use React then? I feel we're losing all the beauty of Angular and RxJS. I feel like in most typical scenarios the only thing that will remain different between these frameworks will be the nasty predefined selectors in Angular while in React you can just import and use component in tsx. I really didnt mind using BehaviorSubject and ReplaySubject(1) for declarations and then surf on the waves of RxJS.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Thanks! I think there are still a lot of other differences between React and Angular, but in any case I don't think it's really a "drive to simplicity at a cost of control over events" - RxJS will still be there to use when required, I see it more as decoupling the need to use RxJS for simple situations that don't necessarily need it. Using RxJS for simple situations isn't that big of a deal if you already understand it, but for a core "reactive primitive" in the framework I think it's a lot of mental overhead to bring in say for just filtering an item from a list. One of the most common Angular criticisms is always the steep learning curve, and I think this can help soften that whilst still having those advanced features available to people who need them.
@Almighty_Flat_Earth
@Almighty_Flat_Earth Жыл бұрын
Angular is the matured professional framework, it has simple syntax than react. React is hard to understand, the DX of react is horrible. React is a child play. When it comes to serious enterprise app development, Angular comes in glory. React has brought shame to JavaScript community by making web development unnecessarily complicated.
@nomadshiba
@nomadshiba Ай бұрын
you know you can just return promise and convert Signal into a Signal. also adding retries to promise doesn't require rxjs, you can have your own retry wrapper that can also return a promise which doesn't have to be aware of signals are a thing
@Brendan2Alexander
@Brendan2Alexander Жыл бұрын
Have to say I think ur hot take is pretty accurate. I am capable with Rxjs but why? Angular forced me to. I have been with Angular since it was in alpha (when it was called angularjs2), and I can say back then my use of rxjs was a raging hot mess. Back then I didn’t know the difference between a switchmap and a google map.
@zokizuan
@zokizuan Жыл бұрын
rather than integrating signal angular should really improve zonejs perfomance. I think signal can work without zonejs and would love to see a zonjs free angular application
@justsomeguy8385
@justsomeguy8385 Жыл бұрын
Ugh God no. Give people an easier way to write better applications, instead of the imperative mess the default change detection facilitates.
@frotes
@frotes Жыл бұрын
Amazing content. Rxjs is a game changer, I do hope people who use signal will take that next step But I do acknowledge what you say about this 80/90% use cases
@JensChristianLarsen
@JensChristianLarsen Жыл бұрын
My gut feeling says that trying to skip RxJs and go 'full signal' will lead to less readable and more bug-ridden code. At least for all but the most trivial apps. I hope we will not see a future "where most Angular developers will not use RxJs at all".
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I agree that using RxJS in conjunction with signals is a better idea - but if RxJS is more of an "add on" that you get to choose to add in or not, it's a big ask for most people to invest in learning it. RxJS is probably harder to learn than Angular itself. So I think most people won't learn RxJS, and I think the proof for that is in the fact that it is barely used in other front end frameworks (despite it being a valuable tool to deal with the sort of async reactivity problems that also come up there)
@jaredwilliams8621
@jaredwilliams8621 Жыл бұрын
I feel that this will lead to MORE readable, but also more bug ridden code. Rxjs code is many things, but easily readable isn't one of them. I feel that most developers will gravitate towards cleaner looking, and easier to understand, imperative coding styles, which will include many of the downsides that currently exist with imperative code, just like they do now.
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
@@jaredwilliams8621 Why do you think that it will be more bug ridden? I think signals (as mentioned in the video) are much less likely to lead to errors than rxjs. The synchronous nature and the glitch free execution of the reactivity of signals gives you much more guarantees than you get with rxjs. Therefor its much less likely to get error ridden code in most scenarios. Maybe you mean that you could miss the point where you should switch to rxjs. But I do not think that this is more error prone than doing everything in rxjs without the experience needed to do it right. And if you have the propper experience in rxjs you will be able to work with signals without getting into errors.
@jonathangamble
@jonathangamble Жыл бұрын
It would be interesting to see if the 10% rxjs needs like race conditions could be added to signals natively somehow. This could get rid of all needs for rxjs. Not saying this is good or bad, just could be interesting to see it evolve, then other frameworks copy it.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Maybe I'm just not thinking innovative enough, but I think for signals to deal with what RxJS deals with it would just end up basically being RxJS with different syntax. Maybe a targeted set of things to handle the most common use cases could be integrated at some point? I would be surprised to see it - I think it just makes more sense to have the RxJS interop stuff
@timonkrebs6978
@timonkrebs6978 Жыл бұрын
If we get control over scheduling of effects (pull phase) then most of the common async usecases could be managed. Only leaving the really complex ones to be handeled best by rxjs. Glitch prevention is one of the strenghts of signals that can get really hard in rxjs. This is something also async usecases can really benefit from.
@returncode0000
@returncode0000 Жыл бұрын
Am I wrong or aren't these concepts often known by java programmers who have used streams and reactive programming? So for me it seems like RxJS and Signals is pretty easy to grasp if you are familiar with frameworks like reactor.
@GLawSomnia
@GLawSomnia Жыл бұрын
Well yeah for those who work with streams in other languages it is very easy to understand, but i noticed that a lot of FE developers have no understanding about general concepts and don't see the bigger picture.
@adambickford8720
@adambickford8720 Жыл бұрын
Sure, but most java devs act like you literally physically assaulted them when introducing this stuff! There's a huge 'sigh of relief' as 'virtual threads' are promising to eliminate the need for java devs to modernize their monolith mindset.
@returncode0000
@returncode0000 Жыл бұрын
@@adambickford8720 Partially correct. There are lot of enterprise java devs how are absolutley familiar with modern concepts. It's a big community who is very aware of what is happening around them, especially in the spring/spring boot world. So i think i have to take a stand for the java community, those people are pretty aware and open for such technologies.
@adambickford8720
@adambickford8720 Жыл бұрын
@@returncode0000 I work almost exclusively in java spring and its specifically WebFlux I'm talking about! The vast majority of the devs HATE the entire reactive stack. No JPA, of all things, was the first dealbreaker. They are thrilled to avoid learning concurrent programming and are salivating at (ab)using the parallel programming they know and love. You're right though, it's a huge community. My PoV is from the fintech space that won't consider something like rust for another 10 years.
@returncode0000
@returncode0000 Жыл бұрын
@@adambickford8720 Many decisions about technologies are mostly driven by the company's strategy or the environment given by the market. I think thats especially the case in fintech but also at my work which is a very big enterprise. We have some freedom to do things as we want in our teams. But I agree with you some folks don't want to change things.
@adambickford8720
@adambickford8720 Жыл бұрын
I predict jr devs making all kinds of race conditions that appear to work on their local machine and having to fix/explain this stuff anyway. All while digging in that RxJs is 'overkill'. Or wading through some 'simple' solution that ties 5 frameworks (with one contributor) together to solve the same problem.
@ShaharHarshuv
@ShaharHarshuv Жыл бұрын
You have a good point about RxJS adoption. But isn't there a middle ground? Couldn't it be possible to use signals declaratively for the other 10% cases instead of RxJS, or at least use only a minimal subset of RxJS feature that are easier to learn? Think about the signal equivalent of react's "useQuery". I think signals are very much like react hooks, and today react developers can use them for everything declaratively (by using custom hooks like useQuery) without the need for any other reactive entity. I believe the same can be done with signals
@tmsbrndz4516
@tmsbrndz4516 Жыл бұрын
Thanks for these videos! In a week I watched all of your Angular / Reactive videos. Awesome. Now I need to refactor my Angular app. Byebye imperative programming. 🚀 Is there any way to give you some donation?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
If you want a donation that also gives you the benefit of a lot more reactive/declarative content Ionic Start is a good idea (even if you're not using Ionic, it's ~80% Angular) - otherwise, no worries! Just glad to hear you're enjoying the content!
@DavidAlsh
@DavidAlsh Жыл бұрын
Hot take - though less concise, imperative code is easier to reason about than the declarative functional style advocated for here.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I think it's fair to say imperative code is easier to reason about, but I think that declarative code is easier/quicker overall to follow/understand (but that requires learning the concepts first of course, which is by no means easy)
@adambickford8720
@adambickford8720 Жыл бұрын
For trivial examples? Sure, but that's true of 'goto' as well. EVERYTHING is easy in a small enough scope.
@ShaharHarshuv
@ShaharHarshuv Жыл бұрын
Isn't "mutate" a problem because... well, it mutates the previous value?
@JoshuaMorony
@JoshuaMorony Жыл бұрын
Good to be aware that's what you're doing (which I suppose the method naming makes more obvious) but mutation can be ok and is sometimes preferred
@ShaharHarshuv
@ShaharHarshuv Жыл бұрын
@@JoshuaMorony My intuition tells me it's problematic but maybe that's because I think of react's useState
@alexanderpedenko6669
@alexanderpedenko6669 Жыл бұрын
Yes, rxjs is hard to learn but once you understand rxjs it turns into a pleasure to works with it. So, I can't imagine how it will be replaced with Signals. Once I tried write code without rxjs, it so hard. Combine data flow, using debounce mechanisms, sharing state between components and a lot other things. It's like take away lodash or any other good library from js devs
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I agree that in an ideal world Angular devs would all like, use, and understand how to utilise RxJS. I just don't think that's happening though, and I think we are going to trend toward lower RxJS adoption. I do think there will be a sizeable community of RxJS devs within Angular that remains though, and I can see it remaining as something that people continue to learn as they advance their Angular skills more.
@AntonioSantana-ll8il
@AntonioSantana-ll8il Жыл бұрын
But in the other hand, that means angular developers will have more jobs because i think, the framework its very powerfull and some companies don't used because its hard to learn. Using signals become easier learning and implent angular.
@hieudocong2209
@hieudocong2209 Жыл бұрын
Signal is big change for angular developer 😂
@AntonioSantana-ll8il
@AntonioSantana-ll8il Жыл бұрын
makes me sad the possibility that rxjs will be optional or desapear in the future, being honest at the begining i didn't like me rxjs so much, but creating more complex things, the pipe operator its just beautifull and rxjs its really powerfull. Well good developers should be adaptive
@ruipinto3542
@ruipinto3542 Жыл бұрын
I lost the count of how many times I repeated the following statement: "simple is not the same a easy" Simple is almost always the right answer. Easy is almost always the wrong. By learning standard abstractions as RxJS and reactive functional programming you learn how to write simple and elegant code that anyone can understand (even if they need the help of Google for that). By reinventing the wheel you'll just lose more time writing the same code but with the disadvantage that no one else will understand it. This applies to a lot of concepts in programming and life in general, actually. Good patterns simplify problems.
@brandongregori995
@brandongregori995 Жыл бұрын
RxJS is great and I love working with it, but let's face it, the default approach to Angular for most people is to imperatively code everything and use RxJS as little as possible. I think signals is meant to change the default approach by introducing something that's a bit easier to understand upfront. RxJS will never do that, and it really sucks to work with non-reactive Angular.
@giorgosgernas9698
@giorgosgernas9698 8 ай бұрын
People who have been using angular for a while are likely more than familiar with rxjs. My take on this is that signals will have poor adoption once the hype dials down. Unless signals evolve to be on par with rxjs I wouldn't use them as a replacement just because I want everyone on my team to be able to handle the 10% of cases you are referring to whenever they come up, and I see no great advantage in favoring signals over rjxs for the 90%.
@Afdac247
@Afdac247 Жыл бұрын
cant believe people hate using rxjs, is this from a survey rxjs is based on builder pattern of which all of java is adopting
@rob.ale90
@rob.ale90 Жыл бұрын
At some point i just want to go vanilla. All of these changes, what do they bring exactly? People just forgot simplicity, we're going from hype to hype to hype to hype...learn this, is better, no learn this, is better, no learn this, is better...it just gets tiresome for the sake of it. Meanwhile real projects still using promises. What do i get now...we have another technology which is better, but it isn't a solution for everything, so basically if we use apps(like in real world) with async operations we will still use rxjs...but if we want to create a count on the page we use signals...but hey, it's better...and react developers will love it
@_b001
@_b001 Жыл бұрын
is it bad to think that front-end development is not supposed to be this complicated? I am new to javascript frameworks but I feel like developers are making stuff more complicated in the name of abstraction.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
I get that feeling, but I think the problem is that front end development is (or can be) that complicated. We have all these complicated things we need to deal with, so people create tools and frameworks and strategies in an attempt to make those things easier/more consistent/more performant/maintainable etc. But it's always tradeoffs and "it depends", sometimes you have a lot to gain from these frameworks and libraries and sometimes you don't, and it can be hard to tell when it might be worth it and what the right approach might be if it is.
@adambickford8720
@adambickford8720 Жыл бұрын
RxJs is like OOP: 10% understand it, 90% hate it. We've been trying to get the JS kids on board w/type safety for decades now and barely making progress. RxJs doesn't stand a chance if there's a 'simple but incorrect' alternative. The best part will be the 2135325 frameworks to solve that 10% that's far more complex than rxjs
@DummyFace123
@DummyFace123 Жыл бұрын
Rxjs’s fault for not having a 90th percentile api, where almost all of what you need from it would have straight to the point apis. Not including an easy way to mutate immutable was just fking stupid, but js devs get all caught up in “non-opinionated batteries not included hurhurhur *sniffs own farts*” Aaaand svelte is going to eat their lunch. That’s what you get.
@sohail2d
@sohail2d Жыл бұрын
Apples & Oranges. With all due respect, this clip simply is a biased opinion. I encourage everyone to find the answer to these simple questions, before picking a solution: 1. WHAT is a declarative problem? 2. WHEN do you implement reactivity? 2. HOW does RXJS work? Replacing a few lines of codes with other lines of codes, and not knowing why you are doing it, creates a bigger mess when it comes to debugging maintaining and scaling.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
What biased opinion do you think I'm making here? To be clear, I'm not trying to say signals is a general replacement for RxJS - I like RxJS, and will continue to use it, but RxJS already has relatively low adoption in Angular even when it is included by default and required to use many parts of Angular. I can only imagine that adoption will decrease when RxJS is no longer a "required" part of Angular. I don't think people not using RxJS is a good thing, I just think it is what will happen.
@sohail2d
@sohail2d Жыл бұрын
@@JoshuaMorony You gave a clear percentage on how things will replace each other, but now you are denying it. Watch the clip please. My debate is simple. RxJS and Signal are different techs for different use cases. They are not replacements. You are entitled to your opinion regarding RxJS adoption in angular. I believe many have completely opposite opinion. Me included. Respectfully.
@JoshuaMorony
@JoshuaMorony Жыл бұрын
​@@sohail2d I mean not a "general replacement" in the sense that signals can not do everything RxJS can do, but they can do a lot of what RxJS is typically used for in Angular applications. The 90/10 wasn't intended to be some kind of precise number, it's going to vary from codebase to codebase - but (assuming someone is seeing if they can replace RxJS with signals) I think somewhere in the realm of 10% would be a decent estimate of the average amount of situations in Angular codebases that would require RxJS (as in you couldn't replace it with signals without losing something/introducing a bug/race condition). Signals and Observables are different and cover different use cases, but there is also a lot of overlap. I want more people to learn and use RxJS, I love it. I think people *should* use it, I just don't think they are going to. Given that RxJS has been more tightly integrated with Angular and we had something like 50% adoption (this one isn't just a made up percentage, though I don't have a link to the survey the Angular team did) - essentially 50% of Angular devs liked RxJS and wanted more of it, 50% of Angular devs did not want to use RxJS. Now that there is this push from the Angular team toward signals as the default reactive primitive, I just can't imagine that increasing the number of devs who pursue/learn RxJS. Edit: To be clear, I think we will still have new people who adopt/learn RxJS, I just think it is going to be a relatively low percentage of Angular devs
@sohail2d
@sohail2d Жыл бұрын
@@JoshuaMorony Well lets agree to disagree. I've been coding long enough (3+ decades) to witness rise and fall of several libs/solutions/methodology/etc. Here is my 2 cents: 1. If a concept has been already adopted (even 50% as you mentioned) introducing a different way to achieve the same result simply won't cut it. (i.e. new coding style) 2. Improving the pain points of prev concept has better chance of adoption, also 3. When it is about adoption, overlaps simply weaken each other (i.e. scriptaculus.js prototype.js, ...) Personally, I find solutions that "do one thing and do it right" have a better chance of survival compared to "overlap"ed approach. Because: - as a developer it means less technical debt, and - as a c-suit it means better maintainability and scalability. Truth to be told, Signal is not a new concept. In fact with a bit of digging you can find the trace of what is trying to solve back in 2005-2007. When a couple of major js frameworks were introduced in 2010, signal (back then state management techniques) gained a bit more traction. My point is, different names in different times with the promise of solving the same problem (or overlapping to other territories) is not a reliable or permanent solution. Chances are it might be a buzzword... evolving into another buzzword in another time. Time will tell.🤷
@JoshuaMorony
@JoshuaMorony Жыл бұрын
@@sohail2d For sure, I'm not even 100% sold on my opinion anyway (and you make good points) - just what I think is more probable given that Angular has decided to go down the signal path rather than focusing on RxJS specifically, but I'd certainly be glad to be wrong and have an increased level of RxJS adoption among Angular devs
@valikonen
@valikonen Жыл бұрын
I'm sure Angular core devs will do anything to make angular better for performance, so RxJS will be history.... Now we import a lot and use partial.
@StingSting844
@StingSting844 Жыл бұрын
Rxjs is for control flow. Not performance
@parlor3115
@parlor3115 Жыл бұрын
Might wanna use your mouth a little less when talking. I can hear you drawing your saliva every 10 seconds or so
@elmotareal
@elmotareal Жыл бұрын
I wonder what the future of HttpInterceptor is if Angular team decided to cut off RxJS. They The latest stand alone version is already messy I hate to see it get messier
Angular Signals. А точно ли нужен? Как работает магия сигналов
25:15
Архитектор ПО. Александр Желнин
Рет қаралды 8 М.
Angular is about to get its most IMPORTANT change in a long time...
10:15
🤔Какой Орган самый длинный ? #shorts
00:42
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 40 МЛН
WTF is "Zone.js" and is it making your app slow?
13:21
Joshua Morony
Рет қаралды 53 М.
Why didn't the Angular team just use RxJS instead of Signals?
8:15
Joshua Morony
Рет қаралды 88 М.
5 Coding Mistakes I Wish I Knew Earlier
9:40
RitzJS
Рет қаралды 527
ngTemplateOutlet is WAY more useful than I realised
16:36
Joshua Morony
Рет қаралды 73 М.
The easier way to code Angular apps
9:54
Joshua Morony
Рет қаралды 64 М.
Why Angular Signals? Write Your First Signal
14:25
Angular University
Рет қаралды 7 М.
Why use OnPush in Angular? Not for performance...
13:15
Joshua Morony
Рет қаралды 31 М.
Angular Signals: What? Why? and How?
27:08
Deborah Kurata
Рет қаралды 54 М.
WTF is "modern" Angular development?
10:46
Joshua Morony
Рет қаралды 70 М.
🤔Какой Орган самый длинный ? #shorts
00:42