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 44
Doc: Phase 2 for new modules implementation #196
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
281f2fb
Phase 2
GeoffreyBooth 383cd86
Revisions per call with @MylesBorins, @SMotaal, @jdalton and @Geoffre…
GeoffreyBooth 77c6b6e
fixup: update with notes from meeting
MylesBorins 63ce88a
fixup: whoops
MylesBorins 1adb522
Whoops 2
GeoffreyBooth 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 |
---|---|---|
|
@@ -43,13 +43,36 @@ These features will be part of the first phase of development: | |
- No extension adding. | ||
- No directory resolution, including no support for `index.js` or `index.mjs`. | ||
- No support for `main` field for ESM. | ||
|
||
* Remove current VM implementation | ||
|
||
* Remove current Loader implementation | ||
|
||
These changes are implemented in https://github.com/nodejs/ecmascript-modules/pull/6 | ||
|
||
## Later Phases | ||
## Phase 2 | ||
|
||
* Explore design space for virtual module from source | ||
- Potential implementation in: https://github.com/nodejs/ecmascript-modules/pull/8. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this the correct link? Its title is 'Revert "esm: Remove --experimental-vm-modules."'. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. indeed. We had an implementation that is available upstream that was removed in phase 1. A potential implementation is to simply revert removing it |
||
|
||
* Improve CommonJS interoperability. | ||
- Refine `createRequireFromPath`. | ||
- See [https://gist.github.com/SMotaal/e73c12bd801d78a3108fa30ecd303676](https://gist.github.com/SMotaal/e73c12bd801d78a3108fa30ecd303676). | ||
|
||
* Define semantics for importing a package entry point, e.g. `import _ from 'lodash'` | ||
- Currently this is only possible via an explicit deep import, e.g. `import _ from 'lodash/index.mjs'`. The idea would be to somehow enable the former syntax. | ||
- `package.json` `module` field? `main` field? | ||
|
||
## Phase 3 | ||
|
||
Phase 3 will tentatively focus on extensible loaders and deliver an environment that allows user-land experimentation. | ||
|
||
We should try to find a loaders solution that supports all items in the [features list in our README](https://github.com/nodejs/modules/#features). | ||
|
||
## Phase 4 | ||
|
||
Phase 4 will include addressing user feedback gathered from the experimentation enabled by Phase 3 and focus on a holistic and complete experience of ESM in Node.js. | ||
|
||
## Future Phases | ||
|
||
There **will** be future phases. We will **not** ship the code produced by Phase 1. This first phase lacks support for important use cases and will not be released as the new modules implementation. | ||
TBD. |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested intro line:
The purpose of Phase 2 is to introduce uncontentious UX enhancements before we deal with user-land extensibility ("loaders").