5 ms·
Hey all, I made this post to show a technique that I'm using in my keyboard-centric flowchart editor [0]. I really love urls, and the power that they hold, and
by escot 4y ago
Hey all, I made this post to show a technique that I'm using in my keyboard-centric flowchart editor [0]. I really love urls, and the power that they hold, and would love to see more apps implement little hacks like this.
Also, another shout out to mermaidjs and flowchart.fun for also implementing similar url-based sharing.
[0] https://www.knotend.com https://www.knotend.com
- tlarkworthy 4y agoThere is a size limit though that quickly gets exhausted if you are storing text (2000 chars)
- rmetzler 4y agoThis is the right answer here. The solution works until it doesn’t. Browser URLs are limited in real life. So when the state grows it will break sooner or later. Of course it depends on the usecase.
- tonerow 4y ago(maker of flowchart.fun here) This is technically true but it's a little more nuanced. The 2048 character limit comes from Internet Explorer. There's a great answer on SO https://stackoverflow.com/a/417184/903980 https://stackoverflow.com/a/417184/903980 Still on FF I opted to use LZ Compression (pretty sure many other sites do this as well) to get the number of characters down
- tlarkworthy 4y agoI have done this myself and various tools e.g. slack, Twitter will truncate long urls. Eventually it will break somewhere, not just in the browser. If your tool has a hard limit on information content it's ok, but that does not seem to be the case here.
- escot 4y agoYou're right, its a limitation. Knotend also supports upload/download of a .knotend file to get around this.
- __MatrixMan__ 4y agoStore the content in ipfs and just put the hash in the URL? I haven't used https://github.com/ipfs/js-ipfs https://github.com/ipfs/js-ipfs in this capacity but I'm under the impression that that's moving bits around like that is more or less its purpose. Although I suppose this puts a burden on the URL-creator to pin the content until the URL-clicker doesn't need it anymore, which is not how URLs are supposed to work.
- tonerow 4y agoLove the app!
- escot 4y agoThanks!
- bytesandbots 4y agoIf the schema is fixed, using proto buffers will greatly reduce the length required.