跪拜 Guibai
← All articles
Frontend

SolidJS 2.0 Makes Async a Part of Its Reactive Core

By parade岁月 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Because async now lives inside the reactive graph, Solid 1.x teams can't just bump a version number; they must rework Stores, Effects, and imports. For everyone else, it's the clearest statement yet that a framework can treat server data and optimistic updates as first-class reactive state.

Summary

SolidJS 2.0 makes asynchronous data a native part of its fine-grained reactive system. A regular createMemo can now return a Promise, and the framework coordinates downstream computations, pending states, and race conditions. New primitives like <Loading> and isPending handle placeholder and stale-value display, while action and createOptimistic cover writes with optimistic UI updates. Server Functions move from SolidStart into core, using Web-standard Request/Response and supporting Server-Sent Events for continuous streams.

The release removes a batch of 1.x-era APIs: createResource, batch, startTransition, on, produce, createComputed, and createMutable. Store updates switch to draft style, and createEffect is split into a dependency-tracking phase and an effect phase. Imports for web rendering move to @solidjs/web, and Store APIs now come from solid-js. SolidStart itself is retired as a standalone meta-framework, replaced by a Start Mode in @solidjs/vite-plugin, and the compiler toolchain moves to Rust/Oxc.

Beyond the API changes, Solid 2.0 ships diagnostics with stable error codes and source locations, plus AGENTS.md and skills files, aimed at AI coding agents. The stable release followed 14 weeks and 23 release candidates, with 971 pull requests and 753 issues closed. But it's a breaking major version: migration requires checking dependency compatibility, Effect behavior, Store changes, SSR, and build output, not just bumping the version number.

Takeaways
— createMemo can now return a Promise; the framework coordinates downstream computations, pending states, and race conditions.
— <Loading> and isPending handle placeholder and stale-value display for async values.
— Optimistic updates are built in via action, createOptimistic, and createOptimisticStore, with the server as final authority.
— Server Functions moved from SolidStart into core, using Web-standard Request/Response and supporting Server-Sent Events.
— Removed 1.x APIs: createResource, batch, startTransition/useTransition, on, produce, createComputed, createMutable.
— Store updates switch to draft style, e.g. setState((draft) => { draft.user.address.city = "Shanghai"; }).
— createEffect is split into a dependency-tracking phase and a side-effect phase.
— Web rendering imports move to @solidjs/web; Store APIs import from solid-js.
— SolidStart retires as a standalone meta-framework; Start Mode in @solidjs/vite-plugin replaces it.
— The new Rust/Oxc compiler toolchain is enabled by default in the Vite plugin.
— Diagnostics with stable error codes, source locations, and fixes ship for AI agents, along with AGENTS.md and skills.
— The stable release followed 14 weeks, 23 RC versions, 971 PRs, and 753 issues closed.
Conclusions

Letting createMemo return a promise collapses async into the same abstraction as synchronous dependencies, but it pushes caching, failure handling, and business consistency back onto the application layer, as the release notes themselves warn.

SolidStart's retirement while Server Functions move to core signals that the framework's boundary is moving toward a more complete runtime, but teams with existing SolidStart deployments face a migration path that is not yet turnkey.

Shipping AI-facing diagnostics with stable error codes and AGENTS.md files treats AI agents as first-class consumers of the framework, a design choice that will likely ripple through other reactive frameworks.

The Oxc compiler speedup is a build-time gain; treating it as a runtime performance upgrade would misread the release.

Concepts & terms
Async Signals
SolidJS 2.0's term for integrating asynchronous operations into the reactive graph. A signal or memo can represent an async value, and the framework coordinates pending, stale, and race states as part of dependency tracking.
Reactive Graph
The network of signals and memos that a fine-grained reactive framework tracks. In Solid 2.0, promises and server data become nodes in this graph, so downstream computations respond to resolution and rejection.
Optimistic Update
A UI pattern that immediately shows the result of an action before the server confirms it, then reconciles with the server's actual response. Solid 2.0 provides createOptimistic and createOptimisticStore for this.
Server Functions
Functions that run on the server and are callable from client code. In Solid 2.0 they are part of the core and use Web-standard Request/Response, with support for Server-Sent Events for streaming.
From the discussion
Featured comments
组合搭配函数

Bringing async into the reactive graph is a bold move, and letting the framework handle race condition coordination is a real relief. Cutting a pile of 1.x APIs is a pretty harsh move though; migrating old projects is going to be a chore.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗