FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc: clarify that import also uses main by benmccann · Pull Request #41720 · nodejs/node · GitHub

/ node Public

doc: clarify that import also uses main - #41720

Merged
nodejs-github-bot merged 5 commits into
nodejs:masterfrom
benmccann:main-import
Jan 30, 2022
Merged

doc: clarify that import also uses main#41720
nodejs-github-bot merged 5 commits into
nodejs:masterfrom
benmccann:main-import

Conversation

Copy link
Copy Markdown
Contributor

The docs currently make it sound like main is only used when a package is included via require(). However, if you import a package, it still uses the main field

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules

nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jan 27, 2022
benmccann changed the title docs: clarify that import also uses main doc: clarify that import also uses main Jan 27, 2022

ljharb commented Jan 27, 2022

Copy link
Copy Markdown
Member

LGTM

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Currently the link and the example only applies to require() (import does not support folders as modules).
I agree we should make it clearer that it defines the package entry point if there are no "exports" field, but maybe in a different paragraph.

Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've attempted to reword it. Let me know what you think

aduh95 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the new version. A few suggestions:

Comment thread doc/api/packages.md Outdated
Comment thread doc/api/packages.md Outdated
benmccann and others added 2 commits January 28, 2022 08:27
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>

aduh95 commented Jan 28, 2022

Copy link
Copy Markdown
Contributor

Can you please remove this paragraph?

node/doc/api/packages.md

Lines 1109 to 1110 in 1f964a5

When a package has an [`"exports"`][] field, this will take precedence over the
`"main"` field when importing the package by name.

It's repeated from 10 lines above:

node/doc/api/packages.md

Lines 1099 to 1100 in 1f964a5

When a package has an [`"exports"`][] field, this will take precedence over the
`"main"` field when importing the package by name.

Copy link
Copy Markdown
Contributor Author

done

aduh95 added author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. labels Jan 28, 2022
Mesteery added the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Jan 30, 2022
nodejs-github-bot merged commit 253f934 into nodejs:master Jan 30, 2022

Copy link
Copy Markdown
Collaborator

Landed in 253f934

benmccann deleted the main-import branch January 30, 2022 17:13
ruyadorno pushed a commit that referenced this pull request Feb 8, 2022
PR-URL: #41720
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 2, 2022
PR-URL: #41720
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 3, 2022
PR-URL: #41720
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this pull request Mar 14, 2022
PR-URL: #41720
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no outstanding review comments, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. doc Issues and PRs related to the documentations.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants


Back | FazBrowse Home | New Git URL