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

doc: define "browser", "production", "development" conditions #36856

Closed
wants to merge 9 commits into from

Conversation

guybedford
Copy link
Contributor

As per recent conversations, this updates the conditions documentation to include a new Conditions Definitions section that defines the "browser", "production" and "development" conditions.

In terms of implemenation, we could possible add a simple validation that "production" and "development" are mutually exclusive when used in Node.js, but that could be a separate PR.

An alternative to the above would be to move these definitions to another home or location, which I'm completely open to as well.

In addition I've added some guidance on conditions defintions process, whether or not Node.js should be the primary home for this but as the original definition source of the "exports" field we can at least start the conversation here on this.

//cc @nodejs/modules @devongovett @sokra @developit

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jan 9, 2021
doc/api/packages.md Outdated Show resolved Hide resolved
doc/api/packages.md Outdated Show resolved Hide resolved
guybedford and others added 2 commits January 9, 2021 11:09
Co-authored-by: Jordan Harband <ljharb@gmail.com>
doc/api/packages.md Outdated Show resolved Hide resolved
@bmeck
Copy link
Member

bmeck commented Jan 11, 2021

This seems fine, but I'm not really hoping to add runtime checks for if a list of conditions is considered valid.

@guybedford
Copy link
Contributor Author

This seems fine, but I'm not really hoping to add runtime checks for if a list of conditions is considered valid.

Sure, I don't mind skipping adding those validations.

doc/api/packages.md Outdated Show resolved Hide resolved
doc/api/packages.md Show resolved Hide resolved
doc/api/packages.md Show resolved Hide resolved
guybedford and others added 3 commits January 11, 2021 17:40
Co-authored-by: Geoffrey Booth <456802+GeoffreyBooth@users.noreply.github.com>
@guybedford
Copy link
Contributor Author

Landed in 088a7e5.

@guybedford guybedford closed this Jan 12, 2021
guybedford added a commit that referenced this pull request Jan 12, 2021
Defines the above exports conditions by convention
as well as some guidance for further conditions
definitions in future

PR-URL: #36856
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@guybedford guybedford deleted the conditions branch January 12, 2021 21:55
danielleadams pushed a commit that referenced this pull request Jan 13, 2021
Defines the above exports conditions by convention
as well as some guidance for further conditions
definitions in future

PR-URL: #36856
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@danielleadams danielleadams mentioned this pull request Jan 13, 2021
targos pushed a commit that referenced this pull request May 1, 2021
Defines the above exports conditions by convention
as well as some guidance for further conditions
definitions in future

PR-URL: #36856
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
@danielleadams danielleadams mentioned this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants