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

Change template manifest start_url to dot to make it react-router fri… #3153

Merged
merged 3 commits into from
Oct 28, 2017

Conversation

foochu
Copy link
Contributor

@foochu foochu commented Sep 19, 2017

The current template has public/manifest.json start_url set to "./index.html". This causes a problem with folks using client side routing since the home screen shortcut points to "https://myapp/index.html" and index.html does not match anything. I'd suggest we change start_url to "." for consistency with the dev server etc. This makes the shortcut point to "https://myapp" instead which is the "standard" form most people use to access these apps. I hope this helps.

@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@react-scripts-dangerous

Hello! I'm a bot that helps facilitate testing pull requests.

Your pull request (commit 02f53e8) has been released on npm for testing purposes.

npm i react-scripts-dangerous@1.0.14-02f53e8.0
# or
yarn add react-scripts-dangerous@1.0.14-02f53e8.0
# or
create-react-app --scripts-version=react-scripts-dangerous@1.0.14-02f53e8.0 folder/

Note that the package has not been reviewed or vetted by the maintainers. Only install it at your own risk!

Thanks for your contribution!

@Timer
Copy link
Contributor

Timer commented Sep 19, 2017

@jeffposnick does this PR make sense? Or should this be changed on a per-use basis?

Nothing jumps out at me to make this change if I'm using client-side router.

@jeffposnick
Copy link
Contributor

The service worker configuration we're using assumes that the server at which your web app is deployed will know how to respond to requests for index.html.

While it's a common default setting for most web servers, I don't think we require elsewhere in the project that /index.html and / are treated the same. This PR is a change to the default configuration that would only work if that requirement holds.

Given that manifest.json is something that developers are already likely to modify without ejecting, by customizing the name and branding colors, it's reasonable to expect them to customize their start_url if they use a routing library that requires a different URL scheme.

So I'm in favor of keeping the default start_url as-is.

@Timer
Copy link
Contributor

Timer commented Sep 19, 2017

That makes sense to me, @jeffposnick!

Do you have any objections, @evilchuck?
Could you please adjust this PR to instead add some documentation which makes this proccess more clear?

@foochu
Copy link
Contributor Author

foochu commented Sep 19, 2017

@Timer No worries. Not sure though if I have much to add to what is covered here https://developer.mozilla.org/en-US/docs/Web/Manifest

@Timer
Copy link
Contributor

Timer commented Sep 19, 2017

Maybe we could add a note at the end of this section of the user guide?

@foochu
Copy link
Contributor Author

foochu commented Sep 19, 2017

I like that idea @Timer. Added a note

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2017

Personally I'm learning towards assuming the app uses client-side routing rather than index.html. Seems like vast majority of use cases would prefer that.

@foochu
Copy link
Contributor Author

foochu commented Oct 28, 2017

Thanks @gaearon. Let me know if you want me to reinstate the original fix.

@gaearon
Copy link
Contributor

gaearon commented Oct 28, 2017

Let's take this for now, but I'd be open to a future PR that changes defaults to . instead.

@gaearon gaearon merged commit e05a5fe into facebook:master Oct 28, 2017
@foochu
Copy link
Contributor Author

foochu commented Oct 28, 2017

No worries. If we change it then can remove these docs as well since it’ll “just work”

@gaearon gaearon added this to the 1.0.15 milestone Oct 30, 2017
@gaearon
Copy link
Contributor

gaearon commented Jan 10, 2018

Changed behavior the other way around in #3346.

@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants