Support for `/#/foo-bar` `baseUrl`s (and `hashchange`)

So we’ve been a happy user of @vaadin/router. But now i need to integrate our web components in an existing AngularJS (legacy) app. That app uses hash-based routing. I’m running into trouble getting the router to work. I’ve got something working using this code: https://gist.github.com/jpzwarte/4ddb07ade16410ce04d52610ff50806e

The hard part seem to be to change the router to see the hash as a part of the pathname instead of separate. Once the path has been normalized, the router just seems to do its thing.

I’m also running into non-exported stuff like notFoundResult when i try to override __fullyResolveChain for example.

Any ideas/tips?

Hi! You seem to be on the right track with changing the trigger to custom one for the hashchange event.

Having notFoundResult not exported is unfortunate, I think we should expose it. Hope asserting something like result.constructor.name === 'NotFoundResult' could help for now as a workaround.

Thanks for sharing your struggles. I’m working on removing the bundles from the router distribution now, this will also make notFoundResult available, among some other improvements.

Doesn’t help when minified :slightly_smiling_face:

I think i will patch-package the router to export things like notFoundResult

Another thing is that __fullyResolveChain uses getPathnameForRouter

and that’s not a method in the class

so i can’t overwrite it

once i have it working, i’ll to contribute back