Skip to content

esm: replace --entry-type with --input-type - #27184

Closed
GeoffreyBooth wants to merge 1 commit into
nodejs:masterfrom
GeoffreyBooth:flag-for-string-input-only
Closed

esm: replace --entry-type with --input-type#27184
GeoffreyBooth wants to merge 1 commit into
nodejs:masterfrom
GeoffreyBooth:flag-for-string-input-only

Conversation

@GeoffreyBooth

Copy link
Copy Markdown
Member

This is a change discussed and approved by the modules working group per our meeting today on 2019-04-10. We’re hoping that this change can be merged in before the release of Node 12.

Per nodejs/modules#300 (comment), this PR replaces --entry-type with --input-type, a flag just like --entry-type but only for --eval, --print and STDIN.

This way we still provide a way to use ESM in those non-file inputs, but we’re removing the footgun that is --entry-type in its current form. To use ESM in files, the files need to end in .mjs or be in a "type": "module" package scope.

Tests and docs updated.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@nodejs-github-botnodejs-github-bot added the lib / src Issues and PRs related to general changes in the lib or src directory. label Apr 11, 2019
@GeoffreyBooth
GeoffreyBoothforce-pushed the flag-for-string-input-only branch from 8e92ab2 to a4047d3CompareApril 11, 2019 02:16
@GeoffreyBoothGeoffreyBooth mentioned this pull request Apr 11, 2019
Comment threaddoc/api/errors.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this left in on purpose?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes, see the section head:

These errors have never been released, but had been present on master between
releases.

@hybristhybrist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM once the entry type error in the docs is removed

Comment threadlib/internal/main/repl.js Outdated
@devsnekdevsnek added esm Issues and PRs related to the ECMAScript Modules implementation. experimental Issues and PRs related to experimental features. labels Apr 11, 2019
Comment threaddoc/api/errors.md Outdated

@joyeecheungjoyeecheung left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Code LGTM. I will defer the decision around feature change to the modules group, but looks like people welcome it there, and I personally like this approach better. Great work researching into the details! 👍

@ljharbljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

the modules group achieved consensus on this change, so we do support it

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@GeoffreyBooth
GeoffreyBoothforce-pushed the flag-for-string-input-only branch 3 times, most recently from ab4712a to fb9d934CompareApril 15, 2019 21:22
@BridgeARBridgeAR added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 16, 2019
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MylesBorins
MylesBorinsforce-pushed the flag-for-string-input-only branch from d2eaa1e to 3e037faCompareApril 16, 2019 15:44
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@MylesBorinsMylesBorins left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@MylesBorins

Copy link
Copy Markdown
Contributor

landed in 96e46d3

MylesBorins pushed a commit that referenced this pull request Apr 16, 2019
New flag is for string input only
PR-URL: #27184
Reviewed-By: Jan Krems <jan.krems@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
@ljharb
ljharb deleted the flag-for-string-input-only branch April 16, 2019 17:19
chjj added a commit to chjj/bthreads that referenced this pull request Apr 30, 2019
chjj added a commit to bcoin-org/bmocha that referenced this pull request May 3, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author readyPRs that have at least one approval, no pending requests for changes, and a CI started.esmIssues and PRs related to the ECMAScript Modules implementation.experimentalIssues and PRs related to experimental features.lib / srcIssues and PRs related to general changes in the lib or src directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants

@GeoffreyBooth@nodejs-github-bot@MylesBorins@ljharb@hybrist@targos@joyeecheung@BridgeAR@vsemozhetbyt@devsnek