ericphanson / arxiv-search

Elasticsearch-backed rewrite of arxiv-sanity
MIT License
4 stars 1 forks source link

Client side routing #15

Open EdAyers opened 6 years ago

EdAyers commented 6 years ago

The URL bar should reflect the state of the app. Also the back button should work.

EdAyers commented 6 years ago

@ericphanson checkout client (d5d6e0b) and see if you can get the router to work! You should be able to click buttons to refine the search and then go forwards and backwards through your changes. Also the URL changes, but you can't use this to navigate to some search at the moment. I think that needs to involve server-side stuff. Perhaps in the liquid template you can pass a query object to the JS.

ericphanson commented 6 years ago

Very cool! Works fine for me (though git complained a lot for some reason; said I had local changes even though I had pushed). Can JS just grab the URL to get the query object from it? If we just put a ? before the routing stuff (i.e. http://localhost:8500/?time:3days instead of http://localhost:8500/time:3days) the server won't issue an error. The reason I'd prefer that is if we migrate to running it as a static site, we won't have liquid (and I believe this would be the only thing we actually use liquid for these days).