Earlier quoted context omitted.
If you have so many parameters that you need a URL that's over 2048 characters, you should probably be reminded that localStorage exists.
Using local storage means that you can't share a flowchart with someone else (or embed one in another page) at all, let alone easily.
How to store your app's entire state in the url
221–230 of 416 posts
Re: How to store your app's entire state in the url
#222Re: How to store your app's entire state in the url
#223Re: How to store your app's entire state in the url
#224Earlier quoted context omitted.
I don't think people care so much about a messy address bar as a messy chat/email message after pasting a URL. Shorteners and vanity URLs exist, but that's more friction than just copying from the address bar as-is. This can be overcome with html, markdown, and other rich text formats that let you specify the visible link text (missing from many chat apps*), but that's also friction to compose compared to automatical…
It's not even only about messiness. " https://news.ycombinator.com/item?id=34315441 " isn't some horrible long base64, but it's not a good UX either: when you paste it in a messenger, or in your notes, by default the reader can't tell what's it about without clicking. > *Slack's implementation is awesome: type the link text, highlight it, and paste a URL. Yes! Matches my vision of hypertext perfectly: I usually type…
Most chat apps like Discord will automatically include an embed generated from a URL's metadata when present in a message.
Re: How to store your app's entire state in the url
#225Earlier quoted context omitted.
> Just because a thing is prevalent doesn't mean it's good. I agree with this sentiment. I'm not sure I've ever seen a url referred to as "good", I was just a bit confused as to why someone would baulk at a URL. In my opinion everything after the host portion of the url is to serve the apps needs, so it knows where to go or what to do, it's not really an interface for the user as obviously there are better ways to pr…
I’d say everything after the host is part of the UX, and should serve the user needs. For example: * Should be book-markable. * If searching with a query, should have a clear query parameter for ease of browser integration. * If the URL contains slash dividers that can be read as categories (e.g. storefront.com/department/category/product), then deleting everything after a given slash should go to that category’s pag…
Opaque slugs are problematic in a low-trust world. Phishing attempts are easier when the parameters are indecipherable. I'm not clicking on that shit in a text message or an email. I've seen what happens to people when they do.
Re: How to store your app's entire state in the url
#226Re: How to store your app's entire state in the url
#227Earlier quoted context omitted.
Just because a thing is prevalent doesn't mean it's good. I have a hard time believing all those parameters are completely necessary for the amount of data being displayed. Often times it feels like people just base64encode(page.state) and call it a day. I think it's advantageous to keep the complexity and specificity of information in URLs to a minimum outside of what's needed to retrieve the data set as it can make…
> Just because a thing is prevalent doesn't mean it's good. I agree with this sentiment. I'm not sure I've ever seen a url referred to as "good", I was just a bit confused as to why someone would baulk at a URL. In my opinion everything after the host portion of the url is to serve the apps needs, so it knows where to go or what to do, it's not really an interface for the user as obviously there are better ways to pr…
Re: How to store your app's entire state in the url
#228Earlier quoted context omitted.
Pass that super duper long Yahoo URL to Tinyurl and shrink it down to https://tinyurl.com/bdfepwar It seems like storing state in the URL could benefit from URL shortening techniques so long as the secret sauce logic is both client and server side.
This loses all the benefits of storing all state in the url, which is that it's inspectable by the client. Using a URL shortener still makes all the data stored somewhere in the server
Re: How to store your app's entire state in the url
#229Re: How to store your app's entire state in the url
#230A better idea is to use the URI fragment (the string after the # sign). It has the advantage of not having a size limit, and not needing to be sent all to the backend during the request. `window.location.hash` is your friend.
> It has the advantage of not having a size limit Still though I suppose you could probably gzip it before base64 encoding it for some additional optimization. Extremely long URLs have other UX issues, e.g. sending them on chat apps and having them eat up multiple scroll pages in one URL, like: "Check out this event: http:// ..... ... ... (500 scroll-screen-lengths of just URL) ... ... Here's another event on the sam…