Deferrable Views - New Feature in Angular 17

Поділитися
Вставка
  • Опубліковано 12 гру 2024

КОМЕНТАРІ • 78

  • @DecodedFrontend
    @DecodedFrontend  10 місяців тому +8

    Level up your Angular skills with my Advanced Courses 🚀
    bit.ly/discounted-course-bundle
    💡 Short Frontend Snacks (Tips) every week here:
    Twitter - twitter.com/DecodedFrontend
    Instagram - instagram.com/decodedfrontend
    LinkedIn - www.linkedin.com/in/dmezhenskyi

  • @keaganfouche1544
    @keaganfouche1544 6 днів тому

    This is the best video on deferrable views that I've come across. Thank you for the clear and well delivered information!

  • @o_glethorpe
    @o_glethorpe 10 місяців тому +7

    That prefetch on idle is amazing

    • @hanshans9902
      @hanshans9902 10 місяців тому

      Why

    • @Panossa
      @Panossa 9 місяців тому

      @@hanshans9902 Imagine you have a website with endless scrolling. You only load the first 10 elements, but can load the next 10 as soon as the first are loaded. The initial page load is quick but you don't have to wait for long for additional content.
      Or imagine you have a website with different category buttons, like for shopping. You know most users will click on category A when visiting the website, thus you can start loading that as soon as the main page is loaded.

  • @MrKOHKyPEHT
    @MrKOHKyPEHT 10 місяців тому +19

    IMO Angular 17 is game changer, but when we are talking about bumping current projects to version 17 - using all new features and benefits of Angular 17 will require a lot of refactoring, including both templates and components (deferrable views, signals, etc.)

    • @yankotliarov9239
      @yankotliarov9239 10 місяців тому +5

      Angular is backwards compatible so you can start with building new components with signals and slowly migrate older ones over time, algular already has great reactivity using MVVM model, even if it comes with some overhead. Algular team also works on making NoZone providers so you can disable zone for specific components rather then going all or nothing on refactoring whole application.

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +2

      Yeah, the Angular 17 is absolutely fantastic :) Regarding the part of refactoring, I agree that the migration will take some work, unfortunately. However, here I agree with @yankotliarov9239. Angular doesn't force you to migrate to all these awesome features immediately to benefit from Angular 17. You can do it incrementally because all these new features are backward compatible. Also, the Angular team invests a lot of effort in schematics to automate migrations where possible :)

    • @Panossa
      @Panossa 9 місяців тому

      @@DecodedFrontend do you mind creating videos on such schematics for Angular 17 if there are any?

    • @aj.arunkumar
      @aj.arunkumar 6 місяців тому

      @@Panossa just run ng update and you will be told what to do to update

  • @vladislavamarkova8379
    @vladislavamarkova8379 10 місяців тому +10

    One of the best videos on Deferrable Views, thank you!

  • @gonzalocorchon6509
    @gonzalocorchon6509 10 місяців тому +5

    I've been missing you lately. It was worth the wait. Great video as usual.

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +1

      Yeah... I had s short pause. Thank you! :)

  • @Panossa
    @Panossa 9 місяців тому

    This is a very hands-on approach to showing new features, love it! Very concise and ripe with examples. Thanks!

  • @littleoddboy
    @littleoddboy 5 місяців тому

    no one could teach deferrable views in angular better.

  • @atulkamble557
    @atulkamble557 3 місяці тому +1

    Beautifully explained! This is going to be very useful.

  • @timurbirgalin4704
    @timurbirgalin4704 10 місяців тому

    This is a really cool feature and I can't wait to try this one and other new features in our new project at work! Thank you so much for the video!

  • @artemyavorskyi5865
    @artemyavorskyi5865 10 місяців тому +1

    Дякуєм за хороший як зажди розбір Ангуляру!

  • @AfifAlfiano
    @AfifAlfiano 8 місяців тому +1

    What the game changer, that's awesome feature

  • @psk2166
    @psk2166 10 місяців тому +1

    Thank you so much, your explanation and immediate example are very helpful.
    Give me crystal clear for the idea what it should be used for.
    For me this is brilliant feature offer from Angular team.

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому

      Thank you so much for this feedback, I appreciate it so much 🙏🏻

  • @innocentmazando3808
    @innocentmazando3808 10 місяців тому +2

    Always a good thing hearing you explain concepts to us.
    Thanks @Dymtro

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому

      Glad that it was helpful and thank you for your comment ;)

  • @aliroshan5773
    @aliroshan5773 10 місяців тому +1

    Thanks for your hardworking and sharing your experience

  • @gagiksimonyan3782
    @gagiksimonyan3782 10 місяців тому +1

    Thanks for another useful video, Dmytro) Glad to see you again

  • @GuillermoArellano
    @GuillermoArellano 7 місяців тому +1

    This was awesome! Thank you, Dmytro.

  • @rahulmukherjee4700
    @rahulmukherjee4700 3 місяці тому +1

    Fantastic explanation

  • @oleksandrvorovchenko8674
    @oleksandrvorovchenko8674 10 місяців тому +1

    Very good and detailed explanation! As usual :) Thanks!

  • @MayuraaSripalan
    @MayuraaSripalan 10 місяців тому +1

    Great explanation! Thank you very much!

  • @pinkmobina
    @pinkmobina 10 місяців тому

    Thank you for creating such an awesome content on Angular

  • @ichr
    @ichr 2 місяці тому

    Thank you very much, another really great explanation and use cases! :)

  • @MichielKikkert
    @MichielKikkert 9 місяців тому +1

    on interaction is also a great feature!

  • @shubhamgoel7703
    @shubhamgoel7703 3 місяці тому +1

    awesome feature thanks sensei 😍

  • @OnoshkoAndriy
    @OnoshkoAndriy 10 місяців тому +1

    Great explanation. Thanks for the video!

  • @abdelhamidouanes9941
    @abdelhamidouanes9941 5 місяців тому

    Bravo !! Big thanks

  • @teothe
    @teothe 10 місяців тому +1

    If we wrap all this logic in a component will it be the same
    example:
    in an app the loading and error part might be the same in all situations

  • @chris.p-dev
    @chris.p-dev 10 місяців тому +2

    Great in-depth explanation, deferrable views removed a lot of headaches. I guess idle browser API is not the last one they’re to integrate under the hood. P.S. hope the spinner approach dies in favor of skeleton 😂

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +1

      Thank you! I also think that some new triggers and prefetchers will be introduced.
      And yeah, I also like more the approach with placeholders rather than spinners 😉

  • @AndreyKarpovich
    @AndreyKarpovich 10 місяців тому

    Defferable views are a bit like Signals (Angular 16 feature) for chunks of template. And also they reminded me a server-side rendering concept using PHP

  • @saniyainbali
    @saniyainbali 10 місяців тому +3

    new video 🎉🎉🎉

  • @wafel_dev
    @wafel_dev 10 місяців тому +1

    Do to know any best practices on how to use those? For example should we still use lazy loaded routes or will deffereable views just replace them?

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +4

      Hi! Thanks for your question. Some best practices are:
      - Use placeholder blocks to avoid flickering in your UI;
      - Try to avoid applying of the @defer block for the components that appear immediately on the loading screen.
      - Make sure that lazy component isn't being used anywhere else in your app and doesn't have a reference via @ViewChinld, etc. In this case, it will end up in the main bundle.
      - Make sure that the components inside the @defer block are standalone. NgModule-based components won't be lazy loaded.
      - If you are sure that the user will be interacting with the lazy component, consider using prefetching.
      Regarding the router lazy loading. Deferrable views are not supposed to replace router-based lazy loading. It is absolutely fine to combine those 2 approaches because both of them solve slightly different use cases.
      I hope my comment was helpful :)

  • @vOnez212
    @vOnez212 9 місяців тому +1

    Nice job!

  • @MrVinodkumar92
    @MrVinodkumar92 6 місяців тому

    Thanks for the clear explanation.
    I have a doubt. U said placeholders, loading error are eagerly loaded.
    But in projects we use again another component inside the error and loading blocks
    Then we lose the lazy loading right. So how can we achieve even loading the blocks content as lazy loaded.

  • @kashifalikhan4420
    @kashifalikhan4420 10 місяців тому

    Very well explained

  • @serhiilytvyn8753
    @serhiilytvyn8753 10 місяців тому

    Thanks a lot! Your video is awesome! 💛💙

  • @jaspernygaard9500
    @jaspernygaard9500 10 місяців тому

    Love the explanation and new feature. One question for you.
    Is it possible using @defer inside of structural directives?
    If I have a for loop of 3 heavy components, can I defer them and load them one by one when the first one is finished? :)

  • @CodeSample360
    @CodeSample360 9 місяців тому +1

    Thank you for this video

  • @halynaua
    @halynaua 10 місяців тому +1

    Awesome🤩

  • @CodeZakk
    @CodeZakk 10 місяців тому

    hi thank you epic video. my question is is angular deferable views is like react suspense i use angular,react and vue and i will see any equivalent property for other framework?

  • @NoName-1337
    @NoName-1337 10 місяців тому +2

    What would happen, if I have wrappted ComponentA within a @defer block in ComponentB, but in ComponentC, I don't wrap ComponentA in a @defer block. Would ComponantA split from the main-chunk or not? Should I wrapp all same components with @defer to archeve a split from the main-chunk?

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +3

      Hi! Thanks for your question. In your case the componentA will become a part of main bundle because it has a reference in the component that will be eagerly loaded (ComponentC)

  • @vibhukumar7327
    @vibhukumar7327 10 місяців тому

    Hey, Thanks for making this video. How about nested @deferrable view? How does that work? it will be helpful for many people if you make a video on that. Thanks.

  • @aj.arunkumar
    @aj.arunkumar 6 місяців тому +1

    super awesome

  • @mtvspec
    @mtvspec 24 дні тому +1

    а как выглядит в этом подходе конфигурация роутера? или все компоненты сразу импортируются, а дальше с помощью @defer решается когда их загружать с сервера?

    • @DecodedFrontend
      @DecodedFrontend  23 дні тому

      Роутер не участвует в этом процессе вообще. Триггеры блока @defer инициализируют ленивую загрузку.

  • @XINTSUAI
    @XINTSUAI 3 місяці тому

    How the @loading, @placeholder etc... knows which component they are waiting, since I can have multiple instances of the same "section"?

  • @flywheel56
    @flywheel56 10 місяців тому

    Well done!

  • @stickyamp5996
    @stickyamp5996 3 місяці тому

    I always get confused about how angular projects, and frontend in general is deployed/retrieved by the use , i mean, there is a server that sends chunks and the user receive those chunks and the browser generate the js to create the spa functionality, but then comes in server side rendering and SSG and it gets a bit confusing to get the whole picture of what is happening, do you have a video talking about that? or could you do one? I like your advanced-oriented way of making angular videos.

  • @ankurmishra8543
    @ankurmishra8543 2 місяці тому

    If we use Heavycomponent in import section of app component, then is it not contained in bundle size of app component? If yes then how defer is benifit?

  • @TuấnTàiĐặng-c7p
    @TuấnTàiĐặng-c7p 10 місяців тому

    What a great lesson. Can you give me the source of this?

  • @eglimaja2549
    @eglimaja2549 7 місяців тому

    is this aplication SSR? I have a problem with @loading , doesn't show the content inside loading for example
    @defer {

    }
    @placeholder {
    Waiting...
    }
    @loading {

    }
    @error {
    Couldn't access this component
    }
    and the loading component it is shown only if i let outside @loading block

  • @loko1944
    @loko1944 10 місяців тому

    In regards to seo. As long as there is no user interaction required to load this should be visible for google, right?

  • @anon5992
    @anon5992 10 місяців тому +1

    and react is still stuck with some random hooks from 2018

  • @azelsky
    @azelsky 3 місяці тому

    what is the difference between "when" and "prefetch when"? Why do I need "prefetch when" if I could load content by just "when"?

  • @MK-we4dl
    @MK-we4dl 10 місяців тому

    It also works with any blocks, i use it with )

  • @orjerby1
    @orjerby1 10 місяців тому +2

    Isn't Deferrable Views in developer preview?

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +3

      Good question. I heard also that it was in dev preview but probably not anymore because I didn't find any mentions about that on the official documentation here - angular.dev/guide/defer

  • @jonatabiondiJsLover
    @jonatabiondiJsLover 10 місяців тому +1

    Super

  • @mitterkit
    @mitterkit 6 місяців тому

    Fc from thailand

  • @danieldouglas210
    @danieldouglas210 9 місяців тому

    I like this feature, but I am worried that Angular templates will soon start looking like php wordpress template with a lot of logic embedded in the views.

  • @programandoprogramas-pp4565
    @programandoprogramas-pp4565 7 місяців тому +2

    One of the best videos on Deferrable Views, thank you! 😊😊

  • @orjerby1
    @orjerby1 10 місяців тому +1

    Isn't Deferrable Views in developer preview?

    • @DecodedFrontend
      @DecodedFrontend  10 місяців тому +1

      Good question. I heard also that it was in dev preview but probably not anymore because I didn't find any mentions about that on the official documentation here - angular.dev/guide/defer