Hello, This is the first article of svelte svelte Complete Guide series. it will be a complete series from beginner to advanced journey with svelte.
What we will Learn in this part ?
- What is Svelte ?
- How svelte works ?
- Why is Svelte Different?
So What is Svelte?
Svelte is Component Framework help to build user interfaces declaratively. It converts your code into an imperative version of Vanila code. Svelte compile your works into optimized pure vanila javascript code at build time. And update DOM surgically when app state changes.
How does svelte DOM update?
In Svelte there is no virtual dom so there is no diff phase. It works out which state change will update dom directly. whenever the appropriate piece of state has changed.
How svelte works?
Svelte is a compiler. It's men when we shift our code into production it ships the code we have written along with a third-party library. and transforms it into a highly optimized plan JavaScript file. this way the bundle size of our app is very small in another framework comparison. Svelte UI Update user interaction or events chain of internal state change which will auto-update the DOM.
Why is Svelte Different?
When you create a production application, the compiler translates your application into JavaScript code. This ensures that when your program is running in the DOM, no overhead framework code is injected into the browser. At build time, Svelte runs, translating the components into a highly efficient imperative code that updates the DOM surgically. This way, you’re able to write highly performant code.
Summary
- Svelte is compiler
- It's compiled declarative code into imperative javascript code.
- Svelte updates DOM surgically when the app state changes.
- In Svelte there is no virtual dom and no Diff phase.
Top comments (0)