There is a framework war going on in the current world of front-end. A new successor to Angular, React and Vue is announced almost every day. On the other hand, the three main hegemonies compete with newer and newer solutions to dominate the market. In opposition, solutions that have nothing to do with the frameworks are starting to emerge. They are more like compilers and one of them is Svelte.
What is Svelte?
Why should we use Svelte?
No Virtual DOM
So what does that mean?
- We don’t need an extra layer of abstraction.
- The first application loading will not be extended.
As a result, applications written with Svelte have great performance and lightenst.
When designing Svelte, developers decided that one of the most important features of the framework should be efficiency. Built-in mechanisms significantly reduce the code generated as a result of compilation. The bundle size of the application can be even 10 times smaller than in the case of React.
Styles in components are encapsulated. This means that the scope of CSS rules is limited to the component only, so we don’t have to worry that the styles will have a global impact on other components. Additionally, all unused rules will be skipped at the compilation stage. We can also use CSS-in-JS libraries to write styles.
For fans of static typing, this will be a huge advantage. Svelte in its latest version now fully supports typescript.
Great User Experience
What Svelte offers for UX?
- performant transition engine built right into the framework.
- good performance also on weaker devices
- as the author himself declares “rock-solid code generated by compiler”
The low entry threshold, the simplicity of writing applications and great performance are a good argument to bet on Svelte. The solution is still gaining popularity. At the moment, the number of weekly downloads on NPM is nearly 100,000 and has received 37,000 github stars. So let us ask ourselves whether Svelte is the future for frontend-development? Definitely yes!