Perl called these sigils. They were incredibly useful and powerful, but the dev community decided that they hated them.
Svelte 5: Runes
31–40 of 404 posts
Re: Svelte 5: Runes
#32Re: Svelte 5: Runes
#33React Hooks has its problems, but it got so many things right from the start - code written in 2018, when hooks first came out, still works today. No need to rewrite everything when a new major release comes out. That said, svelte5 does solve a lot of problems that stop me from trying it.
Does not Svelte from 2018 works today?
Re: Svelte 5: Runes
#34When you had this:
let count = 0;
count += 1;
… it made reasonable sense, because that’s just normal JavaScript; the fact that `count` was made reactive was basically incidental.But once it’s this:
let count = $state(0);
count += 1;
This looks like you’ve called a function named $state, and given that you’re talking about migrating from compile-time to runtime reactivity, you might (I think reasonably) expect `count` then to be some object, not just an integer, and so `+= 1` would be the wrong (since JavaScript doesn’t let you overload those operators). But no, it’s instead some kind of decorator/annotation.Yes, stores are unwieldy as you scale them up, and definitely have some practical problems, but that createCounter stuff looks fragile. I’m curious how it all works, because it looks like it’d be needing to do quite a lot of control flow analysis, but not curious enough to investigate at this time. But my intuitions suggest it’s probably markedly more complex and difficult to explain, though perhaps and hopefully more consistent.
Re: Svelte 5: Runes
#35Re: Svelte 5: Runes
#36"Like every other framework, we've come to the realisation that Knockout was right all along." Nope, nope. Been there, done that, with 2-way data binding and never going back.
I’m still waiting for every other framework to realize that jQuery was right all along. But if these guys are only now reaching Knockout, I still have to wait for them to catch up to Backbone.js, I guess.
I find myself feeling this way a lot while writing front-end code.
While I am primarily a back-end developer by trade, I find myself working in Vue or React quite often just to get things done and regularly come to the realization that the majority of the reactivity in the projects I am working on is either unnecessary or so simple that it would be handled with less complexity as a line or two of jQuery.
Re: Svelte 5: Runes
#37This is absolutely true. I have been confused many times figuring out what are reactive states and what are not.
I never knew Svelte needs changes like this, but seeing this, it sounds like a good plan.
Re: Svelte 5: Runes
#38Earlier quoted context omitted.
I'm not going to miss $, I've found it to be a weirdly documented nightmare...
I originally created https://neovimcraft.com in Svelte to learn how it works. I found `$:` to be extremely confusing, full of weird quirks, and completely turned me off to using svelte for anything more than basic sites. Runes seem like a clear improvement, but brings Svelte a step closer to React -- which hurts its appeal to me. The difference between `let counter = $state(0)` and `const [counter, setCounter] = useS…
Re: Svelte 5: Runes
#39So it's a kind of type system using a kind of Hungarian notation? :Flashbacks to Win32 intensify: I think a real type system (i.e. compiler checked, rather than relying on falibilities of human programmers) would be a better solution. If Svelte already has a compiler why not implement this as part of it?