from Hacker News

Svelte 5 release candidate (RC)

by benmccann on 4/30/24, 3:22 PM with 17 comments

  • by snide on 4/30/24, 3:56 PM

    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.

    [0]: https://svelte.dev/examples/hello-world

  • by gedy on 5/1/24, 5:21 AM

    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.

  • by move-on-by on 5/1/24, 1:12 AM

    > In Svelte 3 and 4, components are classes. In Svelte 5 they are functions and should be instantiated differently.

    This is classic React!

  • by purple-leafy on 5/2/24, 8:38 AM

    Happy for the Svelte team.

    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

  • by ravenstine on 5/1/24, 11:03 AM

    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?

  • by danielscrubs on 5/2/24, 1:55 AM

    I started using Svelte 4 as I got tired of React constantly changing. Jokes on me it seems.

    Any recommendations for building SPAs that can last a decade without constant rewrites?

  • by vbilopav on 5/1/24, 6:08 AM

    I'll just keep on using Svelte 4