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.
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?
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.
[+] [-] snide|1 year ago|reply
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
[+] [-] dbbk|1 year ago|reply
[+] [-] gedy|1 year ago|reply
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.
[+] [-] alanwreath|1 year ago|reply
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?
[+] [-] mrd3v0|1 year ago|reply
[+] [-] move-on-by|1 year ago|reply
This is classic React!
[+] [-] tacone|1 year ago|reply
[+] [-] purple-leafy|1 year ago|reply
I picked up Svelte 3, and 4 last year and used it to build many browser extension UIs.
I really enjoyed my time with Svelte but I found it did not scale well. Maybe that’s a me problem though.
I’ve since switched over to using React, and I’m really enjoying writing React. NOT working with others React code though, that still sucks.
But I’ve actually switched to using React for my browser extension UIs. Prefer it
[+] [-] ravenstine|1 year ago|reply
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?
[+] [-] alanwreath|1 year ago|reply
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.
[+] [-] danielscrubs|1 year ago|reply
Any recommendations for building SPAs that can last a decade without constant rewrites?
[+] [-] toastercat|1 year ago|reply
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.
[+] [-] morbicer|1 year ago|reply
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.
[+] [-] vbilopav|1 year ago|reply