DEV Community

Discussion on: Pitch to me: why should I use Svelte?

Collapse
 
deozza profile image
Edenn Touitou

Moved from Nuxtjs (Vuejs framewok) to Sveltekit (Svelte framework) about a year ago.

First what impressed me was the syntax. There is none. You are writing near pure JS/TS code. There is very few syntax sugar, structures of functions you must follow, ... So reading, learning and writing code is easy.

The templating is like every modern JS framework : a general layout + a page for custom stuff depending on...well...the page you are on + components for small reusable parts.

Then the fact that it can be built directly for various hosts systems. Vercel, Netlify, Firebase, Cloudflare, Azure... And all the build is automated. You only have to drop the folder in the host.

There is also the fact in can do SPA, SSR, static sites, ... And paired with the correct adapter, it separates by itself the static part from the server part. For example, I wrote SSR websites and host them on Netlify. Once the build is done with the Netlify adapter, I end with a folder with static resources and a folder dedicated to Netlify functions.

As Svelte is a compiler rather than a real framewok, the built project is very small. Thus fast to load. And the compiler helps you before commiting code with errors or bad practice.

Finally, if you want to write NPM packages, Svelte has a command handling that.

You can find one of my project here : appquarium.fr/ , with its repo . The stack is Sveltekit + GraphQL (Hasura backend) + Tailwind + Firebase Auth, Firestore and Storage.

Collapse
 
anzhari profile image
Anzhari Purnomo

I see that the cleaner syntax is a big plus for many people. I admit sometimes Vue's store, this, and event are kinda annoying. Also setting up the TypeScript project is kinda tiring.
I checked your app on Lighthouse, and it performs really well!
Thanks for sharing!