| The reason for all the hype around Svelte is exactly because it reinvents the wheel. (Rust also does this.) It proves that it's possible to create a web application framework that outperforms a Virtual DOM (VDOM), and does this by giving you one. Usually, you do minimal transpilation when you create, say, a React app - limited to converting JSX to React.createElement calls, plus bundling and tree shaking (if possible). That means all of the work needs to be done at runtime, and React needs to keep track of a VDOM, where any changes can be made at any time, and there needs to be generic runtime infrastructure in place to handle that (diffing and reconciliation). Additionally, each render completely reconstructs its slice of the VDOM, just to be diffed, leading to many wasted objects and CPU cycles even if nothing's changed. Svelte is a different approach which sees the inefficiency in that and tries to implement an alternative. Sure, it's "new and shiny" (even though it's been over 6 years since 1.0), but it has some real benefits! Svelte works by rewriting your code to make changes directly to the DOM, rather than going through a VDOM, and it does this by keeping track of all the possible changes at compile-time (along with things like event listeners and reactive state and so on) and hard-coding them in. So instead of getting a generic runtime framework that has to run everything through a VDOM, you get something a bit more similar to what you would have if you wrote the whole thing by hand using vanilla JS with no framework at all. Svelte has an article on the subject - I'd recommend checking it out: https://svelte.dev/blog/virtual-dom-is-pure-overhead (Although I do think it's fad-like that Svelte is plastering their site with protest messages, that doesn't mean the technology isn't impressive!) |