Svelte has recently merged a significant feature that allows derived values to be writable, adding new functionality to its reactivity system. This change comes as part of the broader transition to Svelte 5's runes system, which has sparked considerable discussion within the developer community about the framework's evolution and its impact on developer experience.
Writable Derived Values
The newly merged feature makes derived values in Svelte 5 writable, addressing a practical need in application development. Previously, derived values were strictly read-only, which made sense conceptually (since they're calculated from other values), but limited certain use cases. With this change, developers can now override derived values, enabling more flexible patterns like optimistic UI updates where temporary local values can be displayed before backend confirmation.
I love runes, I love svelte 5, I love sveltekit. Together, they offer a seamless entry into development, allowing you to swiftly grasp concepts akin to JS/HTML.
The Runes Controversy
The introduction of runes in Svelte 5 represents a significant shift from the magic reactivity of previous versions to a more explicit model using special $-prefixed declarations like $state
, $derived
, and $effect
. While this change has been contentious, many developers who have used runes in larger projects report that the initial learning curve gives way to better maintainability and clearer code. The explicit nature of runes makes it easier to understand data flow in complex components, where the previous reactivity model could become confusing with multiple bound props and derived states.
Key Svelte 5 Runes
$state
- Declares reactive state$derived
- Creates values derived from other reactive values (now writable)$effect
- Runs side effects when dependencies change
Community Sentiment
- Positive: Better clarity in large projects, more predictable reactivity
- Negative: Loss of simplicity, steeper learning curve, transition challenges
- Mixed: Improved maintainability at the cost of initial elegance
Developer Experience Trade-offs
The community appears divided on whether Svelte's evolution has improved or diminished its developer experience. Some developers lament the loss of Svelte's original simplicity and elegance, which made it particularly appealing for smaller projects. Others argue that runes solve critical problems that emerge in larger applications, where the magic of previous versions could lead to unexpected behavior and debugging challenges.
For teams working on production applications, the migration experience to Svelte 5 has been mixed. Some report that the automatic migration tool works surprisingly well, requiring minimal manual adjustments even for larger codebases. Others note that the ecosystem is in a transitional period, with many libraries still using the older stores pattern rather than the new runes system.
Ecosystem Considerations
The Svelte ecosystem faces challenges during this transition period. Compared to React's mature ecosystem, Svelte has fewer UI libraries and tools, and many existing packages are maintained by small teams now dealing with migration work. This creates a temporary disadvantage for teams considering Svelte for new projects, though the core framework improvements may outweigh these concerns in the long run.
For developers evaluating frontend frameworks, this moment of transition highlights important considerations. Svelte 5 with runes appears to offer better scalability for complex applications at the cost of some initial elegance, while competing frameworks like React maintain advantages in ecosystem breadth and tooling support.
As Svelte continues to evolve, this latest feature allowing writable derived values demonstrates the team's commitment to balancing conceptual purity with practical developer needs. Whether this approach will help Svelte gain broader adoption remains to be seen, but it's clear that the framework is maturing in ways that address real-world application development challenges.
Reference: feat: make deriveds writable #15570