Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc,esm: add history support info #35395

Merged
merged 1 commit into from Oct 5, 2020
Merged

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Sep 28, 2020

Documents which versions of Node.js support which ESM-feature. This is intended to help library authors determine the minimal Node.js version that supports the features they are using.

I've tried to come up with an exhaustive list of ESM-only features that may impact the way one can write modules:

  • Unflagged ESM
  • Unflagged TLA
  • Supports for .js ES modules

Am I missing something?

Refs: #35370 (comment)

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

cc @guybedford

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/modules

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation. labels Sep 28, 2020
doc/api/esm.md Outdated Show resolved Hide resolved
@GeoffreyBooth
Copy link
Member

Another important one is "exports", though I think that has its own section with history?

@aduh95
Copy link
Contributor Author

aduh95 commented Sep 28, 2020

Another important one is "exports", though I think that has its own section with history?

That's correct:

node/doc/api/packages.md

Lines 856 to 875 in 6fc3b0d

### `"exports"`
<!-- YAML
added: v12.7.0
changes:
- version:
- v12.16.0
- v13.2.0
pr-url: https://github.com/nodejs/node/pull/29978
description: Implement conditional exports.
- version:
- v12.15.0
- v13.7.0
pr-url: https://github.com/nodejs/node/pull/31001
description: Remove the `--experimental-conditional-exports` option.
- version:
- v12.16.0
- v13.7.0
pr-url: https://github.com/nodejs/node/pull/31008
description: Implement logical conditional exports ordering.
-->

@aduh95
Copy link
Contributor Author

aduh95 commented Sep 29, 2020

Now that #35249 has landed, I think it makes sense to include it in this table as it certainly impact the way users are going to interact with CJS from ESM. PTAL

@aduh95 aduh95 mentioned this pull request Sep 29, 2020
3 tasks
Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want this to be such a more comprehensive history of the major milestones, and we are doing REPLACEME's as well, then I would suggest also including these key milestones too:

  • "imports" field
  • conditional exports
  • "exports" patterns
  • package own name resolution

doc/api/esm.md Outdated Show resolved Hide resolved
@aduh95
Copy link
Contributor Author

aduh95 commented Sep 29, 2020

  • conditional exports
  • "exports" patterns

That doesn't impact the way one writes an ES module, this impacts package authors I'd say.

  • "imports" field
  • package own name resolution

Not sure about these ones, they are not ESM-specific right? If so, that's probably more for package authors as well.

Let me add a similar support table at the top of packages.md to document support for those features. Would that work for you?

@guybedford
Copy link
Contributor

That sounds like a good separation yes. Perhaps we just have "type" mentioned on both as well.

doc/api/esm.md Outdated Show resolved Hide resolved
doc/api/packages.md Outdated Show resolved Hide resolved
doc/api/esm.md Outdated Show resolved Hide resolved
doc/api/packages.md Outdated Show resolved Hide resolved
doc/api/packages.md Outdated Show resolved Hide resolved
@lpinca lpinca added the request-ci Add this label to start a Jenkins CI on a PR. label Oct 4, 2020
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Oct 4, 2020
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Oct 5, 2020

Documents which versions of Node.js support which ESM-feature.

PR-URL: nodejs#35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@Trott
Copy link
Member

Trott commented Oct 5, 2020

Landed in a556484

@Trott Trott merged commit a556484 into nodejs:master Oct 5, 2020
@aduh95 aduh95 deleted the add-esm-history branch October 5, 2020 13:20
@danielleadams danielleadams mentioned this pull request Oct 6, 2020
danielleadams pushed a commit that referenced this pull request Oct 6, 2020
Documents which versions of Node.js support which ESM-feature.

PR-URL: #35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
aduh95 added a commit to aduh95/node that referenced this pull request Oct 23, 2020
Documents which versions of Node.js support which ESM-feature.

PR-URL: nodejs#35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 3, 2020
Documents which versions of Node.js support which ESM-feature.

Backport-PR-URL: #35757
PR-URL: #35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins MylesBorins mentioned this pull request Nov 3, 2020
MylesBorins pushed a commit that referenced this pull request Nov 16, 2020
Documents which versions of Node.js support which ESM-feature.

Backport-PR-URL: #35757
PR-URL: #35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Documents which versions of Node.js support which ESM-feature.

PR-URL: nodejs#35395
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. esm Issues and PRs related to the ECMAScript Modules implementation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants