Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2a403cd

Browse filesBrowse files
jcbhmrRafaelGSS
authored andcommitted
doc: link to Runtime Keys in export conditions
This commit: 1. Adds a link to the WinterCG Runtime Keys proposal draft spec in the documentation for the `export` condition. 2. Adds a criteria to add more export conditions to the Node.js docs: they should be Node.js core-relevant. 3. Removes the "deno" and "react-native" export conditions from the core docs with the expectation that readers will follow the link to the Runtime Keys proposal draft spec to learn about them and more. PR-URL: #48408 Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Jacob Smith <jacob@frende.me> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6c59083 commit 2a403cd
Copy full SHA for 2a403cd

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/packages.md‎

Copy file name to clipboardExpand all lines: doc/api/packages.md
+9-4Lines changed: 9 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -704,18 +704,17 @@ is provided below to assist with ecosystem coordination.
704704

705705
* `"types"` - can be used by typing systems to resolve the typing file for
706706
the given export. _This condition should always be included first._
707-
* `"deno"` - indicates a variation for the Deno platform.
708707
* `"browser"` - any web browser environment.
709-
* `"react-native"` - will be matched by the React Native framework (all
710-
platforms). _To target React Native for Web, `"browser"` should be specified
711-
before this condition._
712708
* `"development"` - can be used to define a development-only environment
713709
entry point, for example to provide additional debugging context such as
714710
better error messages when running in a development mode. _Must always be
715711
mutually exclusive with `"production"`._
716712
* `"production"` - can be used to define a production environment entry
717713
point. _Must always be mutually exclusive with `"development"`._
718714

715+
For other runtimes, platform-specific condition key definitions are maintained
716+
by the [WinterCG][] in the [Runtime Keys][] proposal specification.
717+
719718
New conditions definitions may be added to this list by creating a pull request
720719
to the [Node.js documentation for this section][]. The requirements for listing
721720
a new condition definition here are that:
@@ -729,6 +728,10 @@ a new condition definition here are that:
729728
benefit to the ecosystem that wouldn't otherwise be possible. For example,
730729
this would not necessarily be the case for company-specific or
731730
application-specific conditions.
731+
* The condition should be such that a Node.js user would expect it to be in
732+
Node.js core documentation. The `"types"` condition is a good example: It
733+
doesn't really belong in the [Runtime Keys][] proposal but is a good fit
734+
here in the Node.js docs.
732735

733736
The above definitions may be moved to a dedicated conditions registry in due
734737
course.
@@ -1325,6 +1328,8 @@ This field defines [subpath imports][] for the current package.
13251328
[ES module]: esm.md
13261329
[ES modules]: esm.md
13271330
[Node.js documentation for this section]: https://github.com/nodejs/node/blob/HEAD/doc/api/packages.md#conditions-definitions
1331+
[Runtime Keys]: https://runtime-keys.proposal.wintercg.org/
1332+
[WinterCG]: https://wintercg.org/
13281333
[`"exports"`]: #exports
13291334
[`"imports"`]: #imports
13301335
[`"main"`]: #main

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.