What options are available if I want to eliminate the RAD query params from my URLs without losing functionality? I'm experimenting with the route->url option for new-html5-history and it works great for letting me change the URLs to my liking, but I know the query params are used to track some state RAD depends on. I'm just not sure exactly what might be in there (selected-row from a report is one example) and where else it could be placed.
Thanks for sharing, @jj974! Do you use this code in live projects?
It i used in one project, where i don't have query params. with-qparam-codec is more used. But it is not perfect because it duplicates path params in query params. https://gitlab.com/-/snippets/3641551
If you don't care about bookmarks, then just don't install the html5 history at all. The URL is only used to restore things on a reload of a page like bookmark or user reload
I definitely do care about bookmarks. That's essentially all I'm after here. I just don't want the bookmarks to be long and have stuff that's not human-readable.
I can put together a mapping of URL patterns -> segments for both route->url and url->route to use. Would that not be sufficient to allow bookmarking? It's not obvious to me what functionality lost by doing it this way.
The only reason I do it the current way is I can transite/base64 encode all of the types that transit can that way, which is everything you could send over the network, and any type you install in Fulcro (e.g. local dates, etc.). That makes it a fully-transparent and “just works” system without the need for more extension points. If you want readable URL params, then yes, you’ll have to make your own plugin to encode/decode the URL pararms, and invent your own mechanism for type coercion. The URLs in many webapps are not human readable, and I personally think users really don’t care…some devs do, but even I just don’t care. The things I want to edit are right there in the UI, why mess with the URL?
but you can do what you want, of course! 😄
I agree but in this case it's not up to me. I've got two apps in the works and for both of them I'm being asked to make "clean" URLs. I don't think either position is unreasonable. A short URL without any query params at all (encoded or not) has a nice aesthetic. If you're receiving props and doing all the rendering from scratch yourself are the concerns still the same? ie are the query params still necessary to make it all work from there?