SolidJS: a new player on the frontend field
Every year more and more frameworks and libraries appear in the world of web development. For developers, choosing the right tool is a critical decision that affects performance, maintainability and development speed. In this post we look at Solid Framework, a modern reactive framework that changes the approach to building user interfaces.
Solid Framework is a lightweight reactive framework for JavaScript, designed with a focus on performance and clean code. Its unique feature is native reactivity that works at the JavaScript level, which delivers high performance compared to traditional approaches.
Core principles of Solid
Simple reactivity
The main difference between Solid and other frameworks is its approach to reactivity. In Solid, reactivity is built deep into JavaScript:
import { createSignal } from 'solid-js';
// Creating a signal
const [count, setCount] = createSignal(0);
// Tracking changes
<Counter count={count()} />
Signals in Solid are reactivity primitives that track dependencies and automatically update the DOM when something changes. This means you do not have to manage state manually, and no virtual DOM is needed to track changes.
Reactivity without a virtual DOM
Unlike React, which uses a virtual DOM to optimize rendering, Solid works directly with the DOM. When a subscription is created, its reactive system automatically builds links between a component and its dependencies. When the state changes, only the updated parts of the DOM are redrawn, while the rest stay untouched.
This approach gives several advantages:
- Less load on the JavaScript engine
- Faster initialization
- Easier debugging
- Smaller bundle size
Using Solid: the basics
Installation and setup
Getting started with Solid is very easy:
npm install solid-js
Or with Yarn:
yarn add solid-js
For individual pages or widgets, Solid can be introduced selectively: it is enough to mount a component with render in the right container.
Hello World
A basic "Hello World" example in Solid looks like this:
import { render } from 'solid-js/web';
import { createSignal } from 'solid-js';
function App() {
const [count, setCount] = createSignal(0);
return (
<div>
<p>Counter: {count()}</p>
<button onClick={() => setCount(count() + 1)}>
Increase
</button>
</div>
);
}
render(() => <App />, document.getElementById('root'));
Advanced features
State management
Solid provides several ways to manage state:
- Signals: The simplest form of reactivity
const [value, setValue] = createSignal(initialValue); - Memo: Caching computations
const memoValue = createMemo(() => expensiveCalculation(value())); - Stores: A reactive store for complex data structures
const [state, setState] = createStore(initialState);
Async and promises
Solid supports asynchronous operations through createResource, which manages the data loading state:
import { createResource } from 'solid-js';
function UserProfile(userId) {
const [user, { loading, error }] = createResource(userId, fetchUser);
if (loading()) return <div>Loading...</div>;
if (error()) return <div>Failed to load</div>;
return (
<div>
<h1>{user().name}</h1>
<p>{user().email}</p>
</div>
);
}
Components and rendering
Creating components
Components in Solid are created as plain functions:
function Counter() {
const [count, setCount] = createSignal(0);
return (
<div>
<p>Current value: {count()}/10</p>
<button onClick={() => setCount(Math.min(count() + 1, 10))}>+</button>
<button onClick={() => setCount(Math.max(count() - 1, 0))}>-</button>
</div>
);
}
Event listeners
Solid lets you use both standard and custom event listeners:
function InputField() {
const [value, setValue] = createSignal('');
return (
<input
value={value()}
onInput={(e) => setValue(e.target.value)}
onBlur={(e) => console.log('Blur:', e.target.value)}
/>
);
}
Comparison with other frameworks
Pros of Solid
- Excellent performance thanks to working without a virtual DOM
- A clean and simple API
- A small bundle size, just a few kilobytes
- No redundancy or overhead
- A clear separation between reactivity and rendering
- Good TypeScript support
Cons and limitations
- Fewer ready-made solutions compared to React
- Fewer learning materials and examples
- A more specialized approach
- A less mature ecosystem
Performance comparison: Solid vs React vs Vue
Public benchmarks
In the independent js-framework-benchmark, Solid consistently shows results close to vanilla JavaScript and usually outperforms React and Vue in operations on large lists of data. The exact numbers depend on the browser version, the hardware and the scenario, so it is worth checking the current results on the project's benchmark site.
Developer experience
What practitioners say:
- Solid is ideal for complex interactive interfaces
- React remains the choice for large enterprise applications
- Vue is convenient for building an MVP quickly
We have written more about its neighbors in the field in our reviews of Svelte, which compiles updates before the app runs and React and Vue for a product team.
Practical tips
When to choose Solid
Choose Solid if:
- You need maximum performance
- You want to minimize the bundle size
- You prefer to manage reactivity explicitly
- You work on highly complex interactive applications
- Fast loading and startup of the app matter to you
When not to choose Solid
Do not choose Solid if:
- You need a huge existing ecosystem
- Your team is not used to low-level reactivity
- You need a quick solution with minimal learning effort
- You count on a long support cycle (Solid is still a young project)
The future of Solid
Trends and development
Solid is developing actively:
- An improving ecosystem and components
- Support for new browsers and platforms
- Better integration with TypeScript
- Expanding developer tooling
- Additional libraries for complex scenarios
Market potential
As the demands on interface performance grow, frameworks like Solid have good potential. The clean approach and the absence of overhead make them attractive for new projects and for existing projects that need optimization. With the growth of mobile and resource-constrained devices, Solid's approach becomes especially relevant.
Conclusion
Solid Framework is a serious player in the frontend development market. Its approach to reactivity, the absence of a virtual DOM and its excellent performance make it a great choice for many scenarios.
If you are looking for a modern, performant and clean framework, Solid deserves attention. This is especially true for projects where load time, interactivity and code maintainability matter.
Solid will not completely replace React and Vue, but together they create healthy competition, which in the end benefits all developers. Choosing the right tool is always a compromise between constraints and capabilities.
Summary
- Solid has excellent performance
- A clean and simple API
- A small bundle size, just a few kilobytes
- Active development and support
- Great for interactive applications
- A smaller ecosystem compared to React
- Ideal for projects where performance and code cleanliness matter
Solid is not just another framework. It is a new philosophy of building user interfaces that puts performance and code cleanliness first. If you are ready to try something new and modern, Solid deserves your attention.