This repository has been archived by the owner on Sep 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
248fff2
commit 6569081
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# What is a Minimal Kernel for ESM in Node.js? | ||
|
||
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 | ||
|
||
# Why build a Minimal Kernel? | ||
|
||
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. | ||
|
||
# What is our minimal kernel | ||
|
||
* both browser + node need bare imports | ||
- implementation to be discussed | ||
* we cannot have dynamic path searching | ||
- requiring the full path is an issue for tooling and a long term solution is required | ||
- migration strategies also have issue with this | ||
* common.js backwards compat | ||
- createRequireFunction does | ||
- import.meta.require does not fail early enough | ||
- hold off on importing common.js until more progress is made on dynamic modules spec | ||
* .mjs will be the only way to import ESM | ||
- intention is to move forward with format databases to map extensions and support multiple use cases | ||
* only supporting importing ESM | ||
- no JSON | ||
- no native modules | ||
- createRequireFunction used to get these | ||
- will come back with format database | ||
|
||
# How will we implement the minimal kernel | ||
|
||
* removing importing of formats other than ESM | ||
- no common.js | ||
- no JSON | ||
- no nativemodules | ||
* removing of dynamic path searching | ||
- no extension adding | ||
- no directory resolution | ||
- no support for index.js | ||
- still maintaining support for the main field | ||
* adding createRequireFunction | ||
|
||
|