Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.2k
module: remove unnecessary property and method#2922
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
`require.path` property and `require.registerExtension` function have been throwing errors when used. They both are like this for years now. This patch removes them from the system.
thefourtheye commented Sep 18, 2015
thefourtheye commented Sep 22, 2015
Bump! |
silverwind commented Sep 23, 2015
LGTM |
thefourtheye commented Sep 28, 2015
I'll land this tomorrow if there are no objections. cc @nodejs/collaborators |
indutny commented Sep 28, 2015
cc @rvagg what does our deprecation policy says on this? |
mscdex commented Sep 28, 2015
LGTM |
seishun commented Sep 28, 2015
Why semver-major though? It was already removed. It's not like any application will break because of this change. |
thefourtheye commented Sep 28, 2015
ChALkeR commented Sep 28, 2015
@thefourtheye It was |
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.
Nit: Can you add a test to confirm that require.paths returns undefined or whatever the expected value is?
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.
Nit: Probably good to do the same for require.registerExtension().
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.
@Trott Do we really need that? There will be no reference to that in code, but there will be a test which will check if paths is undefined.
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.
My thinking is this PR changes the behavior of the code and there ought to be a test for that change. So a test that the property has, in fact, been successfully removed seems appropriate. But if you think it's overkill, I'm OK without it. (I'll edit my comments above to indicate they are nits.)
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.
@Trott Hmmm, whenever we remove something from the system we don't add tests to make sure that they are really removed, right? So, I feel that it is not necessary. Let's see what others feel.
thefourtheye commented Sep 28, 2015
@ChALkeR Ah, thanks for pointing out. I edited the PR description. I'll update the commit log when I am landing this. |
ChALkeR commented Sep 28, 2015
@seishun It changes the behavior by removing a throw. If anyone did a feature detection checking whenether |
ChALkeR commented Sep 28, 2015
amdify-0.0.26.tgz/jam/ejs/lib/ejs.js:350: require.registerExtension('.ejs',function(src){backbone-revisited-0.1.2.tgz/node_mods/ejs.js:353: require.registerExtension('.ejs',function(src){blitzLib-0.1.0.tgz/Lib/coffee-script-debug.js:14330: }: require.registerExtension&&require.registerExtension(".coffee",bluebutton-0.4.2.tgz/_site/spec/javascripts/helpers/ejs.js:411: require.registerExtension('.ejs',function(src){clientexpress-0.7.7.tgz/lib/ejs.js:301: require.registerExtension('.ejs',function(src){coffeete-0.0.4.tgz/src/coffeete.js:22: require.registerExtension('.coffeete',function(content){contracts.coffee-0.3.4.tgz/lib/coffee-script/coffee-script.js:24: require.registerExtension('.coffee',function(content){ejs-harmony-1.0.1.tgz/lib/ejs.js:413: require.registerExtension('.ejs',function(src){ejs-i-1.2.3.tgz/ejs.js:417: require.registerExtension('.ejs',function(src){ejs-i-1.2.3.tgz/lib/ejs.js:399: require.registerExtension('.ejs',function(src){ejs-remix-0.1.1.tgz/ejs.js:346: require.registerExtension('.ejs',function(src){ejs-remix-0.1.1.tgz/lib/ejs.js:504: require.registerExtension('.ejs',function(src){ejs-template-0.1.0.tgz/ejs/ejs.js:376: require.registerExtension('.ejs',function(src){ejs-var-1.0.0.tgz/ejs.js:411: require.registerExtension('.ejs',function(src){ejs-var-1.0.0.tgz/lib/ejs.js:374: require.registerExtension('.ejs',function(src){ender-ejs-0.6.1.tgz/ejs.js:334: require.registerExtension('.ejs',function(src){funtang.compiler-0.0.1.tgz/reference/jashkenas-coffee-script-60c9b94/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee',function(content){gorillascript-0.9.10.tgz/extras/gorillascript.js:30580: require.registerExtension(".gs",function(content){gorillascript-0.9.10.tgz/lib/gorilla.js:435: require.registerExtension(".gs",function(content){imba-0.13.0.tgz/register.js:39: require.registerExtension('.imba',function(content){logmonger-0.1.0.tgz/contrib/coffee-script/coffee-script.js:14: require.registerExtension('.coffee',function(content){mochiscript-0.6.16.tgz/lib/mochiscript/mochiscript.js:1280: require.registerExtension('.ms',function(content,filename){neode-0.0.0.tgz/coffee-script/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee',function(content){ngine-0.0.2.tgz/lib/ejs.js:387: require.registerExtension('.ejs',function(src){periodic.component.list-view-scroll-0.1.1.tgz/example/scripts/example.js:2827: require.registerExtension('.ejs',function(src){sdejs-0.0.2.tgz/lib/sdejs.js:376: require.registerExtension('.ejs',function(src){sdejs-0.0.2.tgz/sdejs.js:420: require.registerExtension('.ejs',function(src){springbokejs-0.0.1.tgz/ejs.js:346: require.registerExtension('.ejs',function(src){springbokejs-0.0.1.tgz/lib/ejs.js:378: require.registerExtension('.ejs',function(src){tinyliquid-0.2.29.tgz/other/ejs.js:411: require.registerExtension('.ejs',function(src){toffee-0.1.12.tgz/lib/coffee-script/coffee-script.js:25: require.registerExtension('.coffee',function(content){TwigJS-0.0.2.tgz/support/coffee-script/lib/coffee-script/coffee-script.js:17: require.registerExtension('.coffee',function(content){twigjs-0.0.4.tgz/support/coffee-script/lib/coffee-script/coffee-script.js:17: require.registerExtension('.coffee',function(content){utml-0.2.0.tgz/utml.js:224: require.registerExtension('.utml',function(src){vork-0.0.12.tgz/exampleApp/app/requirejsBuilder/plugins/ejs.js:333: require.registerExtension('.ejs',function(src){wsi-ejs-1.2.0.tgz/ejs.js:413: require.registerExtension('.ejs',function(src){wsi-ejs-1.2.0.tgz/lib/ejs.js:361: require.registerExtension('.ejs',function(src){yerbascript-0.0.1.tgz/lib/coffee-script/coffee-script.js:31: require.registerExtension('.yerba',function(content){yerbascript-0.0.1.tgz/lib/coffee-script/coffee-script.js:34: require.registerExtension('.coffee',function(content){Most of them do an |
mscdex commented Sep 28, 2015
IMHO I would just remove them both, they have been deprecated for a long time now, at least since 2011. It's not like it was a soft deprecation either. |
ChALkeR commented Sep 28, 2015
|
thefourtheye commented Sep 28, 2015
@ChALkeR Are all those packages latest? |
ChALkeR commented Sep 28, 2015
@thefourtheye For 2015-09-21, yes. |
thefourtheye commented Sep 28, 2015
hmmm, I wonder how they are really working. |
ChALkeR commented Sep 28, 2015
There could be a lot of false positives for Also some modules are not used by anybody. |
ChALkeR commented Sep 28, 2015
@thefourtheye Also note that those are only 1100 lines in 442 modules for |
rvagg commented Sep 29, 2015
Not sure we have coverage of this kind of situation because it's not even deprecated, it's flat-out broken. I could imagine a situation where you're using the exception in some upstream workflow but you'd have to be more than a little crazy to be doing that I think.. I bet lot of those packages are either not attempting to use that functionality (notice how many have ejs.js or coffee-script.js in a lib directory?) or are simply abandonware. I'm +0.5 on this as long as it's only for v5+. |
thefourtheye commented Oct 2, 2015
@ChALkeR LGTY? |
ChALkeR commented Oct 4, 2015
@thefourtheye Also, most of those |
Fishrock123 commented Oct 5, 2015
LGTM for v5 |
bnoordhuis commented Oct 5, 2015
LGTM |
`require.paths` property and `require.registerExtension` function have been throwing errors when used. They both are like this for years now. This patch removes them from the system. PR-URL: #2922 Reviewed-By: Roman Reiss <[email protected]> Reviewed-By: Brian White <[email protected]> Reviewed-By: Сковорода Никита Андреевич <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]>
require.pathsproperty andrequire.registerExtensionfunction havebeen throwing errors when used. They both are like this for years now.
This patch removes them from the system.
require.paths: 7f0047c#diff-d1234a869b3d648ebfcdce5a76747d71R359require.registerExtensionwas removed even before that.