I'm the person that's been using React for 10 years and suddenly thought... I wonder what the big deal with Svelte is? I built a non-trivial project in Svelte for my personal site and something weird happened. I was having fun again. Svelte feels pretty close to vanilla and I like that the code I'm writing feels a lot more similar to how I wrote code before I ended up in React. Style tags, script tags, easy assignment of variables, no useEffect head-scratching. You declare things, you change them, and it mostly just works. The code looks pretty similar to a regular old webpage.
My favorite thing about learning Svelte was that it has my favorite "documentation" of any library. It's just a list of code samples showing various different scenarios [0]. This made it dead easy for me to understand its way of doing things without needing to get too deep into the methodology.
Only briefly. I did enough to realize Solid felt like a flavor of what I'd already been doing in React. Svelte felt more like some extras I could throw on JavaScript itself.
Honestly, the biggest thing with all of these systems is what library support do they have beyond the core? I specifically need a good component library, and want to do things with Three JS. Svelte had that covered.
I say this as a long time Svelte fan, and maintained some libraries for past 7 years: I really don't like the DX of "runes". What I liked about Svelte was the two way and automatic reactivity, clever computed values prefixed with $:, etc. The code looked simple and clean.
I know there's very good reasons for the changes, but it feels so similar to React (and even hooks) now that I don't see any big positives to using Svelte vs just using React. Sorry Rich.
I feel the same way, but after watching a couple of the videos Rich has put out I thought the main driver for the change were the “gotchas”. I have not done production Svelte development so I never really dealt with any of that. Given you’re background, are the caveats/pitfalls he mentions not common to your projects or do you just view the critique as newby problems?
Yes, I've not run into these, even though I know they are possibilities (like with any framework). Simple webapps doing webapp-things always seem fine for the performance and any gotchas.
Not exactly, in Svelte you don't declare components in plain js, you create a svelte file and the compiler does the rest. Whether a component is a function or a class is an internal detail you don't need to know, except in the case you are instantiating a component manually, which is a edge case.
I agree with Rich's take that classes are mostly bad when you do things like inheritance.
However, I don't really know why he thinks classes are awesome without inheritance, either. Once you do away with inheritance, what's the benefit over writing a function that builds an object? Get rid of the middle man, the extra keywords, the prototype chain, etc., and go with a function. Did I miss something?
Where does Rich mention classes are mostly bad when using inheritance?
I don’t disagree, but I never got to hear/read his thoughts on that subject.
And yeah - I like the idea of defending any use of classes instead of reaching for them to brush your teeth. Some places (my current place) will reach for classes all the time without even the excuse of bundling state.
There's nothing stopping you from staying on an old version of Svelte or React, you just won't have access to all the new goodies and the surrounding ecosystem.
To add to the other comment, Mithril.js is another frame work that hasn't changed much for the last 7 years.
React class components from 2014 literally work without much changes (bar 2-3 APIs like componentWillMount & componentWillReceiveProps). No one forces you to use the new stuff.
Every non-dead project is evolving and is adding new things. Even behemoths like Java or C++. But maybe Ember.js is technically not dead and is mostly the same? I don't know, it's bad and I prefer rolling with the tide.
My favorite thing about learning Svelte was that it has my favorite "documentation" of any library. It's just a list of code samples showing various different scenarios [0]. This made it dead easy for me to understand its way of doing things without needing to get too deep into the methodology.
[0]: https://svelte.dev/examples/hello-world