-
Notifications
You must be signed in to change notification settings - Fork 22.9k
added await-import examples for importing json modules #41773
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
Conversation
I added the await-import syntax for completeness sake, I believe this syntax is likely to be used in the await-import syntax much more as compared to it's use on the top-level (I can be mistaken), due to it being simpler compared to fetching an object and converting it into json
…dex.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
more stuff needs to be added via @jakearchibald 's article, because the behavior here isn't what one would want, tagging that here https://jakearchibald.com/2025/importing-vs-fetching-json/ also thanks jake for writing the article |
Improved it, with comments on differences between fetch and await-import
|
okay, corrected it :) |
files/en-us/web/javascript/reference/statements/import/with/index.md
Outdated
Show resolved
Hide resolved
files/en-us/web/javascript/reference/statements/import/with/index.md
Outdated
Show resolved
Hide resolved
…dex.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
|
Preview URLs
Flaws (2)Note! 2 documents with no flaws that don't need to be listed. 🎉 URL:
(comment last updated: 2025-11-02 02:47:08) |
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. I moved your addition to "examples" because "description" talks about the semantics of this feature while this is how you can use this feature. I also added the same kind of example to the other two relevant pages.
Description
I added the await-import syntax for completeness sake, I believe this syntax is likely to be used in the await-import syntax much more as compared to it's use on the top-level (I can be mistaken), due to it being simpler compared to fetching an object and converting it into json
Motivation
I suspect people are far more likely to use the await-import syntax as a replacement to fetch() due to fewer lines of code, as opposed to using import at the top level
Additional details
this simply adds the same top-level import specifications as await-imports as well
so for example
can also be