logoalt Hacker News

k__today at 6:56 AM6 repliesview on HN

Genuine question:

Why would you use Solid instead of Svelte?

I'm coming from React and most alternatives seem quite similar to me. Only Svelte does things very differently with its compiler. Vue and Solid just seem to be a different flavour of React.


Replies

iainmerricktoday at 4:42 PM

I've tried both and I much prefer Solid. The key advantage for me is that it's just JS/JSX -- you can use it in both your UI code and JS utility functions and it works everywhere. Svelte seems a lot more magical; your UI code is in a special language that looks different and works differently from JS utility functions.

Edit to add: if you dislike JSX I'd guess you would probably prefer Svelte over Solid.

ryansolidtoday at 7:27 AM

Ironically, mechanically Vue and Svelte historically were much closer to React. Vue has a similar VDOM and Svelte while compiled still had a rerun component model. It was only the past year about 6 years after Solid showed the way Svelte 5, and Vue Vapor got away from that and now compile down to what more or less Solid has been doing all along. Of course this is under the surface. But in many ways while Solid itself has stayed relatively small it has profoundly impacted the rest of the ecosystem in a way we haven't seen since React. From Vue, Svelte, to Angular, Preact, and Qwik all using Signals now. The average user of these frameworks probably has no idea but everyday all the non-React frameworks work more and more like Solid.

ManBeardPctoday at 7:15 AM

SolijS is just JS without much magic. It's simple, small and very fast.

You can use signals and effects outside of components and it just works. You can even use a signal from the global scope within a component. Tracking of signals for effects and derived values is automatic. It looks very similar to React, but it's better in every way. Honestly the first time I'm happy with this kind of library. Don't need much more.

Edit: As for Svelte: like it too, but at least before Svelte 5 there were some footguns and differences between components and "normal" JS code. I haven't tried Svelte 5 yet, only watched some videos. From the looks of it would consider it as a good alternative.

alloyedtoday at 10:32 AM

so i managed to convince my company to try solid on a new project, pretty much on the basis of "this looks like react but solves many of our existing problems with react". since the JSX and project structure is basically the same, we could take our (pretty tiny at the time) demo project and do a 1:1 diff and show the differences inline. and it was pretty compelling! the code was simpler, and faster, and we still got to keep lots of the unique patterns/other stuff we were used to when creating react apps

GolDDrankstoday at 7:05 AM

I haven't used Solid yet, but it is commonly said to have "fine-grained" reactivity, compared to React, and better performance.

I also think that Svelte, having a compiler, seems like that it would have an edge in theory.

gawrkura00today at 7:00 AM

[dead]