Solid.js, which self-describes as a reactive JavaScript UI library,  recently released its first major iteration. Solid replicates many capabilities (e.g., server-side rendering, concurrent rendering) and APIs (e.g.,  stores,  context,  directives) available in other UI frameworks. Developers describe how the appearance and behavior of user interfaces relate to a set of reactive dependencies. Solid compiles the statements to imperative DOM operations.

Web applications are reactive applications whose behavior is the specification of how the application reacts to incoming events. That reaction  typically consists of updating the state of the application and executing commands that affect the systems the application interfaces with. Solid lets developers reify the state of the application as reactive values and bind events to state updates and command execution.

A simple application that iterates through a list of colors every second

demo application with Solid

may be defined in pseudo-code by the following declarative statements:

colors ≡ ["blue", "red", "green"]
index  ≡ count mod 3
color  ≡ colors[index]
init => count <- 0, set recurring timer
exit => cancel timer
second elapsed => count <- count + 1
color update => render <div style={{color: color()}}>Color: {color()}</div>;

#javascript #javascript libraries

Performance-Focused Reactive UI Framework Solid.JS Releases First Major Version
1.50 GEEK