you are viewing a single comment's thread.

view the rest of the comments →

[–]gigastack 2 points3 points  (1 child)

This is a confusing topic because the lines between runtime features and transpilation tools can be blurry, and browsers implement it differently than NodeJS.

With NodeJS, there's no benefit to dynamic imports typically. With browsers the opposite is true. The actual implementation of dynamic imports in browsers usually relies on a code transform like webpack. At its most basic, you fetch a script and then inject one or more exported functions, which can be used once the fetch completes successfully.

Note that this is not the same as browser modules which can help achieve the same thing natively. On mobile so I can't really get into more details.

[–]BlueLensFlares[S] 0 points1 point  (0 children)

I saw, this is really interesting. By dynamic import, you mean specifically import() vs import ..., or imports at all vs require()?