Comment

Comment by dissent

I have recently joined a team that had invested in Svelte. I had previous experience in Angular and React. I was happy with React, but I decided to drink the koolaid and go all-in and do my best with Svelte.

6 months later, we're moving to React. It is partly because our Svelte code was messy enough to warrant a rewrite, and partly because we wanted to leverage the React ecosystem in that rewrite. It was also partly because I just don't like Svelte very much.

I think Svelte is clever, and interesting, and I'm glad it exists. But I found a few points insurmountable:

- Too much magic. The abstraction leaks and when it does, it requires a good mental model of Svelte's magic. I noticed this threw our juniors off.

- Special syntax for reactivity is not javascript

- I find the javascript-native flexibility of JSX far more expressive than any custom templating

- There are major tradeoffs made by doing things at compile time. Things that are easy in React at runtime turn out to be surprisingly difficult in Svelte

- Two-way data binding is a constant source of bugs

- Svelte practically requires let-style variable rebinding, often at a file wide scope, which again caused our juniors in particular to write bad code

- The style system is too opinionated for me. I also find it necessary to break into the global scope for any minor restyling of a subcomponent (or worse, pass in the style as a prop)

- Built in reactive store is cool, but our developers all ended up using it for tight coupling and global variables

- The strict one component per file approach can be cumbersome. It's not possible to write a one-line function component or similar

- Much smaller ecosystem than React, requiring much more to be done in house (exacerbated by all of the above).

- The faster runtime speed in no way made up for any of the above. Bad Svelte code is still slow compared to good React code.

parent dissent 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton