Svelte's runes are just React hooks wearing a Svelte hoodie
Svelte convinced me with a promise. You write let count = 0 , then modify that, and the UI updates magically. No need for hooks. No dependency arrays. No complex setup. That was the main idea behind it. After that, Svelte 5 introduced runes. And the magic left without us noticing. ๐ What actually changed The release of Svelte 5 was announced on September 20, 2023, and was finally stabilized inโฆ
Svelte marketed its framework by promising automatic updates to the UI whenever certain variables changed. Developers wrote a single line, `let count = 0`, and the UI magically reflected any updates. Svelte 5 introduced "runes" โ `$state`, `$derived`, and `$effect` โ which essentially replicate the functionality of React hooks like `useState`, `useMemo`, and `useEffect`. What appears to be the case is that Svelte 5 "redeveloped" these hooks, offering them wrapped in a "Svelte hoodie".
Implicit reactivity, where updates happened without the developer having to explicitly define them, was once a standout feature of Svelte 3 and 4. However, Svelte 5 now requires developers to define these relationships explicitly using `$derived`. This change can feel misleading, as Rich Harris's original claim was that writing `let count = 0` was enough to make the UI self-updating.
The team behind Svelte 5 stated that runes use function syntax to achieve more complex functionality, but this change was necessary due to scalability issues that arose with larger applications.
The official reasoning behind the runes change is that the old approach of implicit reactivity was not scalable for larger apps, and the new runes were introduced to address these issues. Strapi reported a 55% reduction in bundle size after migrating a 147-component app, which suggests that smaller bundles and improved code organization are real advantages.
However, Svelte's unique identity seems to be at risk - once a framework that stood out from the crowd, Svelte now appears to be converging with other frameworks that have adopted explicit, function-based reactivity.
Written by urgent.news from Dev.to's reporting โ not their text. Machine-written โ may contain errors; check the original before relying on it.