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

PathnameEnvironment usable in non-html5 history api browser; falls back on window.location.pathname #113

Merged
merged 1 commit into from
Jan 20, 2015

Conversation

megamaddu
Copy link
Contributor

This is related to issue #110, though it is not a complete solution. If you force the Environment to PathnameEnvironment but window.history isn't available, it will fall back on just setting window.location.pathname. This allows old browsers like IE9 to use modern routes with minimal effort, gracefully falling back to a normal page reload when the history api isn't available.

Personally, I think this should be the default behavior unless hash={true} is specified, but that is up to the authors. A change like that would also require thinking more about the relationship between pathname and hash routing, and the problems of sharing routes between both sides. This is mentioned here as well: #99

This pull request should be safe for backwards compatibility, as it only changes behavior for people explicitly setting the environment to use to PathnameEnvironment, a case which prior to this pull request simply throws an exception in IE9.

@STRML
Copy link
Owner

STRML commented Jan 20, 2015

Thanks a lot for this.

STRML added a commit that referenced this pull request Jan 20, 2015
PathnameEnvironment usable in non-html5 history api browser; falls back on window.location.pathname
@STRML STRML merged commit a60dc39 into STRML:master Jan 20, 2015
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.

2 participants