Replies: 1 comment
|
Taking your points one by one:
Try and keep the state as flat as possible. Maybe something like
Always assume the search params are in an arbitrary order. It's an unordered key-value store under users' control.
For ASCII, you'll likely end up with url-encoded values if out of the safe character set, so not worth it imho. base64url is a safer bet.
Definitely, and another way to reduce the amount of state stored is to avoid storing anything that can be computed or inferred from other data. Another thing I see from your state descriptor object is a lot of parseAsBoolean, you could save a lot of space by packing those into a bitfield for the showXYZ properties (as long as you guarantee the order remains the same for the lifetime of the app). |
Uh oh!
There was an error while loading. Please reload this page.
Context: I'm building terrain-viewer, and storing a pretty large state (visualization modes, opacities, parameters for multiple layers of terrain hillshade, color-relief, contours etc) so users can share the exact same visualization via url in a pure client-side app.
Just opened an unrelated feature idea related to
parseAsColorhere #1342I'm doing simple pose interpolation animations, and am anticipating the moment when I'll want to store in url query-param the whole, or portion, of that state at different (at least 2) animation keyframes, snapshot at a given timestamp/keyframe. I'd love to compress the state as much as possible, so url do not become too long.
Some possible ideas I would love to get some help and discuss which would be best:
?latitude=10&longitude=10&pose1={lat:11,lng:11}&pose2={lat:12,lng:13}Hope this all makes sense! I realize it is a pretty narrow use-case, but would love to hear your thoughts around compact state representation for such cases!
All reactions