Craig Jones

Craig Jones

Software Engineer

What is Svelte? Baby don't hurt me

Published: 01/02/2020

So what is Svelte?. Svelte is a framework that compiles your components into highly optimized vanilla JavaScript. Unlike other frameworks, there is no boilerplate, which helps keep bundle sizes to a minimum, keeping performance levels high

Like other frameworks, you build your application using a variety of components. All JavaScript, styles and markup are contained in the single file. I enjoyed this approach as whole component is confined to one file, keeping project structure easy. Styles are also scoped to the component, meaning there is no risk of styles bleeding out into other components and breaking things. By defauly styling is using CSS, but with the install of a plugin and a slight adjustment in the rollup config, you can use SCSS too.

A typical component would look like this...