Learn Dynamic Module Imports In 11 Minutes

Learn Dynamic Module Imports In 11 Minutes

Web Dev Simplified

2 года назад

140,006 Просмотров

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


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

Hendratara Pratama
Hendratara Pratama - 11.11.2023 15:37

why so m any 'adming' typo in there -_

Ответить
Erick Perez
Erick Perez - 04.11.2023 09:09

Great tutorial! I immediately starting using dynamic module importing in my work project after watching this. Thank you!

Ответить
FragmentJS - Framework
FragmentJS - Framework - 22.10.2023 21:17

FragmentJS uses the term WYNWYG or simply means, What You Need is What You Got. But they I mean me, still not satisfied, so I change it to, WYNWGLUWS or What You Need is What You Got Later Until We are Sure. 😂

Ответить
Alfi Artya Diwanda
Alfi Artya Diwanda - 19.10.2023 16:40

Your explanation for the translation example just blow my mind! Thank you so much Kyle, always delivering good explanation

Ответить
offset
offset - 29.09.2023 12:48

what the difference between this and react.lazy ?
they both used to avoid immediately importing a component but what the diff ?

Ответить
DisturbedNeo
DisturbedNeo - 11.06.2023 20:46

Only one note, and that's just that the abbreviation for Spanish is "es", as in "España", not "sp"

Ответить
zaki dzz
zaki dzz - 31.05.2023 18:32

problm here with translations is that console .log is function scoped....i need the trnaslations globally

Ответить
Veerapat Boonkerd
Veerapat Boonkerd - 26.05.2023 11:48

very clear explanation and easy to understand with sample. thx.

Ответить
m12652
m12652 - 09.05.2023 21:41

Nice!

Ответить
Akshay Gadekar
Akshay Gadekar - 17.04.2023 20:08

But what if whichever file we imported as request is getting used in another component as well, there we will do import request again? Then better be it in bundler itself

Ответить
Belal Zewain
Belal Zewain - 05.04.2023 05:42

Ответить
Леопольд Погоди
Леопольд Погоди - 16.03.2023 11:54

Ужасно.

Ответить
Anatoly Dyatlov
Anatoly Dyatlov - 10.12.2022 17:32

Right, but wouldn't that slow down the app after the initial load? I mean, when you don't use dynamic imports, everything is imported after the initial page load - all the components and dependencies. This, of course, can make the initial load slower, but the browser won't have to download anything else after that. With dynamic imports, you're reducing the time of the initial page load, but at the cost of downloading each component when it is needed later, effectively decreasing the responsiveness of your app. Am I correct?

Ответить
Jimmy Nguyen
Jimmy Nguyen - 29.11.2022 21:40

could someone help me figure out why code gives me an "node_modules/chalk/source/index.js not supported.
Instead change the require of index.js in null to a dynamic import() which is available in all CommonJS modules."

I'm on v5 of chalk which supports ESM, but I don't know how to configure my project to get it to work....

"type": module would still give an error :(

Ответить
Robert R
Robert R - 03.10.2022 08:56

What is that "adming" thing that Kyle constantly wants to write instead of "admin"? Is it secret marketing for a new product? :)

Ответить
Raye
Raye - 02.10.2022 09:44

謝謝分享!!

Ответить
Matheus Soares
Matheus Soares - 21.09.2022 15:56

thanks

Ответить
Sagar S
Sagar S - 19.09.2022 16:23

One drawback of dynamic import is that Tree shaking is not possible so if you are loading big module, bundler will load all exports from the module. But yes we can eliminate loading of unnecessary modules. That's a big benefit.

Ответить
Kang Wei
Kang Wei - 17.09.2022 15:32

does async works in forEach? I thought it only works in for loop

Ответить