astro islands or a plain svelte spa for a 40-page docs site with search Islands
Internal docs, about 40 MDX pages, will grow to maybe 150. Needs client-side search across everything, a filterable API reference table, a dark mode toggle, and three or four interactive demos embedded in prose.
Astro with a few Svelte islands is the obvious answer, but I keep getting stuck on the search — if I need the index client-side anyway, am I actually saving anything over a Svelte SPA where routing is already solved?
Two devs, both comfortable in Svelte, neither has shipped Astro before.
@muslin_mira · 4mo ago · 3 replies
Astro, and search doesn't change the maths the way you think.
A prebuilt Pagefind-style index for 150 pages is a few hundred KB total and it's chunked — the browser fetches only the shards that match what you type, typically tens of KB per query. You're not shipping the corpus. In an SPA every page's content is either in the bundle or behind a fetch you have to design.
The bigger reason: docs get read by someone who arrived from a search engine on a deep link, on bad wifi, once. Static HTML for that path is worth more than nice route transitions on the third page.
Your API table and your demos are islands. That's four
client:visiblecomponents on a site that is otherwise HTML, and a typical page ends up under 30 KB of JS.Reply
Report
@cookie_domain_al · 4mo ago
The index being chunked is the bit I didn't know — I'd assumed one blob you download up front. That kills my main objection.
Reply
Report
@tomato_tobin · 4mo ago
Also worth saying your team writes the same Svelte components either way. The Astro-specific learning is routing plus directives, roughly a day.
Reply
Report