Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
module: remove require('.') with NODE_PATH compat#3384
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
silverwind commented Oct 15, 2015
silverwind commented Dec 1, 2015
Going to postpone this removal once more. This incompatibilty and the subsequent hack were added during io.js. the exposure time of this deprecation message would be quite short for users of 4.x. Likely target is 7.0.0. |
jasnell commented Mar 22, 2016
@silverwind ... is this still something you want to pursue? |
silverwind commented Mar 22, 2016
Yes, I'm just waiting for the v6 release so I can land this on master. |
7da4fd4 to c7066fbComparebenjamingr commented Apr 30, 2016
Mind elaborating on this change? Also, can we get a citgm run? |
06275b9 to 5cb631fComparesilverwind commented May 2, 2016
Rebased. When we introduced I introduced a 'hack' to restore the functionality with a deprecation message in place (#1363), which is now removed again. When this goes into the 7.0.0 release, the deprecation will have been in place for 1.5 years. |
silverwind commented May 2, 2016
ChALkeR commented May 2, 2016
Perhaps we should review the stability levels in the documentation first? |
silverwind commented May 2, 2016
Test is broken. Looks like something in ae18bbe made my "maintain backwards compat" section neccessary to resolve |
silverwind commented May 2, 2016
Condition fixed, new CI: https://ci.nodejs.org/job/node-test-pull-request/2468/ |
silverwind commented May 10, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
CI is green except an unrelated java failure. I don't think a CITGM would bring any more insights here because modules usually don't set |
silverwind commented May 17, 2016
@thealphanerd can you run this through a CITGM, just to be sure? |
MylesBorins commented May 17, 2016
ChALkeR commented May 17, 2016
Note that this change currently directly contradicts with the documentation, which says that only security, performance, or bug fixes will be accepted for Either the documentation should be fixed first, or this change rejected. |
lib/module.js 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.
@mscdex does this change look right to you? The condition was start !== '.' && start !== './' && start !== '..' before you refactored it to use charCodeAt. Tests are passing, but I'd like to get a second look on that one.
mscdexJun 15, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
You'll want to add appropriate request length checking before using charCodeAt(n) to make sure you don't cause a deopt due to an out-of-bounds access.
silverwind commented Jun 15, 2016
While #6528 is still in limbo, I'd like to get this hack removed rather sooner than later. @nodejs/collaborators any concerns regarding the changes? (See #3384 (comment) for a summary) |
test/parallel/test-require-dot.js 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.
Instead of removing this test should we merely assert the opposite?
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.
Good idea!
silverwind commented Sep 2, 2016 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Totally forgot about this one. I'll move it to the next milestone. |
BridgeAR commented Aug 24, 2017
+1 for option 2 |
silverwind commented Aug 25, 2017
I don't assume that a CITGM will catch anything here. The compat is just for users that set |
silverwind commented Aug 30, 2017
CI: https://ci.nodejs.org/job/node-test-pull-request/9878/ (For real now, couldn't start the last time because the CI was down) |
jasnell commented Aug 30, 2017 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@nodejs/ctc ... please take a look at this and weigh in.
|
silverwind commented Aug 30, 2017
@jasnell done. I'll land this tomorrow if there are no objections. |
jdalton commented Aug 30, 2017
🎉 which Node version is this expected to land in? |
jasnell commented Aug 30, 2017
It's a major so it would land in 9.0.0 |
silverwind commented Aug 31, 2017
Finally landed in a517466. It's been a long ride. |
This removes the compatibilty code that was in place to allow an unintended interaction between `require('.')` and `NODE_PATH`. The compatibility code and the accompanying deprecation warning has been in place since 2015-04-17. PR-URL: #3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>This removes the compatibilty code that was in place to allow an unintended interaction between `require('.')` and `NODE_PATH`. The compatibility code and the accompanying deprecation warning has been in place since 2015-04-17. PR-URL: nodejs/node#3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>MylesBorins commented Oct 31, 2017
@nodejs/tsc it appears that this landed without running citgm and it is breaking a fairly insignificant portion of our ecosystem. It breaks a common use case of the module d specifically: require('d/lazy')A revert is incoming. If we had caught this earlier we may have been able to come up with a fix but with d receiving over 500k downloads a day I don't see how we can ship this tomorrow |
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: nodejs#3384
MylesBorins commented Oct 31, 2017
Some more details after a bit more research this commit specifically broke the case of requiring individual files in modules that only have a single character as a name. This will thankfully be limited to 26 cases! The specific line that broke things is a517466#diff-d1234a869b3d648ebfcdce5a76747d71L338 In light of this specific edge case we may want to re-examine the deprecation all together |
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: #3384 PR-URL: #16634 Refs: #3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: #3384 PR-URL: #16634 Refs: #3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: nodejs/node#3384 PR-URL: nodejs/node#16634 Refs: nodejs/node#3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: nodejs/node#3384 PR-URL: nodejs/node#16634 Refs: nodejs/node#3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
The original commit was landed without running CITGM. Unfortunately this change breaks the module `d` which has over 500k downloads a day. It is worth mentioning that the compatibility hack can be removed without breaking anything. We should definitely revisit for the next Semver-Major but shipping this today will cause non trivial ecosystem breakages. Refs: nodejs/node#3384 PR-URL: nodejs/node#16634 Refs: nodejs/node#3384 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Anatoli Papirovski <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
In certain cases, `require('.')` could resolve outside the package directory. This behavior has been removed. PR-URL: nodejs#26973 Refs: nodejs#3384 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This PR replaces #1452. It's updated and targets
masternow. Adding 6.0.0 milestone as discussed.