Skip to content
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

Split dynamic import into its own page #17402

Merged
merged 4 commits into from
Jun 20, 2022
Merged

Conversation

Josh-Cena
Copy link
Member

@Josh-Cena Josh-Cena commented Jun 18, 2022

Summary

Motivation

Fix #10550

Dynamic import and static imports are very different: the former is an expression, the latter is a declaration. Dynamic imports are allowed in non-modules. Dynamic imports allow arbitrary expressions as specifiers. All these differences make it reasonable to split them into two pages.

Supporting details

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@Josh-Cena Josh-Cena requested a review from a team as a code owner June 18, 2022 07:04
@Josh-Cena Josh-Cena requested review from teoli2003 and removed request for a team June 18, 2022 07:04
@github-actions github-actions bot added the Content:JS JavaScript docs label Jun 18, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 18, 2022

Preview URLs

Flaws

Note! 2 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Web/JavaScript/Reference/Operators/import
Title: import
on GitHub
Flaw count: 1

  • bad_bcd_queries:
    • No BCD data for query: javascript.operators.import

External URLs

URL: /en-US/docs/Web/JavaScript/Reference/Statements/import
Title: import
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Statements/export
Title: export
on GitHub

No new external URLs


URL: /en-US/docs/Web/JavaScript/Reference/Operators/import
Title: import
on GitHub

No new external URLs

(this comment was updated 2022-06-18 07:59:54.835618)

- Reference
- dynamic import
- import
browser-compat: javascript.operators.import
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this also needs work from BCD to split the compat table?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is a good idea. I've added a few comments and suggestions.

@Josh-Cena Josh-Cena requested a review from teoli2003 June 18, 2022 07:19
@teoli2003
Copy link
Contributor

Looks good to me. Let's wait until the PR for bcd is created before formally reviewing and merging this.

@Josh-Cena
Copy link
Member Author

I also noticed import.meta is in "statements & declarations" instead of "expressions & operators". I will follow-up since that one requires BCD refactor as well.

@queengooborg
Copy link
Collaborator

BCD PR has now been merged!

@teoli2003
Copy link
Contributor

Thank you

@teoli2003 teoli2003 merged commit d2b5012 into mdn:main Jun 20, 2022
@Josh-Cena Josh-Cena deleted the dynamic-import branch June 20, 2022 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with "import": import is not a statement but a declaration
3 participants