Live data from Hacker News

Svelte: $derived can now be overwritten

github.com

21–30 of 55 posts

Re: Svelte: $derived can now be overwritten

#21
post #9

Earlier quoted context omitted.

I'm almost finished with a large, complex app written with Svelte 5, web sockets and Threlte (Three JS) [0]. Previously, I'd written React for about a decade, mostly on the UI side of things. I vastly prefer Svelte, because of how clean the code feels. There's only one component per file, and the syntax looks and writes deceptively like vanilla JS and HTML. There's a bit of mind-warp when you realize Svelte doesn't w…

"There's only one component per file" If you don't do this in React, its your own fault.

Well. I think that's sort of what I like about Svelte. There's a lot less opportunity to make bad decisions.

Re: Svelte: $derived can now be overwritten

#22

Agh, I understand why runes were implemented, but I still can't get myself to like them. It feels like Runes take away from what made Svelte Svelte (the simple, concise syntax), and changes like this seem like slow concessions back in that direction anyway.

Agree. Loved Svelte, but after the update I made the switch to React and can’t imagine going back outside of small, static viz apps.

Re: Svelte: $derived can now be overwritten

#23
post #6

Wow, the optimistic UI example is so simple: https://svelte.dev/docs/svelte/$derived#Overriding-derived-v... I wonder what Ryan Carniato, the author of Solid, thinks of it.

Implementing a settable derived primitive like that is already possible in SolidJS userspace. You can roll your own or simply use https://primitives.solidjs.community/package/memo#createwrit....

Re: Svelte: $derived can now be overwritten

#24
post #20
post #3

Earlier quoted context omitted.

https://github.com/sveltejs/cli/issues/487#issuecomment-2743...

And for catching up on what a 'rune' is.. that's the `$derived` and `$effect` there, basically $-prefixed built-in things? Has that entirely replaced `$:` or is it as well as? Svelte seems to have got more complicated since I last used it!

Honestly, it's simpler than it was. There were many cases in which `$:` wouldn't work the way you might expect; meanwhile, $derived et all seem to always work without a hitch. It definitely looks less elegant, but I like it much more.

https://svelte.dev/blog/runes

Re: Svelte: $derived can now be overwritten

#25

Agh, I understand why runes were implemented, but I still can't get myself to like them. It feels like Runes take away from what made Svelte Svelte (the simple, concise syntax), and changes like this seem like slow concessions back in that direction anyway.

You just have to build a big project with Svelte 5 and you will come to like them. A lot of magic is okay for simple application, but when you want to build anything that scales Svelte before runes was just horrible. With Svelte 5 and Runes you can look at any component and instantly know what it does. You couldn't do that with Svelte 4 unless you wrote the whole code yourself.

I agree. I ported a non trivial project last year from 4 to 5 and runes are a game changer.

Re: Svelte: $derived can now be overwritten

#26

Agh, I understand why runes were implemented, but I still can't get myself to like them. It feels like Runes take away from what made Svelte Svelte (the simple, concise syntax), and changes like this seem like slow concessions back in that direction anyway.

I get why runes, but you're right. That simple Svelte I loved feels a bit further away now. Not sure how I feel about it long-term.

Re: Svelte: $derived can now be overwritten

#27
post #8
post #4

People who have migrated a large enough production codebase to Svelte 5, what's your devex like?

pretty good. some people in my team don’t like svelte magic and wish we were using react but others say, and i quote, “damn this is clean” or “almost effortless it just works” and i’ve seen again and again engineers ramp up pretty fast compared to my Knockout, Angular, or React times… Pretty happy! Just wished they didn’t change their “magic” so often, but it’s the price to pay for innovation—if we can even call fron…

I'm guessing Svelte 5 will last many years. Maybe they'll release v6 to drop old stuff but I don't think the runes paradigm will change any time soon.

Plus they need to invest some serious work onto SvelteKit...

Re: Svelte: $derived can now be overwritten

#28
post #18

Earlier quoted context omitted.

As much as I appreciate Svelte, the React devex is unmatched. I built a client-side app using Wails with Svelte 5 and I found myself wanting React's seamless devex and vast ecosystem. Once I migrated over to React it was like a huge handicap was lifted. Svelte is great. But if you're in a time crunch and you don't have a specific technical requirement that makes React a bad match, I don't think Svelte is worth it. A…

> A big part of the Svelte ecosystem is still using Svelte stores Just a nitpick, with runes in Svelte 5, stores have largely become obsolete. $state, $derived, and $effect replace most of the needs people would normally use stores for.

That's right; but a lot of packages, like Superforms, use stores.

Re: Svelte: $derived can now be overwritten

#29
post #26

Agh, I understand why runes were implemented, but I still can't get myself to like them. It feels like Runes take away from what made Svelte Svelte (the simple, concise syntax), and changes like this seem like slow concessions back in that direction anyway.

I get why runes , but you're right. That simple Svelte I loved feels a bit further away now. Not sure how I feel about it long-term.

[deleted]

Re: Svelte: $derived can now be overwritten

#30
post #18

Earlier quoted context omitted.

As much as I appreciate Svelte, the React devex is unmatched. I built a client-side app using Wails with Svelte 5 and I found myself wanting React's seamless devex and vast ecosystem. Once I migrated over to React it was like a huge handicap was lifted. Svelte is great. But if you're in a time crunch and you don't have a specific technical requirement that makes React a bad match, I don't think Svelte is worth it. A…

> A big part of the Svelte ecosystem is still using Svelte stores Just a nitpick, with runes in Svelte 5, stores have largely become obsolete. $state, $derived, and $effect replace most of the needs people would normally use stores for.

[deleted]
Post reply on HN