Live data from Hacker News

Svelte 5 Released

npmjs.com

151–160 of 254 posts

Re: Svelte 5 Released

#151
Svelte 5 is almost heaven, I thought. But it's full heaven.

To keep it short: The Svelte team did a remarkable job improving every aspect but preseriving the characteristics and distinctive features (fast, small, easy, elegant).

Now, where I struggled (using Svelte 5 on a business logic heavy SPA since RC in April):

Signal in general are extremly easy to use, but quite hard to track. You have to "know" or "find out" if something is reactive. Vue makes it easy with their .value API, but also not 100% foolproof.

With React: Everything is a value. Unidirectional data flows. It's very easy to follow the flow of the data.

With Angular: Data pipelines are built using RxJS. Hard to learn, but extremely powerful. You can follow the data flow quite well. Not as easy as with React, but once you are good with RxJS, still easy enough.

With Svelte 5: Runes look like values. This mental model is good enough most of the time. It's especially great in small contexts where you exactly know where your variable comes from or where everything is reactive. But Runes also behave like signals and proxies. So, you sometimes need to know exactly what is in your bag. Is it a value? A signal ($state with value or $state.raw with object or array)? A proxy ($state with array or object)? In larger contexts it gets really hard to track.

Why is Svelte still full heaven to me: I realized that Runes are just the basic building blocks. They are the common basic toolkit. I don't have to use them in large business logic areas of my apps. I can create (nominal typed, using TS of course) custom wrapper classes, e.g. to only allow signals, not proxies. This wrapper classes could disallow mutation. Passing those around makes it type safe. If I see a value, it is a value. If I see a type of my reactive wrapper class, it is reactive. Or, I can use RxJS and Svelte 5. Or I can mimic Vue's or Solid's APIs (as Rich showcased).

There's a spot in the new docs (wip) where the Svelte team is going to explain Runes. I think they're also (as other Signal experts - I hope Prof. Signal Carniato solves this for all of us :-)) working on better debugging tools.

I'm happy.

Big thanks and respect to the Svelte team.

Re: Svelte 5 Released

#152
Unpopular opinion: Svelte 4 was much better. It was truly invisible and it used basic JS syntax to do what you wanted. Now runes ruined it.

Re: Svelte 5 Released

#153
post #48

Hope it starts to chip into React’s usershare and more companies adopt it, but I know that’s a slow process especially for the big companies. I got out of front end development for most of the years Angular and React have dominated and it looked like a mess, but Svelte and even Astro make sense, maybe I’m just old school. I would totally go back to the frontend with these new frameworks.

If Vue hasn't made a dent, I don't ever expect Svelte to. Angular was the only high-level competitor and I haven't heard that one in a long time already.

For a framework to eat into React's usage, it needs a strong evangelist (like Facebook has been for React)

Re: Svelte 5 Released

#154
post #140

Earlier quoted context omitted.

Yeah. And that’s basically the thing, right? If I need to hit a certain performance because the business has concluded that it matters, and React can’t get us there, then I’m likely switching to Svelte or whatnot. If none of my tools can do the job, I’m going to the store and buying a new tool and learning how to use it. I don’t feel ideologically attached to my palm sander. I’ll buy a belt sander if the palm doesn’t…

But your tools can't do the "performance" job right now, it's just that there is enough "friction" in the management/decision chain that it may not be decided on by "the business". Though the desire to improve without external pressure could be considered ideological

Hora do you know that? I've seen really well optimized React apps and very poorly optimized Svelte apps. It's not like using Svelte magically makes performance good. Just like using Unreal Engine doesn't mean that a game is optimized. You just have different, maybe better, tools to improve performance.

Re: Svelte 5 Released

#155

I can wholeheartedly recommend Svelte. As someone who can only do vanilla HTML/CSS/JS, it lets me build projects quickly and efficiently without having to learn something complex like React. Case in point this silly side project made in Svelte over a weekend: https://meoweler.com

> vanilla HTML/CSS/JS

Svelte reminded me of how I got my start with coding. I love it. Refusing to learn React has cost me job opportunities but Svelte is just so much more pleasant to use and easy to grok.

I’m currently building a social network with SvelteKit and I couldn’t be happier. Excellent DX.

Re: Svelte 5 Released

#156

Svelte 5 is almost heaven, I thought. But it's full heaven. To keep it short: The Svelte team did a remarkable job improving every aspect but preseriving the characteristics and distinctive features (fast, small, easy, elegant). Now, where I struggled (using Svelte 5 on a business logic heavy SPA since RC in April): Signal in general are extremly easy to use, but quite hard to track. You have to "know" or "find out"…

It’s interesting to watch this carcinization of reactivity in all major frameworks. They all started out differently, but seem to settle around the same general concepts. These days, you could sit a React guy in front of a modern Vue app, and they could probably figure out how to work with it relatively fast.

Re: Svelte 5 Released

#157

I love Svelte and use it for all my personal projects and all company projects (except strictly static sites are still built with just 11ty but I hate it and want to move off it). But I'm going to wait a bit on v5 for the company, scanning all the issue headlines, it looks like there are a still a lot of unresolved edge cases: https://github.com/sveltejs/svelte/issues As for my latest personal project, upgrading righ…

offtop, but could you share a bit on why you hate 11ty? I was considering it for a static site.

I've used 11ty on and off since pre-1.0. The documentation remains awfully confusing and doesn't cover common use-cases. The system has been pulled together but not thought out as a whole.

Lume (from Deno) is my preferred 11ty alternative.

Re: Svelte 5 Released

#158
post #76

Earlier quoted context omitted.

Just my personal opinion: I love svelte for small projects but the whole runes rewrite just feels so much less ergonomic. A step in the direction away from the simplicity that drew me to svelte in the first place. That said, there is backwards compatibility with the older syntax, so this isn’t a dealbreaker, and the team does a good job of explaining the reasons behind their selected design patterns. (Interestingly,…

This is more or less where I’ve landed lately. There are some things I really like in Svelte and Solid but not enough to overcome the massive ecosystem advantage React has.

I never understood the ecosystem argument as applied to Svelte. Vanilla js libraries integrate with it pretty much perfectly, meaning you don't need a Svelte port of a given library. The ecosystem is effectively huge.

Re: Svelte 5 Released

#159
post #98

I don't understand how React is so popular, still. With Svelte and Vue, I don't think anybody should do a new project with React.

I'm building a React app from scratch and since I have control this time, I'm following a strict pattern: all data manipulation (∆) happens outside of React components, and the components themselves are as lightweight as possible. I feel like this change suddenly makes everything about the React paradigm make sense - it can be just a view layer, and when used that way, it works great. But I can't say I've ever worked…

> all data manipulation (∆) happens outside of React components,

I do something similar. State and its management lives outside the React components, which only consume this state via hooks. Keeping the state in chunks, and outside the tree lets me access a chunk of state only in the components that need it.

This results into minimum amount of re-rendering of components. Component code also looks cleaner and easier to read.

Re: Svelte 5 Released

#160
post #98

I don't understand how React is so popular, still. With Svelte and Vue, I don't think anybody should do a new project with React.

My workplace will adopt React for the sole purpose of being easy to find new React developers as it's the most popular library for reactive UI.

Everyone at the company knows a little React already. We are not good at it and we don't like it, but I guess for them it's a safe bet.

Post reply on HN