-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
module: remove dead code #26983
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
module: remove dead code #26983
Conversation
|
@BridgeAR Sadly, an error occurred when I tried to trigger a build. :( |
|
Can you rebase ? |
82ad1bd to
846196e
Compare
|
@nodejs/modules @nodejs/tsc PTAL. |
This removes a lot of code that has no functionality anymore. All Node.js internal code calls `_resolveLookupPaths` with two arguments. The code that validates `index.js` is not required at all as we check for these files anyway, so it's just redundant code that should be removed.
846196e to
1abfc93
Compare
|
Rebased due to conflicts. |
hybrist
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
|
@nodejs/modules PTAL This is really quite a lot of dead code that is hit on each request and thus even minimally slowing down loading. |
|
@BridgeAR could you not remove the dead code in one backportable patch PR, without removing the argument, and land the breaking argument change separately? |
|
@ljharb I could separate that but the returned |
|
@nodejs/tsc PTAL. This is semver-major and still requires reviews from the TSC. |
|
So a thought... will removing this stuff make it harder for us to backport some of the modules stuff to 10.x? Would it maybe be better to do this change for 13 and keep the delta smaller between 10 and 12? |
guybedford
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.
Nice work.
@MylesBorins which commits are you thinking about specifically here? If this is about ES Modules, the diffs seem separate enough for that not to be an issue. If it is the other PRs done by @BridgeAR or on CommonJS, it would definitely make sense to ensure any CJS loader code is ported in the same order.
This should not make that any more difficult. As @guybedford pointed out this diff is separate from any ES Modules code. I believe there where a few things that have to be backported as well for the ES Modules but I don't know about them exactly as I did not do those. AFAIK non of my changes touched any of these things. |
Trott
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 if CITGM doesn't reveal any surprises
|
CITGM looks good. The following modules came up with https://gzemnid.nodejs.org: Update: I removed modules that were not impacted from the list.
|
|
This already has a couple LGs but it needs one more LG from the @nodejs/tsc. PTAL |
|
@BridgeAR Thanks again for taking the time to make a PR to keymetrics/trassingue but we stopped using this code few months ago, i've archived the repo |
|
Thanks everyone for the reviews. Landed in d11c4be 🎉 @vmarchaud thanks for letting me know. That was the most impacted module. |
This removes a lot of code that has no functionality anymore. All
Node.js internal code calls
_resolveLookupPathswith two arguments.The code that validates
index.jsis not required at all as we checkfor these files anyway, so it's just redundant code that should be
removed.
I defensively marked this as semver-major even though I did not find any usage of the third argument outside of Node.js and that would only be an issue if that part was monkey patched.
Refs: #25362
@nodejs/modules PTAL
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes