Svelte and Svelte-kit — reasons to move to Svelte
Frameworks like React and VueJS work on the browser. The code, however optimised is loaded on the browser and the overhead is on the browser. But in Svelte, the compiled code is loaded on to the browser and the overhead on the browser is much lesser.
React conducts a diff on thew DOM to see which component or element needs update and updates that element/component. Svelte, on the other hand, surgically injects the update into the DOM. Hence, the UI experience feels much faster and smoother when compared to React. The WebApp built is lightweight and the performance is higher.
Learning and getting started:
Integrating with current projects:
There are multiple adapters to integrate the code to other, already present code of frameworks and libraries like NodeJS, NextJS etc. These adapters allow you to build the code according to the code already present and used in the current projects. The compiled code is optimised according to the needs of the framework or library used in the project, along with the environment the final code runs in. The node-adapter package, for example, gives you a middleware function to use the Svelte app with already-present Node server. Hence, integrating Svelte with already present projects is not at all troublesome!
The number of lines of code, when using Svelte is significantly lesser when compared with the React code for the same project. This automatically means lesser lines of code that are prone to be buggy. Also, the code written is very readable.
All in all, I would totally recommend Svelte, if you are looking for a new project to begin. Also, in the next post, I would love to write about the various renderings in Svelte and how to get started with it!