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
Create Terminology.md #158
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
7674adb
Create Terminology.md
3d94a6d
Fix HTML
GeoffreyBooth c13a943
Add consumer- and author-defined disambiguation
GeoffreyBooth 57b8247
Fix typo
GeoffreyBooth 7ba49cb
Damn formatting
GeoffreyBooth e1acbc1
Add "Stipulative Terms" with "Browser Interop"
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,88 @@ | ||
Terminology | ||
============ | ||
|
||
This document is used to keep track of common terminology related to modules in [Node.js](https://nodejs.org), focusing primarily on ECMAScript Modules as well as other mainstream module formats. | ||
|
||
<dl> | ||
|
||
Normative Terms | ||
--------------- | ||
|
||
<dt id=agnostic-consumers> | ||
Agnostic Consumers | ||
</dt> | ||
<dd> | ||
The ability for importer modules to be unaware of the imported module type (CJS vs ESM). This implies that the imported module can be migrated from CJS to ESM without impacting the consumer. | ||
|
||
This term alone does not specify in which direction(s) the agnosticism applies. | ||
</dd> | ||
|
||
<dt id=require-interop> | ||
Require Interoperability <code>require(<esm>)</code> | ||
</dt> | ||
<dd> | ||
|
||
The ability for a module to import an ESM module using the `require(…)` function. | ||
|
||
The module’s namespace is return directly, i.e. it is not wrapped in a promise. | ||
|
||
If it is impossible to load the graph synchronously, it is intended that the call must throw. | ||
</dd> | ||
|
||
<dt id=import-interop> | ||
Import Interoperability <code>import(<cjs>)</code> | ||
</dt> | ||
<dd> | ||
|
||
The ability for an ESM module to import a CJS module. | ||
|
||
Applies to both static `import … from ` and dynamic `import(…)`. | ||
|
||
This term alone does not specify whether named `exports` are extracted from the CJS exports object. | ||
</dd> | ||
|
||
<dt id="named-exports"> | ||
This comment was marked as off-topic.
Sorry, something went wrong. |
||
Named Exports <code>exportKeys</code> | ||
</dt> | ||
<dd> | ||
|
||
The ability for a CJS module to elect to expose properties of its `exports` object as fixed set of named exports for use by ESM consumers, as opposed to having a single `export default` equal to the exports object. | ||
|
||
Some forms of CJS are not amenable, e.g. those that dynamically delete properties of the exports object. | ||
</dd> | ||
|
||
<dt id="consumer-disambiguation"> | ||
Consumer-defined Disambiguation | ||
</dt> | ||
<dd> | ||
|
||
When importing a file into an ESM context, the parse goal of the file is determined by the importing module (the consumer). This is often accomplished via syntax, for example by using only `import` statements for ESM or `require` (or other function) for CommonJS. | ||
|
||
</dd> | ||
|
||
<dt id="author-disambiguation"> | ||
Author-defined Disambiguation | ||
</dt> | ||
<dd> | ||
|
||
A file or module’s parse goal is included within itself. This is often achieved via a file extension such as `.mjs` or a field in a `package.json` file. Other suggestions have included a `"use module"` directive or unambiguous syntax, such as parsing the file for `import` or `export` statements. | ||
|
||
</dd> | ||
</dl> | ||
|
||
Deprecated Terms | ||
---------------- | ||
|
||
<dl> | ||
<dt id=transparent-interop> | ||
Transparent Interoperability | ||
</dt> | ||
<dd> | ||
|
||
An imprecise term that refers to some subset of the following independent capabilities: | ||
|
||
1. [Agnostic Consumers](#agnostic-consumers) (in one or both directions) | ||
2. [Require Interoperability](#require-interop) | ||
3. [Import Interoperability](#import-interop) (with or without Named Exports from CJS) | ||
</dd> | ||
</dl> |
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.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
Sorry, something went wrong.