Implement querystring
Hello,
this are my first steps in yew and wasm. This PR implements my previous request in https://github.com/jplatte/caniuse.rs/issues/67 .
It implements a new router /search/:query and redirect the input to the header. Also it implements a location.replace for input, so it sets the url while you are typing your search query.
Also, I added urlencoding as dependency to handle special characters in url.
Small addition: I fixed the build command, so it works on windows (i am switching between 2 machines), too.
It would be cool to see this in your service.
Have a great day.
Thank you for your input.
I remove the extra dependency and implement the query via hash. Also i hide the query now on create-event, so it does not involve any big changes to your code except the first lookup.
I place a text about the query feature into the about page, too.
If you want to see, why i wan this feature: I adjust my search app for rust to the new hash implementation already.
I just tried and it seems to work only for opening /#q=query, not like before where it also updated the URL when searching. That's probably intentional / what you had working locally too?
yes this was on purpose, because something breaks, if i update the query string every keystroke and this is also my first time to interact with yew, so i did not found a fix. So i remove the querystring from url after the app init, so the UX is the same as before but with a new feature, described in the about page.
Okay, that makes some sense. However the # still remains after opening the page.. Maybe you can try fixing that? I think then I can merge this, and further features can be added later.