Skip to content

Commit 6357ef1

Browse files
Trotttargos
authored andcommitted
doc: document considerations for inclusion in core
Document the things that are considered when making the determination as to whether something should or shouldn't be in core. This does not (yet, at least) attempt to address *how* to include modules in core. (Should it be in the Node.js code base or vendored in from a separate repository?) It is limited to *whether* something should be in core or not. Closes: nodejs/TSC#1041 PR-URL: #40338 Fixes: nodejs/TSC#1041 Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent ef1ace7 commit 6357ef1

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

doc/guides/modules-in-core.md

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

0 commit comments

Comments
 (0)