Skip to content

Commit c91a9ab

Browse files
mhdawsontargos
authored andcommitted
doc: tweak guidance for modules in core
Generalize guidance so that it is not specific to modules. Signed-off-by: Michael Dawson <[email protected]> PR-URL: #40601 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 7c4f9a3 commit c91a9ab

File tree

2 files changed

+58
-55
lines changed

2 files changed

+58
-55
lines changed

doc/guides/components-in-core.md

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# To be or not to be in core
2+
3+
This document explains things to consider when deciding whether a component
4+
should be in core or not.
5+
6+
A component may be included in core as a dependency, a module, or integrated
7+
into the code base. The same arguments for including/not including in core
8+
generally apply in all of these cases.
9+
10+
## Strong arguments for including a component in core
11+
12+
1. The component provides functionality that is standardized (such as a
13+
[Web API][]) and overlaps with existing functionality.
14+
2. The component can only be implemented in core.
15+
3. The component can only be implemented in a performant way in core.
16+
4. Developer experience is significantly improved if the component is in core.
17+
5. The component provides functionality that can be expected to solve at
18+
least one common use case Node.js users face.
19+
6. The component requires native bindings. Inclusion in core enables
20+
utility across operating systems and architectures without requiring
21+
users to have a native compilation toolchain.
22+
7. Part or all of the component will also be re-used or duplicated in core.
23+
24+
## Strong arguments against including a component in core
25+
26+
1. None of the arguments listed in the previous section apply.
27+
2. The component has a license that prohibits Node.js from including it in core
28+
without also changing its own license.
29+
3. There is already similar functionality in core and adding the component will
30+
provide a second API to do the same thing.
31+
4. A component (or/and the standard it is based on) is deprecated and there is
32+
a non-deprecated alternative.
33+
5. The component is evolving quickly and inclusion in core will require frequent
34+
API changes.
35+
36+
## Benefits and challenges
37+
38+
When it is unclear whether a component should be included in core, it might be
39+
helpful to consider these additional factors.
40+
41+
### Benefits
42+
43+
1. The component will receive more frequent testing with Node.js CI and CITGM.
44+
2. The component will be integrated into the LTS workflow.
45+
3. Documentation will be integrated with core.
46+
4. There is no dependency on npm.
47+
48+
### Challenges
49+
50+
1. Inclusion in core, rather than as an ecosystem module, is likely to reduce
51+
code merging velocity. The Node.js process for code review and merging is
52+
more time-consuming than that of most separate modules.
53+
2. By being bound to the Node.js release cycle, it is harder and slower to
54+
publish patches.
55+
3. Less flexibility for users. They can't update the component
56+
when they choose without also updating Node.js.
57+
58+
[Web API]: https://developer.mozilla.org/en-US/docs/Web/API

doc/guides/modules-in-core.md

-55
This file was deleted.

0 commit comments

Comments
 (0)