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

presence of query param breaks routing #60

Closed
dustingetz opened this issue Mar 30, 2015 · 5 comments
Closed

presence of query param breaks routing #60

dustingetz opened this issue Mar 30, 2015 · 5 comments

Comments

@dustingetz
Copy link

ClojureScript:cljs.user> (bidi.bidi/match-route pp-web.routes/routes "/search")
{:handler :search}
ClojureScript:cljs.user> (bidi.bidi/match-route pp-web.routes/routes "/search?a=1")
nil

I see from searching the issues that matching on query-params isn't supported (as the handler ought to handle those not the router), but i expected it to still route properly ignoring the query param.

@malcolmsparks
Copy link
Contributor

The second argument to match-route should be the path, not the path plus query-string, nor the uri, etc.

match-route expects that you've already stripped off the query-string. That may well be a residual hangover from when bidi was server-side only and Ring did the grunt work of stripping of the query-string...

@malcolmsparks
Copy link
Contributor

(not closing the issue, because I'm open to suggestions on this)

@dustingetz
Copy link
Author

Ok cool that is sensible to me.

@joelash
Copy link

joelash commented Sep 17, 2015

Maybe I'm missing something, but without matching a route with query parameters, doesn't bidi become impossible to use with Clojurescript and HTML 5 push-state, using pushy?

@malcolmsparks
Copy link
Contributor

I think you're confusing fragments with query parameters:
https://tools.ietf.org/html/rfc3986#section-3.4.

I've found pushy and bidi work very well together, there's explicit
instructions for bidi in pushy's README here:
https://github.com/kibu-australia/pushy

Here's a useful blog article to give more info:
https://carouselapps.com/2015/08/26/no-hashes-bidirectional-routing-in-re-frame-with-bidi-and-pushy/

Hope this helps clarify things.

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

No branches or pull requests

3 participants