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

Document that basename should only be a relative URL #590

Closed
waynebloss opened this issue May 29, 2018 · 4 comments
Closed

Document that basename should only be a relative URL #590

waynebloss opened this issue May 29, 2018 · 4 comments

Comments

@waynebloss
Copy link

waynebloss commented May 29, 2018

Since there is no standard definition for what a basename is within the browser environment, I wasn't sure if I could pass an absolute URL or only a relative URL as the basename option. There is a base href which can be an absolute or relative url. There is also the Unix basename, which has output very similar to a relative url.

I wanted to find an answer without digging through the code if possible. This comment about prefixing basenames with / finally confirmed to me that basename should probably only be a relative URL.

Of course the examples you show only use relative URLs, but I wanted to be sure.

So, I think you should point that out in the documentation. If you want a pull request for that I'll be glad to do it, the change should only be a few bytes.

Thanks!

@pshrmn
Copy link
Contributor

pshrmn commented May 29, 2018

While it doesn't use the word "relative", the basename documentation does describe the correct formatting. If you want to update the phrasing to include "relative", a PR would be welcome.

@waynebloss
Copy link
Author

Ahh, ok thank you. I wasn't looking at the react-router docs because I'm not using react-router, just the history package. So, I was only looking at the README here - https://github.com/ReactTraining/history#using-a-base-url

I guess most users are just using react-router so I'll just close this now. Thanks again!

@waynebloss
Copy link
Author

Also, the readme itself does kinda say it - 'If all the URLs in your app are relative to some other "base" URL, ' LMAO

@pshrmn
Copy link
Contributor

pshrmn commented May 29, 2018

Sorry, I didn't actually realize this was the history repo when I made that comment. I get notifications for both, with RR ones being more frequent, so I wasn't paying close attention. A PR here would be welcome, too!

@lock lock bot locked as resolved and limited conversation to collaborators Jul 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants