Angular 17 Defer - Improve Performance in Your Application

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

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

  • @MonsterlessonsAcademy
    @MonsterlessonsAcademy  2 หลายเดือนก่อน

    WATCH NEXT: Angular Interview Questions and Answers - Dominate Your Next Interview - th-cam.com/video/5A_YKlVWMPo/w-d-xo.htmlsi=2DCn7yspEAAJ2H6l

  • @davithovhannisyan7844
    @davithovhannisyan7844 หลายเดือนก่อน

    Good overview! Thank you!

  • @michaelharrington5860
    @michaelharrington5860 ปีที่แล้ว

    Very powerful feature. Thanks for the explanation

  • @xxRAP13Rxx
    @xxRAP13Rxx 4 หลายเดือนก่อน

    Nice video! I take it at 8:50, the Load button does nothing if you press the Show button first because the Show button did the loading instead?

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

    Thanks!

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

    So in a master detail you can lazy losd details bit by using defer a d button click. Insa e

  • @bibin24x7
    @bibin24x7 8 หลายเดือนก่อน

    Very good explaination

  • @александпустовит
    @александпустовит ปีที่แล้ว

    Thanks for the explanation

  • @prabhuprasad3679
    @prabhuprasad3679 11 หลายเดือนก่อน

    Hi,
    Thanks for the explanation. I have a couple of questions:
    1 - Is it possible to revert back to the original state when the condition is undone. For eg - the view is rendered when the code enters the viewport but when the user scrolls up and the the code is removed from the viewport, the view stays
    2 - in case the view doesn't get rendered for some reason, can we re-render them somehow?

  • @exploteldeveloper
    @exploteldeveloper ปีที่แล้ว

    I thought it would be a nice alternative to bypass the ssr but after testing I don't see any improvement yet. I peppered my components with @defer blocks in the hope of reducing Initial Chunk Files but quite the opposite happened. The more @defer I put, the more the main.js file gains in size. It's still very useful for displaying skeletons.

  • @anutaNYC
    @anutaNYC 9 หลายเดือนก่อน

    I have major issue with timing in angular I have a dialog with a form and need to fetch the data for that form before it's opened wondering if this will help.

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  9 หลายเดือนก่อน

      Kind of. But you can do the same without defer.

    • @anutaNYC
      @anutaNYC 9 หลายเดือนก่อน

      @@MonsterlessonsAcademy I figured it out with subscribe but all these new things I haven't applied yet, and it's scary

  • @francogutierrez2257
    @francogutierrez2257 5 หลายเดือนก่อน

    ¡Gracias!

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  5 หลายเดือนก่อน

      Thank you so much for your support. It means a lot to me!

  • @ManasKumar-t2j
    @ManasKumar-t2j 11 หลายเดือนก่อน

    As angular 17 doesnt have module, how we can handle lazy load module routing ? all the components are stand alone does it impact performance of existing application after migrating to 17 ? any idea?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  11 หลายเดือนก่อน

      I already covered that
      th-cam.com/video/NFJbXP6Ci98/w-d-xo.htmlsi=dXl2xXJGoOik9ZB9

  • @NunoFreitasBotelhoo
    @NunoFreitasBotelhoo ปีที่แล้ว

    How about when you have 2 defer inside the same template. Will create two chunks i assume, but how does it know what placeholder/loading/error to use?
    Great video!

    • @Simao-xk1ye
      @Simao-xk1ye ปีที่แล้ว +1

      In a scenario where multiple @defer directives are used, each @defer should have a corresponding @placeholder block immediately following it. The @placeholder block that follows a @defer block is the placeholder for that specific deferred content.
      eg.
      @defer(on viewport) {

      }
      @placeholder {
      Loading some component...
      }
      @loading {
      ...
      }
      @error{
      error
      }
      @defer(on viewport) {

      }
      @placeholder {
      Loading another component...
      }
      @loading {
      ...
      }
      @error{
      error
      }

    • @asadrahman6123
      @asadrahman6123 ปีที่แล้ว

      @@Simao-xk1ye
      i think he meant this
      @defer(on viewport) {

      @defer(on viewport) {

      }
      @placeholder {
      Loading another component...
      }
      @loading {
      loading
      }
      @error{
      error
      }
      }
      @placeholder {
      Loading component...
      }
      @loading {
      loading
      }
      @error{
      error
      }
      will this work ?

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

      Simao answer is perfect. You create multiple @defer with multiple @placeholder blocks for each of them. It will create separate chunks for every defer.

  • @respostasimples
    @respostasimples ปีที่แล้ว

    great job, thanks!

  • @alexanderkomanov4151
    @alexanderkomanov4151 ปีที่แล้ว

    Спасибо большое!

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

    @derfer combined with ssr.. does that even make sense?

    • @MonsterlessonsAcademy
      @MonsterlessonsAcademy  ปีที่แล้ว

      I didn't try that yet but no? because on backend we want to get the full prepared page. so all defered blocks should just be skipped

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

      @@MonsterlessonsAcademy yeah agree

  • @1654045
    @1654045 ปีที่แล้ว

    I like u video so much!

  • @theMarhaenist
    @theMarhaenist 11 หลายเดือนก่อน +2

    Your speech making the lesson a little more difficult to understand

  • @danielpacheco2520
    @danielpacheco2520 ปีที่แล้ว

    this is crazy..

  • @asadrahman6123
    @asadrahman6123 ปีที่แล้ว

    string replace @if (condition) -> @defer(when condition; prefetch on idle) 😂

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

      I don't think it's a good idea to pack each small if condition in additional chunk