Skip to content
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

added trailingSlashes option #31

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

added trailingSlashes option #31

wants to merge 13 commits into from

Conversation

andrepadez
Copy link

I came to a situation where i need the links to directories to include the trailing slash.
so, when i click in some-directory it will actually link to /path/to/some-directory/ instead of /path/to/some-directory.

It is not intrusive, i added it as an option, and it still defaults to false so it doesn't break anything

Thanks

@dougwilson
Copy link
Contributor

Seems like something that can be added. Can you make the setting apply to the text and JSON views as well?

@andrepadez
Copy link
Author

I can, when i find the time. I'll try to do it before the weekend is over.
Cheers

@andrepadez
Copy link
Author

Hi Doug,

I can't seem to find how i would change and test the JSON and plane text use-cases. Could you help me out with it? Thanks

@dougwilson
Copy link
Contributor

No problem. If you have any work in progress, feel free to push it up and I can check it out/help/just get it down for you :)

@andrepadez
Copy link
Author

I changed enough for it to work like i need it, (lines 395 - 398) but i can't see where i could change it for the JSON and text views...

@dougwilson
Copy link
Contributor

No biggie, Ill look into it :) Once July comes, this module finally won't be tired to Express 3.x release cycles, so we'll be able to release faster :) Otherwise right now a new feature just waits for the next 3.x minor, which is why there hasn't been too much of a rush (sorry!).

@andrepadez
Copy link
Author

no worries, we're already using it without a problem. Thank you for doing the extra work, but i really couldn't find the place where to edit.
Cheers

@geekmug
Copy link

geekmug commented May 16, 2015

Is this not a duplicate of #27? I don't see any reason this needs to be an option. I'm not sure why #27 didn't get merged.

@dougwilson
Copy link
Contributor

I'm not sure why #27 didn't get merged.

I wasn't aware the last comment I had made was ever addresses, sorry! Github doesn't email when PR commits are added.

@geekmug
Copy link

geekmug commented May 16, 2015

Oh sorry, I didn't realize that! I wonder if @andrepadez could review my PR and see if it covers what he needs?

@andrepadez
Copy link
Author

Guys, sorry but i haven't had the time to review your PR. I'm going to do that now.

@andrepadez
Copy link
Author

@geekmug , added a comment to your pull request. Other than that, i question @dougwilson if adding the trailing slash indiscriminately, won't affect currently dependant projects...

@dougwilson
Copy link
Contributor

Yes, to add something like this we need an opt in flag until the next major. Now that express 3 has an end date (July), that's when a lot of these module can finally bump their major versions!

@andrepadez
Copy link
Author

So yeah, i don't mind @geekmug's pull request to be merged instead of mine, but these issues need addressing. Thanks again, for now i will keep using my fork.

@geekmug
Copy link

geekmug commented May 25, 2015

From my perspective the current behavior is a bug, since serve-static will cause a redirect. I don't think I should have to opt out of having a bug. I can't imagine a use case for the HTML output that doesn't involve serve-static, and I can't imagine a use case that involves mangling the strings from the plain or json APIs either.

However, my original PR was for the HTML output only because of the obviousness of this being a bug. If the concern about breaking someone else's public API (where someone is passing through the output of either the plain or JSON output), then leave that part out (or make it optional), but I'd be interested to see evidence of that.

@dougwilson
Copy link
Contributor

@geekmug I published this change in a patch long ago and got enormous backlash. This change will either need to live behind a opt-in switch until 2.0 or not go in at all until 2.0. Those are the only options I can offer, unless you offer to field all bug reports for me.

@dougwilson
Copy link
Contributor

Though even if you do offer, I probably still won't, because our users are expecting this behavior that has existed since at least 2013 (remember, this was extracted from connect 2.x and 1.x of this module is used in connect 2.x/express 3.x) to keep. Some may have added a hacked workaround we would break into their code that is so old it may no longer even have an owner. This is the stability guarantees expressjs promises.

I don't disagree that having no trailing slashes doesn't make sense, hence the reason I had previously released a patch to fix it, but it broke too many people that it's being held until the next major (or opt in via switch).

@geekmug
Copy link

geekmug commented May 25, 2015

Hah, I must not be creative enough to imagine how people have abused this module. I am comfortable with you rejecting my PR on that basis.

@dougwilson
Copy link
Contributor

I'll figure out these two PR statuses soon (likely this week, as a new minor of connect and express is scheduled, which is when all these modules incorporate all their minor updates like this).

@andrepadez
Copy link
Author

I am happy to build on what I've done and apply it to the Json and HTML templates now I've seen how Sean has done it.
I can have it ready tomorrow most definitely.

Cheers

Sent from my iPhone

On 25 May 2015, at 06:47, Douglas Christopher Wilson [email protected] wrote:

I'll figure out these two PR statuses soon (likely this week, as a new minor of connect and express is scheduled, which is when all these modules incorporate all their minor updates like this).


Reply to this email directly or view it on GitHub.

@andrepadez
Copy link
Author

I am happy to build on what I've done and apply it to the Json and HTML templates now I've seen how Sean has done it.
I can have it ready tomorrow most definitely.

@dougwilson, @geekmug, is it ok with you guys?

@dougwilson
Copy link
Contributor

This is good, but it doesn't really do plain or json formats. It would be nice if someone could basically combine #31 and #27 together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants