without any JS with a link or a form AND you also get a shareable url for free. Local storage give you nothing of this. Also you have to write an utility for local storage while with the url you get that for free from sveltekit
without any JS with a link or a form AND you also get a shareable url for free. Local storage give you nothing of this. Also you have to write an utility for local storage while with the url you get that for free from sveltekit
It's good for many cases! But it's not a magic all-situation solution If you remember it, it's the checkbox from v1 that toggles prereleases visibility for the package you're viewing, currently disabled in the sidebar I don't need/want this to be shareable; locally stored and reactive is enough!
Shareability is a byproduct of that...the real winner imho is that it works before JS loads...but I guess for svelte-changelog is less important. I also found it easier to code in general.
I've used query params in the past, back when Svelte/SvelteKit/Other were tabs, and I tweeted I used your library for that! It was the perfect situation: shareable, persistent, and URL-based made sense For this feature today, LS fits more imo. I also don't want the settings to be URL-dependent.
Imho there’s at least a 2x2 matrix (assuming new options might be arrive) - URL bookmarked with params vs naked URL - hitting URL directly vs opening in a background tab e.g. I don’t want to maintain my bookmark. Bookmark first, configure, „Fire and forget“. Open bookmark in tab, let it load. Done
First, yes, what I'm doing also lays the foundation for more visibility settings Second, I totally agree! URLs affect history, clutter bookmarks, etc. It's definitely not a one-size-fits-all solution Even though that'll *not* be the main use, I might indeed consider making LS URL-overridable!
But that totally depends on the app and individual preferences. User-me prefers a mix of both. Config in localStorage as baseline. URL state takes precedence if and only if a param is set. For a client I build a dashboard with query state in the URL but options (sorting, % vs # etc) in localStorage.