BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News SolidJS 2.0 Beta: First-Class Async, Reworked Suspense and Deterministic Batching

SolidJS 2.0 Beta: First-Class Async, Reworked Suspense and Deterministic Batching

Listen to this article -  0:00

SolidJS, the fine-grained reactive JavaScript framework, has released SolidJS 2.0 Beta, delivering a comprehensive overhaul of its async handling, reactivity model and developer experience. The release skipped the planned Alpha phase entirely after the team spent an extended period iterating in the Experimental stage, with creator Ryan Carniato noting that "most of the goalposts within Alpha don't appear relevant enough to warrant their own phase."

The headline change in Solid 2.0 is that async is now first-class. Computations can return Promises and the reactive graph handles suspension and resumption automatically. This means developers can pass a promise directly into createMemo and have the framework manage it, removing much of the manual orchestration that was previously required. Alongside this, Loading has been redesigned to handle only initial readiness, showing a fallback while a subtree loads for the first time, then keeping the UI stable during subsequent updates. Pending state is now expressed through isPending(() => expr) rather than tearing down and rebuilding the interface.

Mutations also receive dedicated primitives. The new action() function combined with createOptimisticStore lets developers express optimistic updates, server writes and data revalidation as a single coherent flow. Derived state becomes a first-class primitive through function forms like createSignal(fn) and createStore(fn), and updates are now microtask-batched with reads only updating after a flush() call, making the scheduling model fully deterministic.

The release includes several breaking changes. Index is replaced by <For keyed={false}>, and For children now receive accessors. createEffect has been split into separate compute and apply phases, onMount is replaced by onSettled, and store setters use draft-first semantics by default. The use: directive system has been removed in favour of ref directive factories.

On Reddit, one user noted their positivity towards async:

the relief and joy i feel towards async being a first class citizen is immense. i haven’t tried it yet but the patterns laid out in the examples look so slick to work with

Which was echoed by another commenter:

The async primitives cleanup in 2.0 looks really well thought out. Solid has always had the best reactivity model of any JS framework imo — true fine-grained updates without a virtual DOM.

Developer Brenelz, who migrated both TanStack Start and SolidStart to 2.0, wrote that the "async model feels better, the reactivity changes feel thoughtful" and highlighted that the old Suspense behaviour "could feel a little jarring when it ripped the UI away from you."

A Github comment raised concerns about the createEffect changes:

The single-function createEffect works very well in practice. Automatic dependency tracking covers most use cases, and frameworks like Vue.js and Svelte also provide primitives based on automatic dependency tracking.

Switching to the new split-phase API feels cumbersome, also making patterns like tracking B or C depending on A harder to express and nested reactive logic less clear than with automatic tracking…

As well as the ‘value updates after flush’:

…I’m also concerned about values update after flush, which introduces inconsistent state reads, as writing to a signal does not immediately affect subsequent reads and forces developers to treat reactive values differently from normal variables, breaking the intuitive mental model of Solid 1.x.

To which Ryan, the author of SolidJS, replied:

I knew these would be difficult for people to accept. But I didn't make these choices out of preference.. I spent over a year looking at them and couldn't escape the reality. No more than I could escape some physical law. The truth is both are necessary if you want to have consistent async.

What both of these behaviors do ultimately does lead to a more concise and coherent design because we create the right boundaries and set the correct expectations. In the process the library absorbs a lot of the complexity. The beauty of this really is that if these patterns are used properlty you won't find even the need for using createEffect very much at all anymore.

Compared to React, SolidJS continues to differentiate through its fine-grained reactivity model that avoids the virtual DOM entirely.

For developers looking to try the beta, the team provides a migration guide covering the transition from 1.x, and SolidStart users can follow a separate guide for the meta-framework. The beta is available on npm under the next tag by running npm install solid-js@next @solidjs/web@next.

SolidJS is an open-source JavaScript framework created and maintained by Ryan Carniato. It builds on fine-grained reactivity to deliver high-performance UI rendering without a virtual DOM, making it a natural fit for developers seeking React-like ergonomics with significantly lower runtime overhead.

About the Author

Rate this Article

Adoption
Style

BT