https://kotlinlang.org logo
t

Tomas Kormanak

02/15/2021, 11:12 AM
Are you considering upgrading to navigo router 8? It has some nice features.
r

Robert Jaros

02/15/2021, 12:19 PM
I've looked at the new version but I'm not sure about new initialization requirement.
Currently I'm creating new navigo instance inside KVision. It doesn't seem possible with the mandatory path parameter.
t

Tomas Kormanak

02/15/2021, 12:31 PM
It would help not to create navigo instance in kvision or find a way how to customize it. For example with current implementation we had to hack it to set root
Copy code
val r = routing
val root = window.location.toString().substringBefore("#")
js("r.root = root")
to avoid some bugs in autodetecting root.
I can imagine add factory to create default router and allow users to register own factory in Application class.
I'll think about it. I realized I can instantiate it by myself, because we don't use DSL to setup routes. We use nested stackPanels and when user navigate to the component I need to show appropriate panels in whole hierarchy.
I made an issue with my ideas.
r

Robert Jaros

02/15/2021, 5:42 PM
I wish I had thought more about routing before the 4.x release. It would be easier to just introduce modular routing as a breaking change 😉
t

Tomas Kormanak

02/15/2021, 5:43 PM
🙂
r

Robert Jaros

02/15/2021, 5:47 PM
But perhaps it's still possible to do this with very little "breaking" 😉 Just for a minor release 😉 I'll think about it.
3 Views