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

[Bugfix] fixes bugs around baseURL and rootURL in HistoryLocation and introduces rootURL to NoneLocation #13520

Merged
merged 1 commit into from
May 20, 2016
Merged

Conversation

jasonmit
Copy link
Member

@jasonmit jasonmit commented May 18, 2016

Currently rootURL isn't respected within Ember.NoneLocation and the visit API which results in the route not to be found.

The second bug, formatURL also does not return the url with the rootURL prefixed. This breaks linkto from building the proper string used in hrefs.

This is blocking projects that rely on rootURL to migrate to FastBoot.

rootURL = rootURL.replace(/\/$/, '');

// remove rootURL from url
return path.replace(rootURL, '');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given a rootURL of /foo we want to strip it from /foo/bar/baz but we do not want /foo/baz/foo/bar to become /baz/bar.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup I thought the same. This was taken from history location. Want me to fix both?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, absolutely!

@jasonmit
Copy link
Member Author

@rwjblue ready for another review -- thanks again

@jasonmit jasonmit changed the title [Bugfix] rootURL not respected within Ember.NoneLocation and the visit API [Bugfix] fixes bugs around baseURL and rootURL in HistoryLocation and introduces rootURL to NoneLocation May 20, 2016
@rwjblue rwjblue merged commit 9a993e5 into emberjs:master May 20, 2016
@jasonmit jasonmit deleted the location-none-fail-tests branch May 20, 2016 08:22
@rwjblue
Copy link
Member

rwjblue commented May 20, 2016

Thanks!

@jasonmit
Copy link
Member Author

@rwjblue we should likely force the rootURL to / when in testing. People likely have relied on this bug, I.e, a computed property as the rootURL or an initializer without checking the environment first.

Thoughts?

jasonmit added a commit to jasonmit/ember-cli that referenced this pull request May 21, 2016
Now that this was merged emberjs/ember.js#13520 it's important people know that setting the `rootURL` on line 7 will likely cause some breakage in tests.  Everyone likely relied on `rootURL` not implemented in `Ember.NoneLocation` as a feature instead of a bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FastBoot Bug - Location none doesn't respect rootURL
2 participants