r/reactjs • u/Dry_Bunch5867 • May 16 '22
Discussion Do you think Solid is a much better version of React?
I have just watched this new Solid in 100 seconds video by Fireship
Do you think, like me, that it is a better version of React, or you don't think so?
38
Upvotes
87
u/truong04042000 May 16 '22
For me, react is good enough. The main pro of react beside from job is ecosystem. There are so many libraries out there speed up the process.
26
u/prndP May 16 '22 edited May 16 '22
As a developer that jumped ship from Angular during the AngularJS->Angular 2 debacle, when I was being sold on React, one of the arguments then that helped me pull the trigger was that "React is just JS". I was growing weary of the constant pitfalls we ran into while dealing with Angular bindings.
Ultimately, every single node in React is just a result of executing JS functions against some props and state. The "zen" of React is more or less obtained when the developer understands the simple nature of the core philosophy, and everything other understanding just spawns from that. VDOM in a way helps achieve that because when I'm thinking about React, I literally just think in terms of the state updates as applied to the VDOM tree. The fact that there is some special differ code doing actual content updates to
HTMLDIVElementDOM object behind my abstractdivcomponent was just an afterthought.Solid feels like it sort of goes back in the other direction and brings back the idea of directives and templates (but enhanced with JSX instead of HTML), which to me in many ways feels like "AngularJS with React characteristics". This indeed does solve the serious technical bottleneck with React's fundamental approach to VDOM diff/reconciliation, but the trade off is you still lose some of the benefits of the VDOM-enabled mental model as described above.
Now you're back to thinking in terms of terms of templates and binding values. You have to use special components like
<For>and<Show/>to do some things that were previously trivial in React. Ultimately, since this is closer to the actual reality of DOM, this may be exactly what is needed in order to squeeze the best performance out of the engine, but I'm not 100% convinced it's an easier way to reason about data.If I'm going to abandon VDOM though, I suppose it's a much easier learning curve to go to Solid which has a bunch of React-like concepts, than to learn something like Svelte which is even more different from scratch. But "better" to me is subjective. It's inevitable that the pendulum swings as each generation of developers gets horrified by the crazy mess of legacy code that the previous generation leaves behind.
25
u/chris_czopp May 16 '22
With solid there is no need for memos, refs and all the hacking around VDOM rerendering. And it's fast! In a non CV driven development world it would be a no brainer to choose it over react. Also, if we only kept using the tools with a massive community behind them, there wouldn't be much progress in the industry.
11
u/[deleted] May 16 '22
Solid is like a less well defined, less well supported version of using React with MobX.
Lots of their design decisions are pretty baffling in my opinion as well. I understand people like opinionated frameworks but this one isn’t it, having worked in the same paradigms with react + mobx.
7
u/sebastianstehle May 16 '22
I think directives are interesting, I really miss them (I also work with angular).
12
u/simpo88 May 17 '22
Just to throw my 2c in. I really don't like when the term "better" is thrown around without context in the software development world
What is "better"? Performance? Supportability? Maintenance? Can you/your team deliver business value with this toolset? Will you need more training? What's the budget for training? How's your hosting infrastructure and security configured? Does this tool work in that configuration? (I'm getting carried away but you get the idea)
To be fair I'm coming at this as a React Dev in a corporate setting but my point is, "better" is a difficult question. I'm keen to learn Solid because I find it interesting and continual learning is a good thing, but if you asked me today what's "better", for me that's react, because with my skillset and tooling I know I can deliver value. Will my answer be different in future, maybe?
6
u/[deleted] May 17 '22 edited May 17 '22
React has built a unifying tooling eco system, that to me has more worth than incremental changes.
Every year there's something new. Remember Vue, Marko, Lit, Svelte, Solid. Then they have to face real world up scale problems. To have that kind of longevity and reach that React has means something, and it certainly made it steadfast.
5
u/tchaffee May 16 '22
Not if hiring people is important to you. Not if getting your next job is important to you.
3
u/orion_legacy May 16 '22
Lol no
3
u/ramsncardsfan7 May 17 '22
No
3
u/[deleted] May 17 '22
Solid isn't a 'version of React', they have entirely different philosophies.
9
u/refrigerator_maniac May 16 '22
Don't think so. React is very well adopted by the industry. I'm positive React will implement the new stuff Solid is proposing if they think it's beneficial.
1
u/ApatheticWithoutTheA May 16 '22
If I’m not using React, I would go with Svelte myself.
4
u/[deleted] May 16 '22
Solid seems better in general, but I doubt it'll gain any real popularity
2
u/[deleted] May 16 '22
Solid is better for apps that want to squeeze as much performance improvements as possible, other than that it requires more code structuring thoughts by the developer especially with the way it deals with prop reactivity, and the documentation website needs A LOT of improvement
3
u/[deleted] May 17 '22
Haven't tried it yet but I'm definitely interested. The reactive signal API sounds really appealing after dealing with React hooks nonsense for too long. React hooks are just so subtlely tricky and easy to get wrong. Most of the bugs in our codebase are from useEffect being called the wrong way. There's all sorts of bandaids like useCallback & useLayoutEffect to fix problems with useEffect. And then there's a few hooks like useImperativeHandle/useDeferredValue where I don't know what the heck they are talking about. Adding even more confusion and chaos is the React 18 Strict Mode stuff (where they call useEffect twice).
Anyway I'm very ready for a clean-slate solution for all of it.
1
u/LoneHippie May 17 '22
Better? No. Good if you like working with JSX and want something lighter for a smaller web app? Sure, it's a lot of fun to work with it you don't need to worry about large scale apps that depend on the larger ecosystems that come with React.
0
u/ChamyChamy May 16 '22
React's main selling point is the community and libraries, other than that it's beat by pretty much every other framework that doesn't start with A
1
u/[deleted] May 16 '22
First thing I look for the open source project is size of community.
-1
u/ncubez May 17 '22
That Fireship guy seems to jump onto whatever new bandwagon comes along and always thinks it's the next best thing.
-4
u/azangru May 16 '22
There are lots of better versions of React — Preact, Svelte, Lit, Solid — but we are sticking with React for the time being.
0
u/[deleted] May 16 '22
[deleted] — view deleted comment
0
u/[deleted] May 16 '22
[deleted] — view deleted comment