-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
Alias res.sendfile
as res.sendFile
#2266
Conversation
FWIW, |
hmm, I mostly develop on windows, so that was lost on me, but it seems more important to be consistent with JavaScript naming conventions than Linux/BSD naming conventions. |
Current naming is consistent with Node.js convention of keeping original name of underlying unix system call, see readlink. But I doubt express users spend a lot of time thinking unix system programming, and the naming looks pretty inconsistent to me, too. And having poked around a bit, I'm having trouble seeing if it even uses So, fwiw, I'm +1, if accompanied by a documentation change and unit test. |
@ForbesLindesay sorry, I wasn't nearly clear enough. I was only trying to shed light on why it may have been all lower case to start with, it wasn't meant as an opinion on the change itself. :-) |
@rmg thanks for the clarification :-) |
That's because I kept the existing |
I see where you are going with this, but the diff is ridiculous large for adding an alias. The current goal of this module and 5.x is to really move things out and to keep express very minimal. I understand how a change like this could be helpful, but right now its not helpful enough to justify the overhead (more docs, history, etc). Thank you for the PR though, and if you are looking to contribute to express there are a lot of areas to help out on. Take a look at the ideas tag in this repo, or all the modules in here. |
@rmg that's because I put most of the body of a file inside a function, so that it can be called twice (with the two different aliases). @ritch If it is the size of the diff that concerns you, there are things we can do about that. For example, if you just look at the commit that makes the change (https://github.com/ForbesLindesay/express/commit/aa9adf4a40339848b4972e4bcb0bbaa8782ea370) you'll see it is a single line. |
@ritch you should really look at the diff with whitespace ignored: https://github.com/strongloop/express/pull/2266/files?w=1 |
Long term I would view this as a rename, but it seems un-necessary to break backwards compatibility. |
@sindresorhus there is a reason for the white space. |
So, if I'm apparently required to make a statement on this issue, here it is: I, myself, do not have a specific opinion on what the method should be named. There are arguments against keeping it the same or changing it. Though in my opinion, the argument that it is somehow wrong in JavaScript is weak, but the argument that it does not fit in with the naming of the other methods on If it seems there was consensus to change the name, I would have done a few things here to lower the bar for contributions and because the PR is really about the idea, not to pick apart the commit:
|
@ForbesLindesay I closed this PR in haste. Sorry about that. Reopened.
The size of the diff was just surprising. I guess I would expect an addtion similar to this and not much else.
@dougwilson how was this handled for |
@ritch GH will remove whitespace changes from diff if you append I'm not sure the conventions of this repo, but wouldn't it be sufficient to add a test that |
@jeffbcross The whitespace is there for a reason. Also, I think |
I must have mis-spoke. I know the whitespace should be in the code, but it
|
sendfile
is the wrong casing, so I always get it wrong. Can we just alias it asres.sendFile
?