So, you want to add url routing to your web application, you open up your trusted browser, type "[react|angular|vue.js|etc'] router", review the router libraries for your framework/library and choose which one to use. Well great, you did what most web developers would do, but by doing so you've most likely bonded you logical code to your view code.
If you simplify routing operations then yes, it can be considered as a view level operation, but as routing operations usually requires some sort of logical/business flows for loading resources or dependencies, something you expect to be in a controller. In some cases (mostly frameworks such as angular) mixing those two is not considered by itself as bad practice, but with the modern view only libraries (such as react) this binding prevent you from creating a true separation between your view library and the rest of you code.
On my last UI project, a small scale backoffice inhouse/internal react based web application, I chosen to try to build up my own minimal url router module by using a few simple libraries. My requirements were simple:
- Basic url routing functionality.
- Support for path and query parameters - for easy way to preserve state on the url (great for sending dev links).
- Event emitter/observable for url and parameters changes.
As I was searching for basic router library I came across this article, which lead me to navigo - a routing library that in 500 lines of code pretty much cover all your demand from a router library. The only missing part was automatic url query parsing/constructing (navigo uses strings), but there always query-string for that.
freezer-js - minimal and powerful immutable/observable state library, I mostly use it on small single state project, seem to fit this case.