-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add custom TokenTransformer #20
Conversation
Nice work, writing integration tests here is complicated, I think that the best (and quick way) is just release a snapshot and let the people try it on their projects. I'll merge it ASAP. |
@niwinz Is that just a matter of changing the version to 1.6.1-SNAPSHOT in project.clj? |
@niwinz bumping this. Are there any next steps from my end? |
Pushed the snapshot to clojars. |
The fix worked for me: I no longer get accumulated query parameters as described in #15 The problem is that in What I see:
|
The fix worked for me: I no longer get accumulated query parameters as described in #15 The new problem is that the current snapshot ( What I see:
It might be a bug of the build tools but I could reproduce the problem and the fix (adding a lowercase copy in my classpath) in both cljsbuild and figwheel. It could also be a bug of the ClojureScript compiler. |
Finally, I tried adding |
Renamed and pushed new snapshot to clojars. |
Thank you! The new snapshot version compiled without problems. |
nice, i will release a new version today probably |
After encountering #15 I did some debugging and it looks like this occurs because in non-fragment mode, Html5History implements a default token<->url transform that expects token to be derived from the pathname only. When receiving a new token through
navigate!
that does include query-string, it appends the existing query string, resulting in duplication. See this line in the implementation.This adds an implementation of the interface defined for overriding that mapping, a public function to instantiate it, and a couple of sentences of documentation.
Tested this in a browser repl on my own machine, but did not write formal tests. I think it needs an integration test running in the browser (or to mock the window object?) Happy to do so, but don't know how that is commonly done in ClojureScript. Examples welcome!