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

initial GOALS declaration #23

Closed
wants to merge 31 commits into from
Closed
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c4413e3
initial GOALS declaration
bfarias-godaddy Feb 8, 2018
642a2cf
updates
bfarias-godaddy Feb 8, 2018
1bedcb2
libraries are main target for supporting both ESM and no ESM node tar…
bfarias-godaddy Feb 8, 2018
4b64cc7
rephrase mocking to be more generic to cover variety of uses like cod…
bfarias-godaddy Feb 8, 2018
ab1acf8
platform specific APIs should be under import.meta
bfarias-godaddy Feb 8, 2018
a97ee47
explicitly call out WASM for forwards compat
bfarias-godaddy Feb 8, 2018
2f3047e
editorial catch
bfarias-godaddy Feb 8, 2018
833c18d
APM acronym expansion
bfarias-godaddy Feb 8, 2018
6e61568
call out the exact nature of scaling wrt JS spec
bfarias-godaddy Feb 8, 2018
f075115
callout require fallback to CJS on unknown formats
bfarias-godaddy Feb 8, 2018
543411e
incremental migration
bfarias-godaddy Feb 8, 2018
d11b80f
phrasing
bfarias-godaddy Feb 8, 2018
ab2c16a
Loader hook versioning callout
bfarias-godaddy Feb 8, 2018
e8a3499
rephrase "direct"
bfarias-godaddy Feb 9, 2018
27569a6
add singleton reference goal per @sokra comment on React
bfarias-godaddy Feb 10, 2018
e8f3a57
preface / non-goal of breaking require
bfarias-godaddy Feb 14, 2018
09edf63
incremental in terms of individual files
bfarias-godaddy Feb 14, 2018
992e09e
split run on design goal
bfarias-godaddy Feb 15, 2018
3af65df
xref design and goal of preprocessing step definition
bfarias-godaddy Feb 15, 2018
ec31f5f
avoid mentioning specific implementations
bfarias-godaddy Feb 15, 2018
ea0e0a8
typo
bfarias-godaddy Feb 19, 2018
e2954fa
security design note
bfarias-godaddy Feb 19, 2018
d2fd3a7
performance concern
bfarias-godaddy Feb 20, 2018
a321e02
call out non-compliance -> complaince goal
bfarias-godaddy Feb 20, 2018
751eef0
Current Direction
bfarias-godaddy Feb 20, 2018
da35df6
removing confusing direction about static/dynamic loader hooks
bfarias-godaddy Feb 20, 2018
71f4616
split direction into state/direction
bfarias-godaddy Feb 20, 2018
04452d4
clarify forwards compatibility
bfarias-godaddy Feb 20, 2018
109262f
remove/reword details so that they are abstract and dont require spec…
bfarias-godaddy Feb 28, 2018
6c2b6a5
use such as to avoid thinking we are making an abbreviation
bfarias-godaddy Feb 28, 2018
ce18219
specify running in Node.js
bfarias-godaddy Feb 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions GOALS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Preface: Design Principles

These are a list of commitments that can be used to define reasons for goals existing.

* We are committed to shipping ES Modules (ESM)
* We are committed to ESM being first class in Node.js
* We are committed to having the Node.js and Web platform as first class runtimes for modules.
* Modules installed though a package manager should be able to run after installation without requiring a [preprocessing step](#goal-define-preprocessing-step).

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* We are committed to not breaking our existing ecosystem for modules
* We are committed to providing APIs or conventions such that users will be able to use both CommonJS (CJS) and ESM with support for both workflows.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

# Goals

This comment was marked as off-topic.

This comment was marked as off-topic.


1. Enable use of ESM in Node without requiring a flag
2. Have files be unable to collide between module systems

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

3. Define a path to write code that runs in both Node and the Browser without a preprocessing step

This comment was marked as off-topic.

This comment was marked as off-topic.

1. <a name="goal-define-preprocessing-step"></a>Define what a preprocessing step is
2. A subset of functionality that is compatible between environments, not requiring either environment implement all features of the other
4. Define a path to write libraries that support being used by both

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* Node versions supporting ESM
* Node versions that do not support ESM

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

5. Be standards compliant in the nature of our loading of ESM
1. Contextual module APIs exposed to ESM by default will be placed under `import.meta.*`. This does not relate to per Realm globals nor module specifier resolution.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

6. Support developer centric workflows for:

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

1. Intercepting dependencies and replacing them

This comment was marked as off-topic.

This comment was marked as off-topic.

2. Application Performance Monitoring (APM) integration
3. Multiple distributions of both ESM and CJS in the same package

This comment was marked as off-topic.

This comment was marked as off-topic.

4. Creation of userland module systems (JSDOM)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

5. Incremental code base migration from CJS to ESM by migrating individual files

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

7. 100% backwards compatibility with existing CJS code bases if left unchanged
8. Provide a path to have singleton references that can be obtained in both module systems

This comment was marked as off-topic.

This comment was marked as off-topic.


# Non-Goals

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.


1. Use `.js` file extension for both CJS and ESM without a disambiguation mechanism

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* e.g. `require` falling back to CJS when it is unsure about the format of a resolved path
2. Interoperability of Module formats with environments that do not support Module formats that Node seeks to support

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

3. Forwards compatibility support for the transition of existing packages from CJS to ESM

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

1. loading unknown file formats and `.js` as CJS
2. usage of `require.extensions`
3. usage of `require.cache`
4. usage of `NODE_PATH`, `~/.node_libraries`, `~/.node_modules`, and `$PREFIX/lib/node`
4. Standardizing and implementing APIs that explicitly are tailored to APM
5. Standardizing and implementing APIs that explicitly are tailored to testing libraries
6. Standardizing and implementing APIs that explicitly are tailored to transpilers
7. Standardizing and implementing APIs that explicitly are tailored to browser stacks
8. Standardizing and implementing APIs that explicitly are tailored to package managers

This comment was marked as off-topic.

This comment was marked as off-topic.

9. Modification of existing `require` behavior
* Modification of implementation details is allowed only if it would be backwards compatible

# Goals that are not expected for the first iteration

1. 100% stable Loader APIs

This comment was marked as off-topic.

This comment was marked as off-topic.

* Any Loader APIs shipped must have a forward compatible appraoch towards their usage, such as providing a feature dection mechanism or versioned API.

This comment was marked as off-topic.

This comment was marked as off-topic.

2. Treatment of `.js` file extension as ESM by default
3. Support for the following URL schemes: `data:`, `blob:`, and `https:`

# Direction

* Build upon the existing work in Node that has designs around using `.mjs`

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* Enable usage of `.js` for ESM through compatible means of out of band data
* Build upon the existing Loader hooks to aid usability
* Creation of in memory Module records

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* Composition of Loaders
* Find a solution to the live-ness problem
* Discuss issues/benefits around static vs dynamic mutation of loader hooks

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.


# Forwards compatibility concerns

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.


* Interoperability with WASM
* Interoperability with browser support for more module formats
* Resource integrity checks
* Preparation for introduction of more JS spec breaking changes

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

* new parsers added to the JS spec
* new out of band data added to the JS spec
* Enable a future where ESM is the default module system across JS environments