Closed ravloony closed 6 years ago
i prefer the original behaviour, because someurl/page/?param=something
is different with someurl/page?param=something
.
I'd prefer to just remove the router from Pux altogether, as purescript-routing provides most of the same functionality.
Have been playing around with purescript-routing in the meantime. It does seem to provide all the functionality, so you're probably right. I still think this should be merged though, as it does not change existing functionality and is useful in its own right.
@syaiful6 I haven't changed existing functionality, only added more.
We have a Pux application that can be embedded in any page. It has a backend component that is embedded in an admin area like/admin/page.
The application itself only uses the query params as the php backend handles the whole url.
So I have added a function that matches any number of url segments, to avoid having to repeat myself.
As an aside for posterity, I came up with this while debugging behaviour where having a trailing slash before the query string was causing my route matching to fail. This is because
someurl/page/?param=something
andsomeurl/page?param=something
are parsed into(Cons Path "someurl" (Cons Path "" (Cons Query (M.Map "param" "something") Nil ) ) )
and
(Cons Path "someurl" (Cons Query (M.Map "param" "something") Nil) )
respectively, due to the behaviour of
S.split (S.Pattern "/")
inrouteFromUrl
.