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

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

Closed

Conversation

@GeoffreyBooth
Copy link
Contributor

GeoffreyBooth commented Apr 11, 2019

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

@GeoffreyBooth GeoffreyBooth force-pushed the GeoffreyBooth:flag-for-string-input-only branch from 8e92ab2 to a4047d3 Apr 11, 2019

@@ -2223,6 +2219,18 @@ closed.
These errors have never been released, but had been present on master between
releases.

<a id="ERR_ENTRY_TYPE_MISMATCH"></a>

This comment has been minimized.

Copy link
@jkrems

jkrems Apr 11, 2019

Contributor

Was this left in on purpose?

This comment has been minimized.

Copy link
@GeoffreyBooth

GeoffreyBooth Apr 11, 2019

Author Contributor

Yes, see the section head:

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

@jkrems

jkrems approved these changes Apr 11, 2019

Copy link
Contributor

jkrems left a comment

LGTM once the entry type error in the docs is removed

Show resolved Hide resolved lib/internal/main/repl.js Outdated
@targos

targos approved these changes Apr 11, 2019

Show resolved Hide resolved doc/api/errors.md Outdated
@joyeecheung
Copy link
Member

joyeecheung left a comment

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! 👍

@ljharb

ljharb approved these changes Apr 11, 2019

Copy link
Contributor

ljharb left a comment

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

@GeoffreyBooth GeoffreyBooth force-pushed the GeoffreyBooth:flag-for-string-input-only branch from c73e3a6 to 560c745 Apr 14, 2019

@nodejs-github-bot

This comment has been minimized.

@GeoffreyBooth GeoffreyBooth force-pushed the GeoffreyBooth:flag-for-string-input-only branch 3 times, most recently from ab4712a to fb9d934 Apr 15, 2019

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot

This comment has been minimized.

@MylesBorins MylesBorins force-pushed the GeoffreyBooth:flag-for-string-input-only branch from d2eaa1e to 3e037fa Apr 16, 2019

@nodejs-github-bot

This comment has been minimized.

@MylesBorins
Copy link
Member

MylesBorins left a comment

LGTM

@MylesBorins

This comment has been minimized.

Copy link
Member

MylesBorins commented Apr 16, 2019

landed in 96e46d3

MylesBorins added a commit that referenced this pull request Apr 16, 2019

esm: replace --entry-type with --input-type
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 GeoffreyBooth:flag-for-string-input-only branch Apr 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.