Skip to content

solid-js@2.0.5

Choose a tag to compare

@github-actions github-actions released this 06 Dec 10:15
c6b6898

Patch Changes

  • a3df43a: Development: whether a cleanup may write is now decided by the scope it belongs to, not by where teardown runs it. A setter, store setter, refresh or action call from an onCleanup is an owned write again (REACTIVE_WRITE_IN_OWNED_SCOPE, ACTION_CALLED_IN_OWNED_SCOPE), under a removed <For> row and under a <Show> branch alike. A cleanup returned from an effect callback or from onSettled may still write and call actions. Move the write into a returned cleanup, or mark the signal ownedWrite. Production output is unchanged by this.

  • 91260dc: During renderToStream, an <Errored> whose <Loading> fails before the shell is sent now draws its error fallback in the shell even when the <Loading> is not all of its content: markup between them (<Errored><section><Loading>), a sibling beside the <Loading>, or another <Loading> inside the <Errored>. The fallback replaces the <Errored>'s whole content, as a client render shows it, and the error is serialized at the <Errored>, so the hydrating client adopts that markup without asking again and recovers when the content's inputs change (#4287). The server error hook hears fallback. Before, the shell kept the content with the failed <Loading>'s position empty (<b></b> for <Errored><b><Loading>), and the fallback appeared only once the client hydrated, or never without JavaScript. The same applies to the awaited form (await renderToStream(...)).

    The fallback is drawn only when it is ready as it renders; the shell never waits for it. A fallback with an async or client-only hole, or one that throws with no <Errored> above it, leaves the shell as before: the client renders the failure, and the hook hears client. So does an <Errored> whose markup has no place of its own in the shell: one that put no element and no <Loading> placeholder into the page (text alone, or nothing), or that was itself never inserted. A fallback that throws inside an outer <Errored> is that boundary's failure, drawn in the shell the same way. When the hook maps the error to another value, a fallback that reads the error is rendered again with that value; if that second render throws or is not ready, nothing is drawn, although the hook has already heard fallback. Whatever the replaced content still had pending goes with it. A <Loading> still pending inside it streams nothing, and its head tags (useHead) never reach the document head, whether they come from a settled <Loading> or from the content itself. A later failure inside the replaced content is still reported to the hook as client. After the shell has been sent, a nested <Loading> failure still streams an empty fragment and the client renders the failure, as before.

  • 00fba00: Fix server rendering so Object.hasOwn distinguishes omitted props from explicit undefined in a lone function spread.

  • 7898398: Run the cleanup returned by createRenderEffect when its server-side owner is disposed, including when the effect first runs after an async dependency resolves.

  • a50909b: <For> returns its mapArray directly again. It had been creating the map lazily on first read, under the component's owner, for a list driver that has since been removed (#3079). That left a closure and a hydration-only special case (#3161) behind for no benefit. Every <For> page is about 60 B smaller minified.

  • 185a5c2: Keep hydration open while a root waits on its module preload. Another root finishing first ended hydration for the page: onHydrationEnd fired and early input on the waiting root was lost before it claimed anything. A root that starts in the same tick after another root finished now also cancels that root's queued cleanup, which marked the page done and cleared the new root's registry. The same holds for a root started from an onHydrationEnd callback.

  • 0b703b4: Export the NoFn type from solid-js (client and server entries), alongside the other store types already re-exported from @solidjs/signals.

  • 14f48f4: Keep platform objects such as dates and maps raw in deep projection drafts so their native methods work on the client and server.

  • a50909b: New dev diagnostic RUN_WITH_ANCESTOR_OWNER (#5280). A running computation that uses runWithOwner to create a node on one of its own ancestors gets a warning. A typical case is a memo created lazily on first read under the component's captured owner. That node outlives the code that made it, and it takes the ancestor's next child slot at the moment of the read, which shifts hydration ids so later siblings miss their claims. The fix is to make the owner up front (const scope = createRoot(() => getOwner())) and create lazily under it, as mapArray does. Re-entries from event handlers, timers and async continuations, re-entries that only read context, and nodes created with an id option or transparent are not reported. Dev only, with no production bytes.

  • be566af: Pass the numeric row index to every <For keyed={false}> callback during server rendering, including callbacks that use a default or rest parameter.

  • 1465dfd: On the server, createSignal(fn, { lazy: true }) now runs fn on the first read.

  • Updated dependencies [56bca54]

  • Updated dependencies [f7b6b9c]

  • Updated dependencies [a3df43a]

  • Updated dependencies [e0f2ad4]

  • Updated dependencies [162d46a]

  • Updated dependencies [cc4b6cf]

  • Updated dependencies [a88836f]

  • Updated dependencies [a440e01]

  • Updated dependencies [9f7d51d]

  • Updated dependencies [ae5ce50]

  • Updated dependencies [44f26d6]

  • Updated dependencies [14f48f4]

  • Updated dependencies [510bb8d]

  • Updated dependencies [50a4bfd]

  • Updated dependencies [0e29f37]

  • Updated dependencies [a50909b]

  • Updated dependencies [6181f4b]

  • Updated dependencies [46e665b]

    • @solidjs/signals@2.0.5