Rich Harris Profile picture
Cheese fan. I work on @sveltejs at @vercel

Oct 8, 2021, 10 tweets

i recorded a talk for jamstackconf.com — — about whether you should build multi-page apps (MPAs) or single-page apps (SPAs). spoiler: the answer is 'neither'. or 'both', depending on your definitions.

here's the condensed tweet thread version:

i sometimes get exasperated at the get-off-my-lawn mentality of people who reflexively deride SPAs, but the truth is they're kind of right: SPAs have ruined the web. the median MPA is better than the median SPA.

but MPAs have significant drawbacks. you end up writing two codebases (one to render HTML, one for any client-side interactions), and you can't do things like persistent elements, client-side state management, transitions, etc. frankly, these are table stakes for modern apps.

modern meta-frameworks like Next, Nuxt and SvelteKit have converged on solutions to the problems of both MPAs and SPAs. you can get the best of both worlds, with none of the drawbacks.

well, almost. if you're adamantly anti-JS, these frameworks won't hold much appeal. but i think the winds are blowing in JavaScript's favour: we're moving more work to the edge — think Cloudflare Workers, Deno Deploy, Netlify Edge Handlers — which means V8. which means JS.

anyway, we need a name for these sorts of apps if we're to be able to see past the MPA/SPA cultural divide. my efforts to come up with an acronym for something better than a SPA were in vain...

...so instead i've started referring to them as #transitionalapps. it comes from the interior design school that combines elements from traditionalist and modernist camps.

some people will disagree that this is the best way to build apps. i address a few objections in the talk, including the idea that 'docs' and 'apps' are entirely separate things that warrant different technological approaches. they're not; they're the poles of a spectrum.

in the last part of the talk i give a quick demo of SvelteKit, showing how you can use it to build portable apps with pre-rendered JS-free static content, dynamically SSR'd pages with rich interactivity, and everything in between — even within a single app.

but this isn't about a specific technology. it's about figuring out how to build robust, accessible, pleasant user experiences that take full advantage of the web's nature. if we use less tribal thinking and more critical thinking, we can get there. /fin

Share this Scrolly Tale with your friends.

A Scrolly Tale is a new way to read Twitter threads with a more visually immersive experience.
Discover more beautiful Scrolly Tales like this.

Keep scrolling