Change8

solid-js@2.0.0-rc.4

Breaking Changes
📦 solid-jsView on GitHub →
2 breaking2 features🐛 4 fixes🔧 11 symbols

Summary

This release introduces a new point-of-pain discovery system for diagnostics and a patch-mode list driver for optimized list operations. It also includes several bug fixes related to hydration, SSR, and list driver behavior.

⚠️ Breaking Changes

  • Patch-mode lists now implement the identity semantics the view declares instead of the reconcile key's. This may affect how lists are rebuilt when records are replaced, aligning with classic `mapArray` behavior. Deep lists are unaffected. Shallow reference-keyed lists will now rebuild rows whose records were replaced, matching `mapArray` exactly, whereas the driver previously patched them in place. Ensure your list implementations correctly handle record replacement if relying on in-place patching.
  • Patch-mode list admission moves entirely to compile time. The `driveList` function now only engages for row functions carrying the compiler's `rowProof` stamp. The runtime purity probe has been deleted. Rows without the `rowProof` stamp will take the classic `mapArray` path before any DOM work. If you are manually using `driveList` or relying on the runtime purity probe, you will need to update your code to use the compiler's `rowProof` stamp or ensure your rows are stamped.

Migration Steps

  1. Ensure row functions intended for the patch-mode list driver are stamped with the compiler's `rowProof` (exported from @solidjs/web). Rows without this stamp will use the classic `mapArray` path.
  2. If using family (projection/optimistic) arrays with the patch-mode list driver, be aware that they now decline the driver. Ensure your logic handles this correctly, as structural changes will not emit row/slot ops.

✨ New Features

  • Introduced point-of-pain discovery for diagnostics with `DEV.diagnostics.setConsoleFooter(fn)`, which registers a footer printed once per diagnostic code after its first console report. This helps users find prescribed fixes for diagnostic warnings.
  • Added a patch-mode list driver for keyed `<For>` over a store array. This driver optimizes list operations (create/bind, LIS moves, node removal) without using `mapArray`, reducing overhead for certain list manipulations. It supports `$ll` metadata for compatibility with unaware renderers and declined lists.

🐛 Bug Fixes

  • Fixed external-audit issues on the patch-list driver surface: family (projection/optimistic) arrays now correctly decline the driver, preventing potential freezes on optimistic or projection structure changes. Shallow slot-patch registration is now multi-consumer, preventing overwrites when two driven lists use the same shallow array.
  • Fixed mid-stream dependency changes being silently lost by hydration-latched computations. Computations that re-run during hydration now correctly re-serve their serialized server value and defer dependency changes until hydration completes.
  • Fixed streaming SSR hanging permanently when a component body reads a property of a pending `createProjection`/`createStore(asyncFn)` store. Server projections now use by-slot flight memory to return the same in-flight proxy for re-created projections, preventing infinite loops.
  • Fixed chained-backing patch registration: patches registered on wrapped projection rows now correctly resolve through the chain to the ultimate owner target, ensuring value transitions are not folded on the source.

Affected Symbols