v1.0.0 - Solid grows up
Well, the time has come. We're happy to announce Solid 1.0. This is the culmination of 5+ years of work, but in another sense this is just the start. We have marked the APIs as stable(except for a couple that have (experimental)
next to them, like SuspenseList). What started as a quest to show that reactivity still had it has become a fully-featured JavaScript UI Framework.
While the 1.0 release doesn't bring behavior differences it does bring some breaking syntax changes. We've worked to make the simple Signals and our proxy objects have a more consistent API. And we've move the proxies out into their own sub module, renaming them from "State" to "Store". We feel this will reduce confusion and better reflect their purpose.
There is only a single 1.0.0 release, the first major version, and I am so happy and thankful to be here. Everyone who has been instrumental in us getting here has my eternal gratitude. From those who were always ready with encouraging words, to the great group of contributors and core maintainers we've built up today.
So thank you, and enjoy.
Breaking Changes
setSignal now supports function form
While that in itself is a great new feature as you can do:
const [count, setCount] = createSignal(0);
setCount(c => c + 1);
This promotes immutable patterns, lets you access the previous value without it being tracked, and makes Signals consistent with State.
It means that when functions are stored in signals you need to use this form to remove ambiguity
const [count, setCount] = createSignal(ComponentA);
// Do this:
setCount(() => ComponentB);
// Don't do this as it will call the function immediately:
setCount(ComponentB);
https://github.com/solidjs/solid/blob/main/documentation/api.md#createsignal
createState
moved and renamed
createState
has been renamed to createStore
and moved to solid-js/store
. Also moved to solid-js/store
: createMutable
, produce
, reconcile
https://github.com/solidjs/solid/blob/main/documentation/api.md#createstore
SSR Entry points
renderToString
and renderToStringAsync
now only return their stringified markup. To insert scripts you need to call generateHydrationScript
or use the new <HydrationScript>
component.
renderToNodeStream
and renderToWebStream
have been replaced with pipeToNodeWritable
and pipeToWritable
, respectively.
Options Objects
Most non-essential arguments on reactive primitives are now living on an options object. This was done to homogenize the API and make it easier to make future additions while remaining backwards compatible.
on
No longer uses rest parameters for multiple dependencies. Instead, pass an array. This facilitates new option to defer execution until dependencies change.
https://github.com/solidjs/solid/blob/main/documentation/api.md#on
Actions renamed to Directives
To remove future confusion with other uses of actions the JSX.Actions
interface is now the JSX.Directives
interface.
https://github.com/solidjs/solid/blob/main/documentation/api.md#use___