-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: import() #17395
doc: import() #17395
Conversation
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.
Change LGTM although I'd like it even more with the little nit I left addressed.
doc/api/esm.md
Outdated
@@ -33,15 +33,14 @@ node --experimental-modules my-app.mjs | |||
### Supported | |||
|
|||
Only the CLI argument for the main entry point to the program can be an entry | |||
point into an ESM graph. In the future `import()` can be used to create entry | |||
points into ESM graphs at run time. | |||
point into an ESM graph. `import()` can also be used to create entry points |
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.
Non-blocking nit: I know this was in the original text, but import
is a statement and not a function so the ()
should be removed. Same on line 43.
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.
should I just say "dynamic import" then? the majority of the community refers to it as import()
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.
Maybe leave it alone then. (Hey, I said it was non-blocking!) I see that even the TC39 proposal uses import()
and refers to it as "function-like". https://github.com/tc39/proposal-dynamic-import
doc/api/esm.md
Outdated
point into an ESM graph. In the future `import()` can be used to create entry | ||
points into ESM graphs at run time. | ||
point into an ESM graph. Dynamic import can also be used to create entry points | ||
into ESM graphs at run time. |
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.
Only with an additional CLI flag --harmony_dynamic_import
.
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.
like i said in the first comment, this might need to wait until that flag goes away, but i can doc it as being available from there also
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.
I'd go for documenting it as it is to get this in right now.
PR-URL: nodejs#17395 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Landed in 11ebaff |
PR-URL: #17395 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This should be backported in #17823 |
This landed too soon on v9.x. See #18202. |
I don't know if this should wait until
import()
is out from behind its own flag, but the change will need to happen at some point so here it is.Checklist
Affected core subsystem(s)