Skip to content
This repository was archived by the owner on Sep 2, 2023. It is now read-only.

Commit 6569081

Browse files
committed
doc: first pass at minimal-kernel
1 parent 248fff2 commit 6569081

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

doc/minimal-kernel.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# What is a Minimal Kernel for ESM in Node.js?
2+
3+
A minimal kernel is a subset of features that the @nodejs/modules group have agreed will be necessary for all potential iterations of our ESM implementation. It strips out any features that preclude other features
4+
5+
# Why build a Minimal Kernel?
6+
7+
Having a minimal kernel creates a subset that we can build consensus on top of. It will also allow sharing features across proposals that potentially have different end goals and feature sets. Finally, reaching consensus on a minimal kernel is a win for the team, showing that we do indeed have a layer of consensus even if it is not entirely clear.
8+
9+
# What is our minimal kernel
10+
11+
* both browser + node need bare imports
12+
- implementation to be discussed
13+
* we cannot have dynamic path searching
14+
- requiring the full path is an issue for tooling and a long term solution is required
15+
- migration strategies also have issue with this
16+
* common.js backwards compat
17+
- createRequireFunction does
18+
- import.meta.require does not fail early enough
19+
- hold off on importing common.js until more progress is made on dynamic modules spec
20+
* .mjs will be the only way to import ESM
21+
- intention is to move forward with format databases to map extensions and support multiple use cases
22+
* only supporting importing ESM
23+
- no JSON
24+
- no native modules
25+
- createRequireFunction used to get these
26+
- will come back with format database
27+
28+
# How will we implement the minimal kernel
29+
30+
* removing importing of formats other than ESM
31+
- no common.js
32+
- no JSON
33+
- no nativemodules
34+
* removing of dynamic path searching
35+
- no extension adding
36+
- no directory resolution
37+
- no support for index.js
38+
- still maintaining support for the main field
39+
* adding createRequireFunction
40+
41+

0 commit comments

Comments
 (0)