Code Splitting in React JS - Lazy Loading Performance Optimization

Поделиться
HTML-код
  • Опубликовано: 28 май 2024
  • #lazyloading #react #ReactJS
    Our React JS Apps use tools like webpack to efficiently bundle all of our code in a minified format, but this doesn’t always guarantee the optimisation of performance.
    So in this video, we use something called lazy loading, which is the part of this code splitting process to optimise our cryptocurrency tracker app.
    👉 Cryptocurrency Tracker with React JS -
    • Cryptocurrency Tracker...
    👩‍💻 Source Code -
    github.com/piyush-eon/react-c...
    ⭐ Support the channel by becoming member and learn from me one on one -
    / @roadsidecoder
    🌎 Live Site -
    crypto-hunter.netlify.app/
    🔗 MERN Stack Tutorial with Redux -
    • MERN Stack Project Tut...
    🔗 React Beginner's Project Tutorials -
    • React JS Project Tutor...
    -------------------------------------------------------------------------
    00:00 Intro
    01:38 Project Setup
    02:35 Lighthouse Performance Report ( Before )
    03:14 What is Code Splitting?
    03:59 React.lazy()
    04:59 Using Suspense to add fallback UI
    06:34 Error Boundaries
    11:53 Route Based Code Splitting
    14:54 Lighthouse Performance Report ( After )
    15:49 Do this for goodluck
    -------------------------------------------------------------------------
    Special Thanks to our members -
    Tikorz GamePlace

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

  • @Android-17
    @Android-17 Год назад +1

    Thank you for explaining the error boundary part.
    Excellent video!

  • @soumyadeepdawn481
    @soumyadeepdawn481 Год назад +1

    Hey. Seriously. Thank you. I just downloaded soft and I can CLEARLY see why your vid was recomnded. You're an aweso intro into

  • @VishalKumar-mi6ed
    @VishalKumar-mi6ed 6 месяцев назад

    The way you have explained the things is really nice, you just gained a new subscriber ❤

  • @adityaakhare3519
    @adityaakhare3519 Год назад

    thnx a lot for lazy loading and error boundary concept i am gonna implementing this to my project

  • @ayushjain7023
    @ayushjain7023 2 года назад +2

    Videos like these are really helpful and the way you have explained the things is really nice, you just gained a subscriber ❤️

  • @GarmrZero13
    @GarmrZero13 Год назад +7

    I've implemented lazy and suspense into some of my projects before, but i never head of the error boundary. Big thanks for explaining it!

    • @vp351
      @vp351 Год назад

      but what if we want to load the component after specific time for example 5 sec.. bcoz lazy loading does not provide that feature..

    • @keyjeyelpi
      @keyjeyelpi 9 месяцев назад

      ​@@vp351well, it is still possible though. You could create a boolean that turns true after 5 seconds, which will in turn, load the lazy loaded component after 5 seconds.

  • @gideonmanasa3193
    @gideonmanasa3193 2 года назад

    Great video thanks 🙌🏾🙌🏾🙌🏾

  • @mattoattacko
    @mattoattacko 2 года назад

    Video was very helpful. Thanks mate

  • @Dev-Phantom
    @Dev-Phantom Год назад +1

    very conceptual , maza aa gaya

  • @muzamillkhan9747
    @muzamillkhan9747 2 года назад

    Thanks man keep posting these kind of videos..

  • @eminresulzade2444
    @eminresulzade2444 Год назад

    Thank u so much man great video.
    I had a question.Is it ok to add react lazy to all components?

  • @viktorkasap
    @viktorkasap Год назад

    Cool, but what can we do if we need to keep the previous content before loading the next one? I mean, you click on a nav link, then a progress bar shows the loading process while the content is still on the page. After the next page content loads, the old content is replaced with the new content.

  • @anto_deejay
    @anto_deejay Год назад

    nice tuto Thank you!

  • @Lohitpant
    @Lohitpant 2 года назад +5

    I was asked Code Splitting in an interview.

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

    Bhai, then with webpack also we can do code splitting?

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

    aap purush nahi ho, punya purosh ho, excellent

  • @ashish_prajapati_tr
    @ashish_prajapati_tr 2 года назад +5

    i am already using it for long time.
    it's amazing

    • @RoadsideCoder
      @RoadsideCoder  2 года назад +2

      That's Great!

    • @fffooccc9801
      @fffooccc9801 2 года назад

      @@RoadsideCoder BHAIYA APKA VS CODE KA LAYOUT SETTING ACHA HAI SHARE KR SAKTE HO KAISE APPLY KIYA?

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      For theme, I use peacock extension

    • @fffooccc9801
      @fffooccc9801 2 года назад

      @@RoadsideCoder and font?

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Default

  • @nestorcanales2341
    @nestorcanales2341 2 года назад

    great video, but can you use it in a SSR using react, webpack, babel please

  • @A9kit.k
    @A9kit.k 2 года назад

    Great brother 👏🏻👏🏻

  • @vp351
    @vp351 Год назад

    but what if we want to load the component after specific time for example 5 sec.. bcoz lazy loading does not provide that feature..

  • @arcadan
    @arcadan Год назад

    I wonder why my routes is not getting splitted when i run build, it seems the same as not using lazy strategy, has someone faced the same as me? would someone tell me what could be the problem? (im using react 17, and its CRA)

  • @v1xbetlive531
    @v1xbetlive531 Год назад

    i have watched your video and it is very helpful for me, i have cloned the code but banner.js and homepage is not importing and output is not displaying what should i do please help for my intership

  • @roxxman3484
    @roxxman3484 2 года назад

    Bro how to safeguard our web servers like in MERN stack from Slow Loris attack or some other attacks like Ddos and something?

  • @ViewerGaunt
    @ViewerGaunt Год назад +2

    I don't think you're testing the same endpoints for both lighthouse tests.
    / Vs / coins...

  • @TravelwithPujarini
    @TravelwithPujarini 2 года назад +2

    Great video. 🔥

  • @technicalspot1848
    @technicalspot1848 Год назад

    Bhai issue. Yeh hai ki code spllitted compnets lod hi nahi hote toh kya kre

  • @roopeshsingh3211
    @roopeshsingh3211 2 года назад

    Amazing teaching

  • @rohanthakran4225
    @rohanthakran4225 Год назад +1

    Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.

  • @mukurpuri4966
    @mukurpuri4966 Год назад

    Amazing !!

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

    Thanks

  • @aniketshukla6095
    @aniketshukla6095 Год назад

    All the best,

  • @ahmadfaraz3678
    @ahmadfaraz3678 2 года назад +1

    Helpful video

  • @chineduabalogu
    @chineduabalogu Год назад

    Appreciate you for this video! more grease to your elbows

  • @sumitkumardey3268
    @sumitkumardey3268 7 дней назад

    Great

  • @ravi_verma31
    @ravi_verma31 Год назад

    great

  • @thedullilama6767
    @thedullilama6767 2 года назад

    You are awesome

  • @regilearn2138
    @regilearn2138 2 года назад +1

    please do a MERN stack project with typescript

  • @HSBTechYT
    @HSBTechYT 2 года назад +6

    Another reason to use next js instead of react js 🙏

  • @PIYUSH-lz1zq
    @PIYUSH-lz1zq 2 года назад +1

    Bhaiya can you provide us MERN stack interview questions sheet 🖤

  • @sanjeevchaurasia4819
    @sanjeevchaurasia4819 2 года назад

    Can we lazy load a context? Like component

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Probably not

    • @emreozgun3846
      @emreozgun3846 2 года назад

      @@RoadsideCoder what about lazy loading a nested route ? (like in react-router v6)

  • @ahmadfaraz3678
    @ahmadfaraz3678 2 года назад

    Which will be the next topic?

  • @saikumargatla4706
    @saikumargatla4706 5 месяцев назад

    Infinite scrolling pe bhi ekk video banao

  • @caricatureadda3867
    @caricatureadda3867 2 года назад +1

    Nice tutorial, has react become seo friendly its showing 100% against SEO

  • @pranupranav6279
    @pranupranav6279 Год назад +1

    Wow.

    • @pranupranav6279
      @pranupranav6279 Год назад

      This is optimization is next level optimization.

  • @hamzashaikh9164
    @hamzashaikh9164 2 года назад

    Great videos 🤯🔥

  • @alexandrupruteanu6532
    @alexandrupruteanu6532 Год назад

    for me lazy,Suspense nat working.

  • @preet3167
    @preet3167 Год назад

    But I have a problem

  • @shubhamdubey9577
    @shubhamdubey9577 Год назад

    Sir ye project complete ho gya kya mujhe mere clg me meajor project me dena hai

  • @kaleeswaranb6816
    @kaleeswaranb6816 2 года назад +1

    Sir please upload olx clone tutorial

  • @niklausmikaelson7332
    @niklausmikaelson7332 2 года назад

    Bhai Redux ka tutorial bana do easy jo samjh aa jay

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Already bana rakha h.

    • @niklausmikaelson7332
      @niklausmikaelson7332 2 года назад

      @@RoadsideCoder kya lastest me mapstateprop and dispatch wala function use nhi hota hai mene codewith harry ka dekha tha usme nhi tha

    • @RoadsideCoder
      @RoadsideCoder  2 года назад

      Yes ab hum mostly functional approach use krte hai, with useSelector and useDispatch hooks.
      But u can use old approach as well.

  • @emreozgun3846
    @emreozgun3846 2 года назад

    I presume that the reason of the shitty performance is css-in-js ?

  • @streeetvlooger9744
    @streeetvlooger9744 Год назад

    sadly im with you a year later lol

  • @Dev-Phantom
    @Dev-Phantom 11 месяцев назад

    cool, very interesting

  • @v1xbetlive531
    @v1xbetlive531 Год назад

    i have watched your video and it is very helpful for me, i have cloned the code but banner.js and homepage is not importing and output is not displaying what should i do please help for my intership

  • @Saurabhkumar-ps5zp
    @Saurabhkumar-ps5zp Год назад

    Thanks

  • @mrrishiraj88
    @mrrishiraj88 2 года назад

    Thanks