question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

This is technically not a _dynamic_ import. Consider Readme update.

See original GitHub issue

Not to squabble over semantics, but a conversion from import() to require.ensure() is really not a dynamic import statement through webpack.

I’ve already started to see people saying that its possible to perform dynamic imports when that really is 0% supported by webpack (since it is only accomplished through static analysis). Since you folks are pretty well regarded in the OSS technology you publish, I just want to ensure that our webpack user base doesn’t have misguided expectations about what is possible.

With that in mind, would you consider renaming this module to be whatwg-import-webpack instead of dynamic-import-webpack?

Thanks for providing this awesome workaround to the API. You can track our github issue for implementing the native webpack support for import() as we may add additional require.ensure features. (https://github.com/webpack/webpack/issues/3098). (It will however, still be statically analyzed).

Actually as I’ve been writing this I also noticed that @domenic called the proposal [dynamic-loader] so that is fair that you would call it there.

I would be happy to PR the README to state that this doesn’t really perform truly dynamic imports, since webpack doesn’t support this.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
TheLarkInncommented, Oct 26, 2016

Awesome awesome I’ll get a PR in!!

0reactions
TheLarkInncommented, Oct 26, 2016

I totally agree as you could see my digression in the initial comment. My point is if we can any way make clear that using this for webpack doesnt result into a truly dynamic module load, then let’s do so. Less confusion => better dev exp

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do we handle dynamic specifiers (without dynamic import)?
I can think of three solutions: Explain in the documentation that one has to write the dynamic code in a commonJS module and...
Read more >
Dynamic imports using the fs module have pitfalls | ITNEXT
Dynamic imports using the fs module are not worth the complexity. A trick that saves 30 ... There is no need to update...
Read more >
Lazy loading modules : Error TS1323: Dynamic import is only ...
You are using dynamic import so you have to change your tsconfig.json like this to target your code to esnext module
Read more >
ESNext: Dynamically import ES modules with ... - Bram.us
Dynamic import () introduces a new function-like form of import , which allows one to import on demand. It returns a promise for...
Read more >
How to Dynamically Import ECMAScript Modules
You can import modules dynamically if you use import as a function — import(pathToModule) — a feature available starting ES2020.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found