-
Notifications
You must be signed in to change notification settings - Fork 90
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
just-path
removes #
#183
Comments
I would suggest |
As a "workaround" (not meaning to say this is a bug in bidi because on the server side this well-defined behavior) - when using accountant, you can just (defn- unprefixed
[path]
(if (clojure.string/starts-with? path "/#")
(subs path 2)
path)) and then, e.g., (accountant/configure-navigation!
{:nav-handler (comp (fn [path]
;; here goes your old nav handler
) unprefixed)
:path-exists? (comp (fn [path]
;; here goes your old exists handler
) unprefixed}) You must then rewrite the routes without the leading |
Depending on what you're trying to achieve, there's different solutions here. However, if you have intentions of doing URLs like The intention of One could argue that if a location hash is found in a URL then use it. But that falls down because:
|
Yes, of course. I was considering only empty paths before that hash. But the general solution is to use js/location.hash (didn't know this one) which returns everything beginning with the hash. As stated above, I agree you shouldn't change the bidi behavior, just maybe mention how it can be nicely resolved in a SPA. |
Documentation may well be the best way to resolve this. We're having a focus on documentation at JUXT right now, so bidi may be a good candidate for improving as a result of that. |
Personally I'm a little puzzled by this, wouldn't a url fragment caused by an Anyway, what is the expected way to resolve this? |
Url fragments aren't sent to the server, ever. |
Yea, my mistake, I've seen enough url fragment laden urls get routed that it never occurred to me to check if the browser was actually forwarding them... Looking at the
So I route to
So not quite clear how that works... |
BTW, this issue also trapped me. |
Since
just-path
removes#
so that a path/#/about-me
becomes/
, which makes the following code not workingThe text was updated successfully, but these errors were encountered: