SvelteKit or Svelte + Astro? | Aryan Agarwal

Shared on SvelteDevs

Aryan Agarwal
Oct 12, 2022
shared in

SvelteKit or Svelte + Astro?

According to the Astro docs, Astro claims to be faster than SvelteKit, but they are using lighthouse scores to compare the official SvelteKit doc pages with the Astro doc pages.

I find it a little odd cause that doesn't feel like a good way to measure performance differences between frameworks since they're entirely different websites, to begin with, even if they serve similar purposes.

I also just realized that this only shows that Astro on its own is faster (if we can call these audit scores a fair comparison, to begin with), rather than X framework + Astro is faster than x framework alone. So is Astro + Svelte really any better than SvelteKit?

Astro initially had some appeal to me since I've never used it either, so it seemed like an easy solution to go from just using Svelte to using it with Astro.

Astro + Svelte is probably a bit faster than SvelteKit because it natively transforms everything to HTML and CSS (static) while Sveltekit would have minimum JS for client-side routing for example. But, I don't think the speed difference is significant.

The real thing to look at would be the user experience and your needs. With Astro, there is no client-side routing, so every page is called from the server. It means that there are no smooth transitions between pages and no lazy loading by default. Also, if you need a global state, Astro won't be really helpful.

Astro could be really great for some projects! You should try it! But not as a replacement for SvelteKit, but more as another tool for some specific needs.

Thanks for reading out! Hope you have a nice day.

Tagged users
Shalini Chauhan
SDE at GlueLabs
Checkout related posts on: