Live data from Hacker News

Svelte 5: Runes

svelte.dev

261–270 of 404 posts

Re: Svelte 5: Runes

#261
Most of this I really love. One thing seems a bit strange though...

Let's compare Svelte's and Solid's approach to nested reactivity. Both of them implement the same nested reactivity todo example:

Svelte: https://svelte-5-preview.vercel.app/docs/fine-grained-reacti...

Solid: https://www.solidjs.com/tutorial/stores_nested_reactivity?so...

In Solid, converting something to use nested reactivity is one step. In Svelte, it is two steps. And that second step is really verbose and annoying:

  todos = [...todos, {
    get done() { return done },
    set done(value) { done = value },
    get text() { return text },
    set text(value) { text = value }
   }];
Solid makes read and write segregation very simple and obvious. You don't need to manually make all these getters and setters.

It is nice that runes allows nested reactivity in Svelte, but it feels nicer to use in Solid.

Re: Svelte 5: Runes

#262

This is basically what Vue and Solid do, no? Same sort of state and derive/computed variables, it seems like. Also, I will never understand why people like reactive signals. The article even quotes "Knockout being right all along" which, no, reactivity and two way data binding creating a spaghetti mess of changes affecting other changes all over the place unless you're really careful is why React was made in the firs…

> It's like every other framework is slowly rediscovering why React made the decisions it made

Nope. More like every other framework is slowly rediscovering that observables and dependency tracking offers the best DX and most of the innovations that React introduced have better alternatives.

Re: Svelte 5: Runes

#263

This is basically what Vue and Solid do, no? Same sort of state and derive/computed variables, it seems like. Also, I will never understand why people like reactive signals. The article even quotes "Knockout being right all along" which, no, reactivity and two way data binding creating a spaghetti mess of changes affecting other changes all over the place unless you're really careful is why React was made in the firs…

Is it not possible to write Svelte code with one-way data-binding? Would that not give you the best of all worlds: compiled javascript, no virtual DOM, and easier to debug code?

Re: Svelte 5: Runes

#264
Can you build a $derived from multiple other $derived?

If yes, how do you deal with two $derived sharing some dependencies?

Will the end result see temporary, half-updated values?

Re: Svelte 5: Runes

#266

I've been trying Svelte for the last couple of months. At first the claim was that it's not complicated like React because there's a lot less concepts to learn. And it's just using basic Javascript and CSS so those skill sets are transferable to any other job. As I use it more and more, there's more and more special way of doing things I have to learn: store, reactive variable, $, $$, etc. I didn't mind, sure I'm in…

Did you read the bit about how runes make all those things unnecessary in future?

there are so many comments here that really feel like they didn't read any part of the announcement other than that there's a thing called runes.

For me personally I tried svelte in the past and bounced off because there was too much implicitly happening that I needed to have a deep understanding of to model correctly. This solves basically all those problems for me.

I thought your video[1] especially did a great job walking through the pros this change brings. Thanks for all your great work on this!

1. Link for the curious: https://www.youtube.com/watch?v=RVnxF3j3N8U&t=6s

Re: Svelte 5: Runes

#267
I have a complicated spaghetti object that I need to render. Given:

    let spaghetti = $state(uglyMess)
Does `uglyMess.thingOne[1].anotherThing = { moreMess }` re-render the whole tree or just the children of `uglyMess.thingOne[1].anotherThing`?

Re: Svelte 5: Runes

#268
I must say, when I see `$` in js, I think it is going to refer to a DOM element. Maybe the new kids don't have those vestigial jquery instincts, but I dislike the use of $ for non-DOM element things.

Re: Svelte 5: Runes

#269
Is this the turning point where svelte start to over engineer stuff and becomes just like other frameworks/libraries? The whole selling point of svelte is simplicity and straightforward implementation, you over complicate it, I will just use something else, popular at least.

Re: Svelte 5: Runes

#270
post #199

Earlier quoted context omitted.

But have you used 2-way binding with a more modern framework? Or are you still hanging on to your experience with a defunct framework like Knockout from over a decade ago? And don't get me started on React's "put all the logic you want in our templating language that doesn't even target HTML5" elephant-footgun. Oh! Sorry! Forgot that React's footguns are aKeats elegant and reasonable while everything else's footguns…

> And don't get me started on React's "put all the logic you want in our templating language that doesn't even target HTML5" elephant-footgun. Sorry, but how is JSX a footgun? I have a lot of issues with React, but JSX doesn't even come close to making the list.

You obviously keep the amount of JS logic to a minimum in your templates. I have encountered many React codebases that did not do this.
Post reply on HN