Live data from Hacker News

Svelte’s characteristics that likely contribute most to improved performance

chuniversiteit.nl

181–190 of 205 posts

Re: Svelte’s characteristics that likely contribute most to improved performance

#181

The fact this is already outdated by more recent Svelte releases which changed things drastically is exactly my problem with the modern JS space. So fast moving and most of it is still doing JQuery like reactivity. I am probably just not smart enough to get it, but it reminds me of the constant seemingly pointless rewrites I see in companies. Figure out what works and keep it, is that so hard? Why can other languages…

> Figure out what works and keep it, is that so hard?

Yes, very. Perfect design upfront can eliminate the need to change it later, but you never get it perfect, so you continue to "figure it out" for many years with many failed attempts in the process.

Re: Svelte’s characteristics that likely contribute most to improved performance

#182
post #169

Earlier quoted context omitted.

The reason the web changes so fast, and there are so many rewrites, is the same reason a puzzle whose pieces don't fit together keeps getting shifted around and restarted. People are looking for a satisfying non-leaky abstraction to build upon and they don't find it with web technologies. They get close, but those last few pieces never quite fit, and we lack the power to reshape the pieces, so we tear out all the pie…

>People are looking for a satisfying non-leaky abstraction to build upon and they don't find it with web technologies. They get close, but those last few pieces never quite fit, and we lack the power to reshape the pieces, so we tear out all the pieces and try again. Maybe this next time we'll find a better way to fit them together. Also keep in mind the web standard puzzle is also changing all the time to try make t…

I think you're mixing some things up there.

The history of making HTTP requests in the browser has only been two APIs: XMLHttpRequest -> fetch. Fetch is an upgraded version of XMLHttpRequest with a promise-based API and better async/streaming support.

Ajax was a word used to describe the technique of making http requests in the browser, and axios is a third party library that wraps different APIs on different platforms to provide a unified interface. These were never separate browser APIs.

Re: Svelte’s characteristics that likely contribute most to improved performance

#183

It's worth pointing out this article is discussing Svelte 3.x when the current version is Svelte 5.x and has some significant departures from previous versions (i.e. the introduction of runes) I haven't finished reading the article yet. I am a fan of Svelte, though, and have switched to using it by default for new projects - coming from a React background.

Things change so fast in web dev. Is it so hard to find a pattern that works and stick to it? I think the constant rewrites are honestly _worse_ for dev experience and security. Nobody knows whats standard and docs become outdated so quick a lot of frameworks just have outdated docs or multiple versions that contradict eachother.

I picked React over Angular in 2015 and havn’t looked back. I’ve never done, nor been asked to do a rewrite. I once interviewed for a role that would have involved a rewrite from Angular to React. My current employer has a design system and UI library to implemenet it. Some time before I joined, they decided to move from Stencil-driven support for React, Angular and one other framework, to pure React support. From 50-60 applications I made late 2024-2025 one used Lit one Svelt, maybe 10-15 Angular and the rest React. In previous rounds of job or contract hunting, I don’t recall seeing demand for anything other than the big two.

I live and work in London. I’ve basically not seen this culture of constant churn and rewrites that people on HN bemoan since about 2018.

Re: Svelte’s characteristics that likely contribute most to improved performance

#184
post #134

Earlier quoted context omitted.

Frontend web development is effectively distributed systems built on top of markup languages and backwards compatible scripting languages. We are running code on servers and clients, communicating between the two (crossing the network boundary), while our code often runs on millions of distributed hostile clients that we don't control. It's inherently complex, and inherently hostile. From my view, RSC's are the first…

Except RSC doesn't solve for apps, it solves for websites, which means its server-first model leads you to slow feeling websites, or lots of glue code to compensate. That alongside the immensely complex restrictions leaves me wondering why it exists or has any traction, other than a sort of technical exercise and new thing for people to play with. Meanwhile, sync engines seem to actually solve these problems - the di…

> Except RSC doesn't solve for apps, it solves for websites

This isn't true, because RSCs let you slide back into classic react with a simple 'use client' (or lazy for pure client). So anywhere in the tree, you have that choice. If you want to do so at the root of a page (or component) you can, without necessarily forcing all pages to do so.

> which means its server-first model leads you to slow feeling websites, or lots of glue code to compensate

Again, I don't think this is true - what makes you say it's slow feeling? Personally, I feel it's the opposite. My websites (and apps) are faster than before, with less code. Because server component data fetching solves the waterfall problem and co-locating data retrieval closer to your APIs or data stores means faster round-trips. And for slower fetches, you can use suspense and serialize promises over the wire to prefetch. Then unwrapping those promises on the client, showing loading states in the meantime as jsx and data stream from the server.

When you do want to do client-side data fetching, you still can. RSCs are also compatible with "no server"-i.e. running your "server" code at build-time.

> To me it's a choice between lose-lose (complex, worse UX) and win-win (simpler, better UX)

You say it's worse UX but that does not ring true to my experience, nor does it really make sense as RSCs are additive, not prescriptive. The DX has some downsides because it requires a more complex model to understand and adds overhead to bundling and development, but it gives you back DX gains as well. It does not lead to worse UX unless you explicitly hold it wrong (true of any web technology).

I like RSCs because they unlock UX and DX (genuinely) not possible before. I have nothing to gain from holding this opinion, I'm busy building my business and various webapps.

It's worth noting that RSCs are an entire architecture, not just server components. They are server components, client components, boundary serialization and typing, server actions, suspense, and more. And these play very nicely with the newer async client features like transitions, useOptimistic, activity, and so on.

> Meanwhile, sync engines seem to actually solve these problems

Sync engines solve a different set of problems and come with their own nits and complexities. To say they avoid complexity is shallow because syncing is inherently complex and anyone who's worked with them has experienced those pains, modern engines or not. The newer react features for async client work help to solve many of the UX problems relating to scheduling rendering and coordinating transitions.

I'm familiar with your work and I really respect what you've built. I notice you use zero (sync engine), but I could go ahead and point to this zero example as something that has some poor UX that could be solved with the new client features like transitions: https://ztunes.rocicorp.dev

These are not RSC exclusive features, but they display how sync engines don't solve all the UX problems you're espousing they do without coordinating work at the framework level. Happy to connect and walk you through what a better UX for this functionality would look like.

Re: Svelte’s characteristics that likely contribute most to improved performance

#185

Earlier quoted context omitted.

The reason the web changes so fast, and there are so many rewrites, is the same reason a puzzle whose pieces don't fit together keeps getting shifted around and restarted. People are looking for a satisfying non-leaky abstraction to build upon and they don't find it with web technologies. They get close, but those last few pieces never quite fit, and we lack the power to reshape the pieces, so we tear out all the pie…

This is insightful. I remember thinking after the first generation of SPA frameworks like Backbone and Ember and—somewhat later—AngularJS that maybe the second generation (React, Vue, etc.) would get it all sorted out and we'd arrive at stability and consensus. But that hasn't happened. The next generation was better in some ways, worse in a few, and still not quite right in many others. Of course I hear plenty of pe…

> [...] we'd arrive at stability and consensus.

Honestly, that's basically happened, but just a generation later.

Most modern frameworks are doing very similar things under the hood. Svelte, SolidJS, and modern Vue (i.e. with Vapor mode) all basically do the same thing: they turn your template into an HTML string with holes in it, and then update those holes with dynamic data using signals to track when that data changes. Preact and Vue without Vapor mode also use signals to track reactivity, but use VDOM to rerender an entire component whenever a signal changes. And Angular is a bit different, but still generally moving over to using signals as the core reactivity mechanism.

The largest differences between these frameworks at this point is how they do templating (i.e. JSX vs HTML vs SFCs, and syntax differences), and the size of their ecosystems. Beyond that, they are all increasingly similar, and converging on very similar ideas.

The black sheep of the family here is React, which is doing basically the same thing it always did, although I notice even there that there are increasing numbers of libraries and tools that are basically "use signals with React".

I'd argue the signal-based concept fits really well with the DOM and browsers in general. Signals ensure that the internal application data stays consistent, but you can have DOM elements (or components) with their own state, like text boxes or accordions. And because with many of these frameworks, templates directly return DOM nodes rather than VDOM objects, you're generally working directly with browser APIs when necessary.

Re: Svelte’s characteristics that likely contribute most to improved performance

#186
post #82

Earlier quoted context omitted.

Just to clarify: despite its name, React has no reactivity engine at all and re-renders unconditionally on any state changes or parent re-renders. You have to opt-in to prop-diffing conditional re-renders (which I wouldn't call a "reactivity engine" either) per component, via React.memo. And then you also have to opt-in to prop memoization for non-primitives for the prop-diffing not to be useless. These re-renders mi…

I am probably just misguided but multiple things you say you "wouldn't call a reactivity engine" only exist to support updating DOM (reactivity) efficiently. So what would you call them? They only exist to update the DOM, which is itself the reactivity we all want. Technically you could just getElementById and update it, but react has what I call a whole "reactivity engine" to do it for you.

Reactivity has a specific meaning in programming:

https://en.wikipedia.org/wiki/Reactive_programming

https://en.wikipedia.org/wiki/Functional_reactive_programmin...

Which I think React doesn't really fit. React is not about data streams, nor about inferred dependencies.

> Technically you could just getElementById and update it, but react has what I call a whole "reactivity engine" to do it for you.

I would call that "declarative", not "reactive".

https://en.wikipedia.org/wiki/Declarative_programming

The closest thing to reactivity React has are dependency arrays in `useCallback` but I'd say it's a stretch to call that reactive programming.

Compare it with SolidJS's data flow. https://docs.solidjs.com/ Also notice how "reactive" is all over their landing page while React doesn't mention "reactive" at all https://react.dev/

Re: Svelte’s characteristics that likely contribute most to improved performance

#187
post #162

I still like Svelte, but to me SvelteKit has taken up too much of its mind/devshare. Svelte itself is fantastic, especially as a Vue guy I love the "new" reactivity system/runes, but SvelteKit for me is horrible. It's just a hodgepodge of over engineered crap to cater to React/Next devs, and the Svelte team has also been hell bent on horrible decisions like the abomination that is routing[1] in SvelteKit. To me Kit i…

The router is really baffling, agreed. Magic file names make me so frustrated, and even more so when they all start with the same prefix so all my editor tabs look the same. I wish they’d just make a simple single file router that works the same as every other one. There are a lot of things that aren’t perfect in Vue, which I primarily work on, but the router isn’t one of the things that bothers me. It mostly just wo…

Just drink the Koolaid. I hated the magic files but now I love them

Re: Svelte’s characteristics that likely contribute most to improved performance

#188
post #48

Svelte is definitely still my favorite way to build web apps in 2025. I wasn't (and still am not) the biggest fan of the new Runes syntax, but I've gotten used to it, and it doesn't really hurt my productivity or get in my way that much. There's definitely an ecosystem gap compared to React, but there are still lots of really good components and frameworks out there. For example, there's a native Svelte version of IB…

Of note - Svelte publishes documents specifically intended for LLM consumption, https://svelte.dev/docs/llms Making my LLM aware of these documents significantly mitigated issues I had with adopting Svelte 5 syntax.

Providing such files should become more common for libraries. Very useful.

Re: Svelte’s characteristics that likely contribute most to improved performance

#189
post #162

I still like Svelte, but to me SvelteKit has taken up too much of its mind/devshare. Svelte itself is fantastic, especially as a Vue guy I love the "new" reactivity system/runes, but SvelteKit for me is horrible. It's just a hodgepodge of over engineered crap to cater to React/Next devs, and the Svelte team has also been hell bent on horrible decisions like the abomination that is routing[1] in SvelteKit. To me Kit i…

The router is really baffling, agreed. Magic file names make me so frustrated, and even more so when they all start with the same prefix so all my editor tabs look the same. I wish they’d just make a simple single file router that works the same as every other one. There are a lot of things that aren’t perfect in Vue, which I primarily work on, but the router isn’t one of the things that bothers me. It mostly just wo…

Magic files are one thing (and just personally having a filenane beginning with + is just damned ugly). You also even have magic folders, which for me was a first.

Even if I could ignore that, for my super tiny hobby project that I tried Kit with, the routing ended up being strewn across a million folders and files that are called +page nested in (page) folders, and a super tiny app turned into a nightmare to navigate and find things in. I didn't even use any of the stupid SSR stuff, just SPA mode, I can't even imagine what it ends up looking like with +layout and all the server-side files

Re: Svelte’s characteristics that likely contribute most to improved performance

#190
post #162

I still like Svelte, but to me SvelteKit has taken up too much of its mind/devshare. Svelte itself is fantastic, especially as a Vue guy I love the "new" reactivity system/runes, but SvelteKit for me is horrible. It's just a hodgepodge of over engineered crap to cater to React/Next devs, and the Svelte team has also been hell bent on horrible decisions like the abomination that is routing[1] in SvelteKit. To me Kit i…

The router is really baffling, agreed. Magic file names make me so frustrated, and even more so when they all start with the same prefix so all my editor tabs look the same. I wish they’d just make a simple single file router that works the same as every other one. There are a lot of things that aren’t perfect in Vue, which I primarily work on, but the router isn’t one of the things that bothers me. It mostly just wo…

> they all start with the same prefix so all my editor tabs look the same

You see, this is something I think deeply about when creating a web framework.

I'm just glad there's another person on this plannet who thinks about file names and how they appear in code editors.

Post reply on HN