Building with Ivy: rethinking reactive Angular | Mike Ryan |

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 พ.ย. 2024

ความคิดเห็น • 42

  • @netd777
    @netd777 5 ปีที่แล้ว +12

    Very, very interesting. I'm really excited to see how the community will develop this workflow. Not only it will greatly reduce minimal app size because you don't need zone.js, but I believe this way of doing it is also a lot simpler to understand than zone.js. Less "black magic" and a lot more of core Rx concepts applied. Concise, elegant, less error prone (if we develop a simpler workflow) and can provide more granular control of "rendering" (sometimes you can't avoid it).

  • @Bryanerayner
    @Bryanerayner 5 ปีที่แล้ว +1

    Beautiful. This will be incredibly elegant when complete.

  • @ericaskari
    @ericaskari 5 ปีที่แล้ว +1

    This video is GOLD.

  • @kardashevr
    @kardashevr 5 ปีที่แล้ว +12

    you don't have to unsub from the core angular observables (like from HttpClient), because Angular itself handles that

    • @MA-kt8ly
      @MA-kt8ly 5 ปีที่แล้ว

      Ruslan Kardashev yes this ss what every tutorial says. If subscribing from angular components, they are auto unsub.

    • @brianm2029
      @brianm2029 3 ปีที่แล้ว +1

      Yeah http observables complete after delivery

    • @bouloan7576
      @bouloan7576 3 ปีที่แล้ว

      I was just asking myself, why does he subscribe for http request?? And I see your comment 😁

  • @bluebee2431
    @bluebee2431 3 ปีที่แล้ว

    Fantastic talk, Mike!

  • @dsedchenko
    @dsedchenko 4 ปีที่แล้ว +12

    imho it's over-engineering

  • @marcialabrahantes3369
    @marcialabrahantes3369 2 ปีที่แล้ว +1

    Have there been any updates on this effort?
    Anyone used it in practice?

  • @LarsRyeJeppesen
    @LarsRyeJeppesen 5 ปีที่แล้ว +1

    Mind blown - this is epic stuff

  • @abderrahmanemustapha233
    @abderrahmanemustapha233 2 ปีที่แล้ว

    Amazing talk

  • @matthewhill4649
    @matthewhill4649 5 ปีที่แล้ว +6

    I don't understand: for the first problem, why would you not simply use the "share" operator?

    • @artemeelemann317
      @artemeelemann317 4 ปีที่แล้ว

      Yeah! Why nobody told this guy that the share operator exists :D

    • @yikan1107
      @yikan1107 3 ปีที่แล้ว

      ​@@artemeelemann317 Well, his proposal is a much smaller foot print.
      2 separate data streams get combined into one. The dom that requires the second data piece will not always render because the first data piece comes in.
      So you make that dom dependant on that piece of data...Which forces you to rewrite your data to conform to say an object.
      And now you have action dispatch pattern you have to enforce on two disparate pieces of data. you could probably use it the observable to update a class attribute but then you'd end up withe same amount of code now as you had with method 2 (controller based observer management)
      Whereas, he is proposing that each variable is reactive and you call that render on just an ngIf in the view template. Its harder to make bad code with his protototype.
      If you want to nitpick, I would go for the fact that everybody wants to be that final class which is why he recommends integration with akita.
      This is a data component level final class and not a layout final class.
      You'd most likely wrap your ui library with a data-reactive-component and serve it into a layout view
      Its a lot less code. But i doubt anyone is going to work this into production code. No one is going to turn off ngzone globally.
      The main problem is component level control of rerender is going to be more performant than service level control of rerender.
      Writing acode to batch aync code properly for performance is a friggin chore.
      rather than this, i would like to see more support for custom ChangeDetectionStrategy or increased options.
      ChangeDetectionStrategy.OnCustom({rerenderOnAsyncOps: false})
      that's step 1 .
      Reactive Component Library is step 2.

  • @mikelipin6556
    @mikelipin6556 5 ปีที่แล้ว

    The approach is awesome

  • @raknjarasoa
    @raknjarasoa 5 ปีที่แล้ว +1

    Amazing. Thanks for talk

  • @PaweSmoka
    @PaweSmoka 4 ปีที่แล้ว +2

    I am happy to see this direction, however, I got one question - why copy-paste react solutions instead of using react then?

    • @marcialabrahantes3369
      @marcialabrahantes3369 2 ปีที่แล้ว

      legacy projects? 🤷‍♂️

    • @PaweSmoka
      @PaweSmoka 2 ปีที่แล้ว

      @@marcialabrahantes3369 you can use react in angular in such case still and step by step replace. React is just a lib.

  • @eliancordoba1199
    @eliancordoba1199 5 ปีที่แล้ว

    Wow excellent talk!

  • @SimplifiedTechTamil
    @SimplifiedTechTamil 5 ปีที่แล้ว

    Woo Great talk!!!!!!!

  • @masterlup
    @masterlup 3 ปีที่แล้ว

    Michael Hladky: "hold my beer"

  • @tomastrajan3377
    @tomastrajan3377 5 ปีที่แล้ว +3

    IVY + no zone.js is amazing but please, lets make this happen without HOCs, zoneless async pipe or anything else

    • @LarsRyeJeppesen
      @LarsRyeJeppesen 5 ปีที่แล้ว +2

      What's wrong with HOCs? They are awesome for lots of things... form elements for instance

    • @hamzabenkhaldoun
      @hamzabenkhaldoun 5 ปีที่แล้ว +5

      @@LarsRyeJeppesen One prime reason why React made the hooks api is to get rid of the HOC pattern

    • @LarsRyeJeppesen
      @LarsRyeJeppesen 5 ปีที่แล้ว

      @@hamzabenkhaldoun ok thanks

    • @kostiantyn187
      @kostiantyn187 5 ปีที่แล้ว

      HOCs have some limitations, one of theme is multiple class inheritance, in React world for that case composition has comes and HOC’s works as expected, that’s is more suitable for functional paradigm but Angular is on the OOP way and I suppose it is more fashion way to apply props through annotation decorators @connect()

  • @vukkumsp
    @vukkumsp 3 ปีที่แล้ว

    httpClient will automatically unsubscribes once received, Isn't it? Do we need to manually unsubscribe it ??

    • @lera_study
      @lera_study 3 ปีที่แล้ว

      Yes, it will unsubscribe automatically… once the call will be completed, but it is better to do it onDestroy as in this case it will unsubscribe exactly onDestroy and cancel all pending requests

  • @никитапалецких
    @никитапалецких 5 ปีที่แล้ว

    ngIf don`t work with enabled ivy
    Can't bind to 'ngIf' since it isn't a known property of 'div'.

    • @patricknazar
      @patricknazar 5 ปีที่แล้ว +4

      did you import CommonModule?

  • @MAKU011111
    @MAKU011111 5 ปีที่แล้ว +1

    You do not need to unsubscribe from a subscription you get from HttpClient (as mentioned at 24:09)

    • @GG-ky3by
      @GG-ky3by 5 ปีที่แล้ว +6

      Yeah, there is no memory leak as mentioned at 1:57. But you might still want to unsubscribe so the subscribe callback doesn't get called.

    • @marianbencat6658
      @marianbencat6658 5 ปีที่แล้ว +3

      you HAVE TO, else, you may get tons of memory leaks and strange behavior when your requests take longer than expected (30sec request time)

    • @MAKU011111
      @MAKU011111 5 ปีที่แล้ว +1

      @@marianbencat6658 I do not see what you mean. Unsubscription is handled in success / error case automatically. Of course calling the unsubscribe method is useful when yout have to cancel an "in progress" HTTP request

    • @marianbencat6658
      @marianbencat6658 5 ปีที่แล้ว +3

      @@MAKU011111 read it again and slowly...
      - yes, unsubscription is handled in success / error case
      - yes, when request ENDS with success / error
      - WHEN REQUEST ENDS - so if requests takes 30 sec, you are leaking resources for 30sec.
      MEMORY LEAK:
      - not freed resources when not needed anymore
      - try to subscribe in a component to 30sec (or timeout) lasting request and go BACK and THERE 30times...
      = you will need 30x more resources + YOU WILL LISTEN 30times except once.

    • @MAKU011111
      @MAKU011111 5 ปีที่แล้ว

      @@marianbencat6658 yeah I get you point. But this example is very constructed.... In general I would not handle the unsubscription of http calls (but thats my personal opinion - but also heard on several occasions from others)

  • @hansschenker
    @hansschenker 2 ปีที่แล้ว

    Why is Angular not following this approach? Is it pride not to have invented it! Are Google's developer not able to think in RxJs terms?

  • @rgh1986aka199
    @rgh1986aka199 2 ปีที่แล้ว

    I understood nothing!!