Why your app may need lazy loading

Why your app may need lazy loading

Web Dev Cody

7 месяцев назад

8,676 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@_earnyourkeep
@_earnyourkeep - 21.11.2023 17:24

Great stuff. It’s funny, I was just thinking about this the other day. All I have to do is type “nba” or “nfl”, and it populates all of the scores for the recent games.

Ответить
@rampandey191
@rampandey191 - 19.11.2023 17:49

Why is the widget component a client component?

Ответить
@wangyifei5431
@wangyifei5431 - 17.11.2023 07:53

Amazing content as always, and thanks for sharing everything.

I am also wondering if there's any chance to have some content about 'Front-End' testing?...

Ответить
@fatihece3359
@fatihece3359 - 16.11.2023 19:53

Thanks for you great effort for teaching us new things  sir

Ответить
@read-the-docs
@read-the-docs - 16.11.2023 01:09

Oh cool! I was using the dynamic import with the {SSR: false} option, I didn't think about this use case!
But what if the dynamic condition is always true, does it hurt performance to have it dynamic even if it's server-side rendered ?

Ответить
@jlnpt5071
@jlnpt5071 - 15.11.2023 22:46

but can you have a still have a fallback with the nextjs dynamic?

Ответить
@Redyf
@Redyf - 15.11.2023 22:27

What colorscheme is that on vscode? looks great

Ответить
@youssefaserrar2001
@youssefaserrar2001 - 15.11.2023 20:05

Quick and helpful, Thanks

Ответить
@SeibertSwirl
@SeibertSwirl - 15.11.2023 19:43

You’re amazing ❤

Ответить
@amershboul9107
@amershboul9107 - 15.11.2023 19:23

amazing content

Ответить
@balajibalamurugan8053
@balajibalamurugan8053 - 15.11.2023 18:25

If anyone wonders how to do this in angular, the new angular version 17 has @defer block which does the lazy loading for you, it's super easy

Ответить
@eshw23
@eshw23 - 15.11.2023 17:32

I thought Next lazy loads the entire SPA automatically for different routes. I didnt even know this component lazy loading also existed. Thanks!

Ответить
@orcdev
@orcdev - 15.11.2023 17:19

Lazy loading really powerful to improve the initial loading performance! Thanks for this one Cody!

Ответить
@darialyphia
@darialyphia - 15.11.2023 17:14

Good ol' 3Mb calculator
There is actually a ton of things you can use lazy loading for. Basically anything that doesnt appear immediately on the page is a good candidate for lazy loading, wether it is modals, tabs content, etc. You can even setup to lazy import content that is below the fold when they're about to come into the viewport.

Be aware though that overdoing it can do more harm than good. I once worked on an app where EVERY component was lazy loaded, and it created these horrid waterfall effects of js imports and the UI being built in awkward chunks.

Ответить