-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
doc: rephrase dynamic import() description #59224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Review requested:
|
doc/api/esm.md
Outdated
@@ -334,8 +334,13 @@ fs.readFileSync === readFileSync; | |||
|
|||
## `import()` expressions | |||
|
|||
[Dynamic `import()`][] is supported in both CommonJS and ES modules. In CommonJS | |||
modules it can be used to load ES modules. | |||
[Dynamic `import()`][] provides a dynamic and asynchronous way to import modules, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sould we also document that dynamic import()
is dynamic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. I agree that the name dynamic import()
is self-explanatory. I'll go ahead and remove that part to avoid redundancy.
The description is updated to clarify that dynamic import() is asynchronous, dynamic, and works in both CJS and ESM contexts. The new phrasing also avoids implying it is the only method for loading ES modules in CommonJS. Fixes: nodejs#59077
Hi, @AugustinMauroy, I have opened a PR to address the issue you reported #59077. Your feedback and review on the changes would be greatly appreciated. Thanks! |
For me it's okay but let's wait what loader said |
The description is updated to clarify that dynamic import() is asynchronous, dynamic, and works in both CJS and ESM contexts. The new phrasing also avoids implying it is the only method for loading ES modules in CommonJS.
Fixes: #59077