when do you talk about “fragment”, do you mean everything after “#” in the URL? History API also allows the whole URL to change, not just the shebang (but i’m not sure what Vaadin is allowing us to do here.
Generally i think it’s a good idea to be able to get an API for stuff like this. This is useful for scenarios when you have a UI that creates dialogs when clicking on a button and you want to reflect this dialog opening state in the URL. But i think this might only be the last 20% of the cases.
The first 80% of the uses cases are a little bit “easier” to achieve. Mostly a URL change relates to a screen that opens. So we could say, when opening a list of customers via the main menu the URL could change from "/#’ to “/#customers” or “/#om$Customer-customer-browse” or whatever have you. When changing to the editor of a customer something like “/#customers/UUID” could occur.
I would argue that this general pattern is so generic, that it would not be necessary to let the developer do this on their own (through the new API from above), but it could be backed into CUBA.
There are a few things that are a bit problematic i think. One of it is the multi tab situation. The approach from above can only work for the current active tab. This means, changing the tabs will change the URL. The back button in this case will re-activate the old tab (which would be compatible with the single tab approach the user can choose as well). But what if i want to open the editor of an customer via a dialog? Should that be reflected in a URL change as well? I’m not really sure about the different situations here.
From this perspective the deep link possibility that CUBA currently has, is not that bad i would say, because the situation that you described there:
“The developer is responsible for writing code to restore the application state depending on the fragment.” isn’t really needed in the current implementation (except for the 20% cases i described above).
But generally it’s good to hear that it is not that big of a deal to get that feature going…