From Good to Great: Optimizing Angular Performance

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 33

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  2 месяца назад +3

    WATCH NEXT: Angular Unit Testing Course - All That You Need to Know About Testing - ruclips.net/video/bv9z_UfSqgM/видео.htmlsi=WVzOWtdQUZWEbqsz

  • @louangemusic
    @louangemusic Месяц назад

    Really helpful. I was struggling with the a complex for loop and performance issue, this one helped me fix that by understanding what I am doing wrong.

  • @3boodon
    @3boodon 19 дней назад

    Great video as always, Thank you !
    can you please tell me what theme are you using ? I really love the colors.

  • @ChessPuzzlesVideo
    @ChessPuzzlesVideo 2 месяца назад +2

    Well explained. But in real-time application, we pass object to child component because we need to access multiple properties of that object.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 месяца назад +1

      Sure. Which works just fine until you get to the point where performance is really important and you want to avoid renders.

    • @Marshall86MT
      @Marshall86MT 2 месяца назад +2

      Which strategy would you use in this case? ​@@MonsterlessonsAcademy

    • @justincantley9705
      @justincantley9705 Месяц назад

      You could create an input on the child for each property of the parent object that you need in some cases. This doesn't scale well, but could work for smaller objects.

  • @yufgyug3735
    @yufgyug3735 2 месяца назад +1

    important tips, however worth noting that angular 17 (i think) introduced new template syntax with required track by, which makes this obsolete

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 месяца назад

      It doesn't make this obsolete. All same rules are applied to @for in control flow. track by by index can be bad, passing inputs as objects rerenders a child, etc.

  • @Edgars82
    @Edgars82 2 месяца назад

    using new @for syntax flow Angular enforces to use trackBy as it is required and if someone starts learning Angular it should do it with latest version so this should not be an issue.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 месяца назад

      It doesn't make this obsolete. All same rules are applied to @for in control flow. track by by index can be bad, passing inputs as objects rerenders a child, etc.

  • @enverusta7811
    @enverusta7811 2 месяца назад

    Thank you so much, it was really helpful

  • @izacaqsha3480
    @izacaqsha3480 2 месяца назад +2

    How about the new "for" In angular v18, do we need to optimize it too in some kind of way like trackby?

    • @Brendan2Alexander
      @Brendan2Alexander 2 месяца назад +3

      Trackby is required in v18

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 месяца назад +1

      You mean @for control flow in html? It is there starting from Angular 17 and all same rules are applied there as well as trackby.

    • @izacaqsha3480
      @izacaqsha3480 2 месяца назад

      @@MonsterlessonsAcademy yes sir, I see, thanks

  • @Manoeuver
    @Manoeuver 2 месяца назад

    great video and tips, thank you! quick question about the example you said at the end for an object with like 20 properties, how would you tackle that? Pass each property as an input so it doesn't trigger many re-renders?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  2 месяца назад +1

      In real project I won't optimize until I have performance problems. Not each project will have a bottle neck. Passing 20 props is not fun, I would split it in several comps and try to have 5 or less.
      Additionally it doesn't make sense to optimize rerendering of a single component on the page. You would focus on optimizing comps which are rendered and re-rendering 1000 times on the page.

    • @Manoeuver
      @Manoeuver Месяц назад

      @@MonsterlessonsAcademy thanks for the reply, great insights!

  • @07bakabaka
    @07bakabaka 2 месяца назад

    Amazing, good job.

  • @adriantworek1057
    @adriantworek1057 2 месяца назад

    Great stuff as always! Any chance you will drop Analog.js crash course in the future?

  • @Doktornikita
    @Doktornikita 2 месяца назад

    THX BRO!

  • @oleksiipopov5143
    @oleksiipopov5143 2 месяца назад

    thank you

  • @Brendan2Alexander
    @Brendan2Alexander 2 месяца назад

    Really helpful thank u! Please don’t start a channel about making ice cream, because I will become so fat!😂