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
doc: first pass at minimal-kernel #180
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a40b8a9
doc: first pass at minimal-kernel
MylesBorins aa9a20b
Edit of minimal kernel doc (#2)
GeoffreyBooth 3632b6a
fixup: update to point to new pr
MylesBorins 8bf0a5a
fixup: minor tweaks
MylesBorins b50ad7e
fixup: remove vm + loader as per jdd
MylesBorins efa87ef
fixup: explicitly mention builtins
MylesBorins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,44 @@ | ||
# 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. | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
|
||
# What is our minimal kernel | ||
|
||
* both browser + node need bare imports | ||
- implementation to be discussed | ||
* we cannot have dynamic path searching | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
- 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 | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
- 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 | ||
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong. |
||
- no JSON | ||
- no native modules | ||
- createRequireFunction used to get these | ||
- will come back with format database | ||
* import.meta.url | ||
* dynamic import | ||
|
||
# How will we get from where we are to the minimal kernel | ||
|
||
* removing importing of formats other than ESM | ||
- no common.js | ||
- no JSON | ||
- no native modules | ||
- implemented in https://github.com/nodejs/ecmascript-modules/pull/3 | ||
* removing of dynamic path searching | ||
- no extension adding | ||
- no directory resolution | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
- no support for index.js | ||
- still maintaining support for the main field | ||
- implemented in https://github.com/nodejs/ecmascript-modules/pull/2 | ||
* adding createRequireFunction | ||
- implemented in https://github.com/nodejs/node/pull/19360 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as off-topic.
Sorry, something went wrong.