FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module: fix specifier resolution option value by himself65 · Pull Request #35098 · nodejs/node · GitHub

/ node Public

module: fix specifier resolution option value - #35098

Merged
Trott merged 1 commit into
nodejs:masterfrom
himself65:20200908-fix
Sep 10, 2020
Merged

module: fix specifier resolution option value#35098
Trott merged 1 commit into
nodejs:masterfrom
himself65:20200908-fix

Conversation

himself65 commented Sep 8, 2020
edited
Loading

Copy link
Copy Markdown
Member

Fixes: #35095

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

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/modules

Copy link
Copy Markdown
Contributor

The two flags are already set up as aliases in the options parser FWIW

https://github.com/nodejs/node/blob/master/src/node_options.cc#L95-L114

https://github.com/nodejs/node/blob/master/src/node_options.cc#L366-L374

Copy link
Copy Markdown
Member Author

The two flags are already set up as aliases in the options parser FWIW

https://github.com/nodejs/node/blob/master/src/node_options.cc#L95-L114

https://github.com/nodejs/node/blob/master/src/node_options.cc#L366-L374

Yep, so I found what the actually bug is,

experimental_specifier_resolution = es_module_specifier_resolution;

assign experimental_specifier_resolution with es_module_specifier_resolution but what if we have experimental_specifier_resolution=node instead of es_module_specifier_resolution

addaleax commented Sep 8, 2020

Copy link
Copy Markdown
Member

Why is --es-module-specifier-resolution not set up as an actual alias of --experimental-specifier-resolution (or vice versa) using AddAlias()? That doesn’t seem great in the first place

Copy link
Copy Markdown
Contributor

@addaleax I think I set it up this way to ensure that both aliases were not used at the same time, which may have been a bit of overengineering. We could likely simplify the logic or simply remove the alias on master / 15 tbh

addaleax commented Sep 8, 2020

Copy link
Copy Markdown
Member

@MylesBorins Yeah, I think that’s something we should definitely simplify. Having it be a plain alias turns it into a single line with basically 0 maintenance overhead (which can and should be kept indefinitely according to our policies).

@himself65 Do you want to turn --experimental-specifier-resolution into an alias for --es-module-specifier-resolution yourself, or should I open a PR with that?

Copy link
Copy Markdown
Contributor

@addaleax would a simple alias fail if both the original and alias are passed with different values?

addaleax commented Sep 8, 2020

Copy link
Copy Markdown
Member

@MylesBorins No, but if necessary we could make that happen. However, I don’t think it’s worth all the complexity of this code.

Copy link
Copy Markdown
Contributor

@addaleax SGTM.

bmeck commented Sep 8, 2020

Copy link
Copy Markdown
Member

Do we have a documented priority of the option value if 2 conflicting values are supplied?

addaleax commented Sep 8, 2020

Copy link
Copy Markdown
Member

Do we have a documented priority of the option value if 2 conflicting values are supplied?

The last specified value is used. This is just like when an option that has a single value is used twice.

bmeck commented Sep 8, 2020

Copy link
Copy Markdown
Member

@addaleax any behavior seems fine, just want docs.

himself65 requested a review from addaleax September 9, 2020 22:07

addaleax 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you :)

MylesBorins 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

Trott added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 10, 2020
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 10, 2020

Copy link
Copy Markdown
Collaborator

Trott commented Sep 10, 2020
edited
Loading

Copy link
Copy Markdown
Member

Landed in 20a074b0cd55

Landed in 22c52aa

Trott merged commit 22c52aa into nodejs:master Sep 10, 2020
Fixes: nodejs#35095

PR-URL: nodejs#35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
addaleax added a commit that referenced this pull request Sep 11, 2020
Refs: #35098 (comment)

PR-URL: #35106
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
ruyadorno pushed a commit that referenced this pull request Sep 17, 2020
Fixes: #35095

PR-URL: #35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
ruyadorno pushed a commit that referenced this pull request Sep 17, 2020
Refs: #35098 (comment)

PR-URL: #35106
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
ruyadorno mentioned this pull request Sep 21, 2020
4 tasks
addaleax added a commit that referenced this pull request Sep 22, 2020
Refs: #35098 (comment)

PR-URL: #35106
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
MylesBorins pushed a commit that referenced this pull request Nov 3, 2020
Fixes: #35095

PR-URL: #35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins mentioned this pull request Nov 3, 2020
MylesBorins pushed a commit that referenced this pull request Nov 16, 2020
Fixes: #35095

PR-URL: #35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Fixes: nodejs#35095

PR-URL: nodejs#35098
Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
joesepi pushed a commit to joesepi/node that referenced this pull request Jan 8, 2021
Refs: nodejs#35098 (comment)

PR-URL: nodejs#35106
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Zeyu Yang <himself65@outlook.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
himself65 deleted the 20200908-fix branch April 6, 2023 19:24
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESM specifier resolution flag does not use useESMLoader for entry point

7 participants


Back | FazBrowse Home | New Git URL