dolittle / vanir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Navigating within a service using the INavigator adds an extra '/_/'

pavsaund opened this issue · comments

When navigating using the INavigator from within a microservice an extra /_/ is appended to the url. This also happens when ex: clicking the back-button.

Adding some more information. The local router is set up to navigate with the underscore, and this works when ex: clicking links. in the DOM.

I don't think this is new behaviour, but in implementing local functionality to refresh the a component on navigation (#170) I think we discovered this.

The additional /_/ prefix added is actually as expected, it also adds the name of microservice there. The reason for this is that in the composition the public endpoint is in fact /_/<microservice name>/<your routes/. The use of MicroserviceRoute then also appends this information. But I think there is a gap here somewhere, I'm investigating what that is and also thinking if this can be done in a better - hopefully less intrusive way.

For reference: https://github.com/dolittle-entropy/vanir/blob/d7ef1cde37c2676f0c17f5aacd5e344338c0f6db/Source/react/routing/MicroserviceRoute.tsx

I'm going to close this issue, as I think it is by design. What I have done however, is add documentation for how it is intended to work and be used: https://github.com/dolittle-entropy/vanir/blob/main/Documentation/frontend/react/routing.md