-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
esm: replace --entry-type with --input-type #27184
Conversation
8e92ab2
to
a4047d3
Compare
@@ -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> |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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! 👍
There was a problem hiding this comment.
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
c73e3a6
to
560c745
Compare
ab4712a
to
fb9d934
Compare
d2eaa1e
to
3e037fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
landed in 96e46d3 |
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>
Per nodejs/modules#300 (comment), this PR replaces
--entry-type
with--input-type
, a flag just like--entry-type
but only for--eval
,--print
andSTDIN
.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), orvcbuild test
(Windows) passes