Start use SolidJS today
TL;DR
- What is SolidJS?
https://www.solidjs.com/ - Can I play with this online?
https://www.solidjs.com/tutorial/introduction_basics - How can I start a new project using SolidJS?
https://www.solidjs.com/guides/getting-started - How does SolidJS differ from other frameworks and libraries (React, Vue, Svelte)?
https://youtu.be/FB_kBYO_vIw - How does SolidJS work from the inside?
https://youtu.be/_ne2BsvFBH0
https://youtu.be/j8ANWdE7wfY - More Solid stuff
https://github.com/search?q=solidjs
https://dev.to/search?q=solidjs
https://medium.com/search?q=solidjs&ref=opensearch
Yet another framework?
I often like to repeat that the front-end is comparable to medicine: technologies are constantly appearing and disappearing, new methods of solving certain problems are emerging, the tools are constantly being updated, so you need to be aware of what is happening in the world to keep up. At the moment, there are well-established front-end development leaders in the world: React, Vue, Angular. Of course, we can mention that Angular is gradually fading into the background (Angular developers can argue with me), and Svelte is gradually winning hearts. Is there a place for another (yet another) framework in this world? I think SolidJS fits well into this series.
People tend to strive for something permanent and stable. For instance, if I do like coding React for a long time, then I’ll get more and more immersed into the React ecosystem: I’ll master new libraries (or maybe I’ll make new ones using React), I’ll use it for new projects (pet projects too), or, maybe, I’ll post articles about React and guides. In the end, I know React, I’m used to it, I know how it works. But do I need to think about something completely different? For most people something new causes a little stress, because this new thing breaks out of the usual, established environment. “Why do I need a new one? I have a nice and working (!) old one.” I can agree with that. React and other frameworks help to solve the main task: to create a business and earn money. There are hundreds of companies that use jQuery and make money. The only difference is in effort and preferences. I’ll try to convince you to try SolidJS.
Solid instead of React?
I want to focus on comparing React and SolidJS because, in my opinion, these two tools are very similar in syntax but radically different in implementation. I would note that SolidJS should be called ReactJS. So, what are the cardinal differences?
React uses VDOM and diffing logic for rendering. Let’s imagine that we no longer need component renderers because we don’t use VDOM and comparison logic? Imagine there is a way to write components whose code will be executed only once (there should be a mention of Svelte, however, everything is not as simple as it seems to be)! We can forget about props memoization, about useCallback, and other things. Imagine that the components will be reactive for real! Reactivity will come not from the name of the framework, but its implementation. Imagine that you no longer need to choose a state manager, because all state management is already implemented out of the box. However, if you want, you can use third-party libraries, but you don’t have to. Moreover, you immediately get a performance close to VanillaJS. At the same time, it will be possible to write almost with the syntax that React uses! It turns out that there will be no need to spend a lot of effort on retraining, it will be relatively easy to adapt react libraries to the new framework, the react developer market will not lose its relevance, because all these developers will be able to use the new framework quite simply!
When I tell my friends about SolidJS, I hear the same thing every time: “How not to shoot myself in the foot.” I understand why they look at SolidJS with apprehension: something new has appeared (in fact, Solid has been for five years), which does not have such a large ecosystem as React. But it will have nowhere to come from if we don’t start using SolidJS! Therefore, I suggest that all my friends at least try SolidJS in their pet projects.
I like that there are lots of videos on youtube in which the creator of SolidJS himself (https://www.youtube.com/c/RyanCarniato9) talks about how he made this framework, what inspired him. Also, he analyzes in detail how everything works and compares the implementation with Vue, React and Svelte (we can discover a lot of interesting facts about how cleverly Svelte works).
Caveats
Solid is stable now. SolidJS maintainers very actively discuss new improvements and functionality with the growing community. However, there are disadvantages. I should tell you about them. Yes, Solid is not under the wing of a big company like Facebook or Google. Yes, Solid does not have such a large ecosystem and libraries (yet). Solid-start (similar to Svelte-kit, Next.js) is only in the alpha version. The community around Solid isn’t that big yet. However, you can use SolidJS now for SPA and SSR. It also supports Streaming for SSR, however, you will have to configure everything by hand, which many developers do not like.
Just give it a try
In this post, I wanted to convey to you one idea: try new things to have a richer toolkit for solving problems. Always think about how to make things better.
I like Solid, so I want you to like it too :)