Change8

v2.0.0-rc.0

Breaking Changes
📦 solid-jsView on GitHub →
6 breaking6 features🔧 15 symbols

Summary

Solid 2.0 RC introduces a fundamentally async-first reactive system where async operations are integrated directly into the graph. This release also brings a new Rust-based compiler via `@solidjs/vite-plugin` and replaces SolidStart with an integrated 'start mode'.

⚠️ Breaking Changes

  • The `createResource` API has been removed. Async data fetching should now be handled by ordinary memos.
  • The `batch` API has been removed. All writes are now batched automatically on a microtask. Use `flush()` if immediate application is needed.
  • The `startTransition` and `useTransition` APIs have been removed. The reactive graph now manages consistent state automatically. Use `isPending` and `latest` to read this state.
  • The `on` and `createComputed` APIs have been removed. Effects are now split into `createEffect(compute, apply)` to separate tracking from side effects.
  • The `produce` and `createMutable` APIs for stores have been removed. Store setters now provide a draft that you mutate directly.
  • SolidStart is retired and replaced by the 'start mode' in `@solidjs/vite-plugin`. Existing SolidStart projects will continue to be maintained, but new projects should use the 'start mode'.

Migration Steps

  1. Replace `createResource` with ordinary memos for async data fetching.
  2. Remove explicit calls to `batch`. Writes will be batched automatically.
  3. Remove `startTransition` and `useTransition`. Use `isPending` and `latest` to manage pending states.
  4. Split `createEffect` calls that previously used `on` or `createComputed` into `createEffect(compute, apply)`.
  5. Update store mutation logic to directly mutate the draft provided by store setters, replacing `produce` and `createMutable`.
  6. Migrate SolidStart projects to the 'start mode' of `@solidjs/vite-plugin` using the provided migration guide.
  7. Update `@solidjs/vite-plugin` to automatically leverage the new Rust-based compiler.

✨ New Features

  • Async operations (Promises, Async Iterators) are now first-class citizens within the reactive graph, eliminating the need for manual loading states and null checks.
  • Introduced a new compiler toolchain written in Rust on top of OXC, which is automatically used by `@solidjs/vite-plugin` by default, offering significant speedups.
  • The `@solidjs/vite-plugin` now includes a 'start mode' for a turnkey application serving layer, simplifying setup for SPAs, SSR, and file-system routing.
  • File-system routing is now available as a router-neutral package, leveraging SolidStart conventions.
  • Server functions are a core feature backed by `@solidjs/web/server-functions`, providing typed RPC, streaming returns, and progressive enhancement.
  • Deployment is simplified by emitting a web-standard Fetchable handler, compatible with various platforms like Workers, Netlify Functions, Nitro, and Bun.

Affected Symbols