@codesections Basically in Pinafore I use LocalStorage only for small UI stuff like the current theme, the current instance, and UI preferences. IDB is used for offline storage of toots and profiles, which can be a bit larger than the LocalStorage limit and don't need to be accessed synchronously. Cache Storage is just for Service Worker-cached static assets.
LocalStorage: Small, synchronous storage that isn't available in Web Workers or Service Workers. It's read into memory on page nav and limited to 5-10MB, so keep it for small stuff. Sync access means you can update it on page unload, though.
Cache Storage: good for content-addressable stuff (i.e. assets like JS, CSS, and HTML). Use in a Service Worker.
IDB: everything else. Large data, asynchronously accessed, agnostic to whether it's accessed on main thread or in a worker.
It seems Mastodon 2.6 changed how DMs work – they no longer show up in the Home timeline. Had to rewrite some of Pinafore's test suite to accommodate this. 😅 https://github.com/nolanlawson/pinafore/pull/630
I suppose it's incumbent upon apps to provide their own separate UI for DMs now. Overall though it seems like a good UI change. 👍
Interesting stuff. I wasn't aware of AsianAve or BlackPlanet. I never had a MySpace, but I remember how it seemed to spring up out of nowhere among my high-school friends. It's weird how so many of these things seem obvious in retrospect, even if at the time nobody knew how big "social media" would become.
Using the modern web doesn't feel empowering. It feels immensely frustrating.
The web is barely usable without ad-blocking. Pages take an age to load and the content jumps around as more ads download and display. Also the ads are spying on you.
The entire JS ecosystem is dependency hell and sometimes you have to download massive JS files just to view a web page. The JS is probably also spying on you.
Worse still, JS is also probably why the Back button doesn't work properly on so many sites.
The discussion is actually very interesting. Apparently the theoretical performance benefits of HTML Imports never really manifested in practice, either due to the one implementer (Chrome) not spending a lot of time optimizing, or lack of web developer usage, or both.
Given hacks like https://jakearchibald.com/2016/fun-hacks-faster-content/ actually being used in production in AMP, it actually does seem like there's a case for something like HTML Imports, but at the standardization level it just sort of fizzled out.
"Network was the critical performance bottleneck 10 years, but today it’s CPU, especially given the amount of mobile traffic on lesser-powered devices... As pages get slower, JS is the CPU task that grows the most." - Steve Souders https://discuss.httparchive.org/t/cpu-time-breakdown/1510
At first I thought WebRender was basically the same as Edge's independent rendering (i.e moving rendering to a background thread), but based on this post it seems a lot more ambitious actually. Interesting stuff, and kudos to the Firefox folks for opening up on their thought process.
Great analysis. Don't take the advice of using LocalStorage to store JS files, though. If you do, you'll increase the memory cost (most browsers cache LS in-memory), the load time (most browsers load LS on page navigation), and you'll lose the benefits of parse/bytecode caching that browsers do by default (i.e. JS files don't re-parse/re-compile on subsequent page loads).
I went with a single-page app architecture for Pinafore for very particular reasons: 1) to avoid handling personal data on the server, 2) to make it work offline, and 3) to challenge myself. :) But overall, building a quality SPA is *way* harder than building a quality multi-page app. I have an experts-level knowledge in JS/the DOM, but Pinafore was still very difficult to get a lot of basic things right, and there are still some dumb bugs that are hard to squash (back button on the modal… ugh).