DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Gabriel Webb
Gabriel Webb

Posted on

Why Svelte Should Be Your First Framework

Why Use Svelte?

We all know the big three: React, Angular, and Vue. Sure, there are plenty of of other smaller ones as well.

Why is Svelte? Why is it different? It’s actually not a framework but a compiler with a templating language kinda like Handlebars.js!
Svelte being a compiler and templating language is what makes it so powerful. The way a Svelte file is set up is very normal to what you are used to in vanilla web development. Not much is needed to get started. Most frameworks require a lot of in depth knowledge from what I have seen.If you have HTML, CSS, and some basic JS(ES6) knowledge you can get started now.

Here are a few reasons why I think you will love it:
1.Formatting & Structure
Svelte files are set up similar to normal web dev projects with some added goodness.
2.CSS is scoped
All the styling for your components are scoped to that component.
3.Compile Time
At compile Svelte takes all your code and compiles it into fast and efficient JS. It even removes unused CSS styling. You are left with small bundle and fast code.

If you really want to dive in and learn I challenge you to first watch Rich Harris give his talk on "Rethinking Reactivity" then go to Svelte.dev and go through the tutorial for a bit. Coding Addict/John Smilga on Youtube has a great video on building a Budget Calculator with Svelte. He also offers a course which is $5 and includes the budget calculator and an e-commerce app. If you want more I would also recommend LevelUpTutorial's Svelte for Beginners course. Scott takes you through Svelte and shows you just how easy it is to build a quiz connected to an API. Acadamind also has a really killer course on Udemy as well. There are tons of ways to learn and get building.

Top comments (1)

Collapse
 
maxdevjs profile image
maxdevjs

Good roadmap, will follow it :)

In defense of the modern web

I expect I'll annoy everyone with this post: the anti-JavaScript crusaders, justly aghast at how much of the stuff we slather onto modern websites; the people arguing the web is a broken platform for interactive applications anyway and we should start over;

React users; the old guard with their artisanal JS and hand authored HTML; and Tom MacWright, someone I've admired from afar since I first became aware of his work on Mapbox many years ago. But I guess that's the price of having opinions.