-
-
Notifications
You must be signed in to change notification settings - Fork 33.8k
esm: replace --entry-type with --input-type #27184
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
Conversation
8e92ab2 to
a4047d3
Compare
doc/api/errors.md
Outdated
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! 👍
ljharb
left a comment
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
MylesBorins
left a comment
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-typewith--input-type, a flag just like--entry-typebut only for--eval,--printandSTDIN.This way we still provide a way to use ESM in those non-file inputs, but we’re removing the footgun that is
--entry-typein its current form. To use ESM in files, the files need to end in.mjsor be in a"type": "module"package scope.Tests and docs updated.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes