-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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 unnecessary property and method #2922
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.
Bump! |
LGTM |
I'll land this tomorrow if there are no objections. cc @nodejs/collaborators |
cc @rvagg what does our deprecation policy says on this? |
LGTM |
Why semver-major though? It was already removed. It's not like any application will break because of this change. |
@thefourtheye It was |
@@ -127,10 +127,6 @@ assert.equal(require('../fixtures/registerExt2').custom, 'passed'); | |||
assert.equal(require('../fixtures/foo').foo, 'ok', | |||
'require module with no extension'); | |||
|
|||
assert.throws(function() { |
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.
@ChALkeR Ah, thanks for pointing out. I edited the PR description. I'll update the commit log when I am landing this. |
@seishun It changes the behavior by removing a throw. If anyone did a feature detection checking whenether |
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 |
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 Are all those packages latest? |
@thefourtheye For 2015-09-21, yes. |
hmmm, I wonder how they are really working. |
There could be a lot of false positives for Also some modules are not used by anybody. |
@thefourtheye Also note that those are only 1100 lines in 442 modules for |
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+. |
@ChALkeR LGTY? |
@thefourtheye Also, most of those |
LGTM for v5 |
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 <me@silverwind.io> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
require.paths
property andrequire.registerExtension
function 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.registerExtension
was removed even before that.