You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Geoffrey Booth <[email protected]>
Reviewed-By: Jacob Smith <[email protected]>
Reviewed-By: Yagiz Nizipli <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
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 number
Diff line number
Diff line change
@@ -704,18 +704,17 @@ is provided below to assist with ecosystem coordination.
704
704
705
705
*`"types"` - can be used by typing systems to resolve the typing file for
706
706
the given export. _This condition should always be included first._
707
-
*`"deno"` - indicates a variation for the Deno platform.
708
707
*`"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._
712
708
*`"development"` - can be used to define a development-only environment
713
709
entry point, for example to provide additional debugging context such as
714
710
better error messages when running in a development mode. _Must always be
715
711
mutually exclusive with `"production"`._
716
712
*`"production"` - can be used to define a production environment entry
717
713
point. _Must always be mutually exclusive with `"development"`._
718
714
715
+
For other runtimes, platform-specific condition key definitions are maintained
716
+
by the [WinterCG][] in the [Runtime Keys][] proposal specification.
717
+
719
718
New conditions definitions may be added to this list by creating a pull request
720
719
to the [Node.js documentation for this section][]. The requirements for listing
721
720
a new condition definition here are that:
@@ -729,6 +728,10 @@ a new condition definition here are that:
729
728
benefit to the ecosystem that wouldn't otherwise be possible. For example,
730
729
this would not necessarily be the case for company-specific or
731
730
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.
732
735
733
736
The above definitions may be moved to a dedicated conditions registry in due
734
737
course.
@@ -1325,6 +1328,8 @@ This field defines [subpath imports][] for the current package.
1325
1328
[ES module]: esm.md
1326
1329
[ES modules]: esm.md
1327
1330
[Node.js documentation for this section]: https://github.com/nodejs/node/blob/HEAD/doc/api/packages.md#conditions-definitions
0 commit comments