Comment by wg0
16 days ago
I was a big Sevelte fan. After writing a sizeable application in Sevelte I realized that React is superior in every way overall speaking and at least you're writing 100% pure JavaScript directly. Or Typescript.
Plus the ecosystem. It's huge. Nothing comes closer.
You might be interested in solid.js. To me, it's easier to work with than React. What I like about it is that the reactivity model is small enough that you can understand it, and even implement a basic version yourself.
It also uses JSX, but since there's no virtual DOM, you can also write 100% JS, but, unlike React, you can do it without any special wrapper. So you don't need to use or write a `react-dnd`, just use any vanilla drag and drop library.
I've tried solid and it's much nicer on small projects. How well does it scale though? Modern React is also 'more functional' (for some definition) but it comes at a cost of cumbersome and leaky abstractions. Classic React walked a fine line of being 'just reactive enough'. You could make code declarative and composable while still micromanaging certain lifecycle and data dependency decisions that can be critical for performance.
I've built quite complex applications (e.g. a spreadsheet app) using SolidJS as a base layer, and in that sense it scales really well. It's very easy to separate data management from the UI, so architecturally it scales well, and performance-wise we rarely had issues with it at all.
The biggest issue is in finding people to work with it. If you're hiring React developers over web developers, they will probably struggle more with SolidJS's differences from React, in part because they just look so similar that there's more to "unlearn". But most web developer (i.e. anyone who can understand beyond just the confines of their favourite framework) should find it relatively easy to understand what's going on.
3 replies →
[dead]
> 100% pure JavaScript directly
How did the React community convince so many people of this falsehood? Do that many people just not know what javascript is? It baffles me that one could look at JSX and be like, “that right there is vanilla javascript”.
Yeah man it’s pure JS trust me just add this little transpiler and you’re good to go. What do you mean you don’t have a bundler?
History is important here. React came at a time when so many frameworks used custom template libraries for variable binding, looping, conditionals, etc. Usually it was some HTML/XML-like markup language.
vanila javascript would not be far off, just replace the tags with function calls. In early versions of react, there were people who wrote code like that. For some reason web devs since collectively agreed that the xml syntax is essential to web technologies
What people mean is obviously that you use JS primitives for looping, branching, conditionals, etc. over some DSL. Everybody knows that the tags are added syntax, there is no conspiracy here.
"These burgers are pure beef! Obviously what people mean is that beef is one of the ingredients. Everyone knows that the plastic is added in, there's no conspiracy here"
2 replies →
JSX is basically just a subset of E4X.
Could you expand on your experience compared to react?
I had main issue with smaller ecosystem. Very limited components and everything else is geared towards React. Take React Query for example. If you want first class data caching and retry logic etc, then Svelte support was second class at least couple of years ago.
Same goes for component libraries.
>Sevelte
FYI: https://www.merriam-webster.com/dictionary/svelte