github solidjs/solid @solidjs/web@2.0.5

Patch Changes

  • caba92a: A server render under a request event now adds the client entry's assets to the response as a Link header: the entry script and its static imports as rel=preload; as=script; crossorigin, and their stylesheets as rel=preload; as=style. Hosts and CDNs that build 103 Early Hints from Link headers, such as Cloudflare, can then start those downloads before the page arrives. Scripts use preload rather than modulepreload because Cloudflare and Chrome document only preload and preconnect for Early Hints. It covers the static build manifest only, so dev renders add nothing, and noScripts renders hint only stylesheets.

    createSSRResponse now appends the response stub's Link values to a Link header in responseInit instead of replacing it, as it already does for Server-Timing.

  • 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.

  • 5a729a9: Frames: two server component calls with different arguments no longer share a frame address, so one mount can no longer show another call's markup (#5284). The argument digest now quotes strings, tells numbers from strings, names URL / URLSearchParams and other class instances by their own string form, and hashes with FNV-1a.

  • 97d54b0: Frames: a server component whose async read rejects before the first flush, with no server <Loading> or <Errored> around it, now answers the frame's :error record instead of a bare :complete (#5283). serverComponentResponse now resolves its Response at the shell, as createSSRResponse does, so that failure also marks the response no-store. It returns Promise<Response> (experimental API); responses made through frameTransformResult are unaffected.

  • 7de4595: Frames: in production, sibling mounts of one server component (and <For> rows) get their own data-fid site again instead of all sharing the first one (#5281).

  • cbc14c8: A GET server function called with a file among its arguments (with enableRichArguments) now throws a clear error before sending, instead of putting [object FormData] in the url and failing with a 400. A GET call whose codec-encoded arguments are too long for a url and go over POST now sends the encoding it already made instead of encoding the arguments a second time, so a one-shot argument such as an async iterator arrives with all its chunks.

  • e77da6f: Adopting server-emitted head resources during hydration no longer walks the whole document once per resource. The lookup checks <head> first and only reaches <body> (stream-emitted boundary links) when the head has no match, so a page with many preload links hydrates faster. Which element is adopted is unchanged.

  • 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.

  • 6e6963b: Guard the global _$HY when runHydrationEvents clears the hydration event queue, so a client render after a hydration with no delegated events does not throw once _$HY is removed.

  • 8fa0476: Replace stale server-rendered Loading boundary content if its module preload fails and the client renders the boundary again.

  • cf3006c: Keep a <Loading> fallback on the page when its content fails after the shell is sent and no server <Errored> drew a fallback at that position (for example <Errored><b><Loading>…</Loading></b></Errored>). The server used to swap in a blank there until the client hydrated. Now the fallback stays until the client renders the <Errored> fallback over it.

  • 185a5c2: Keep a pending <Loading> boundary's server-rendered elements in the document when a sibling boundary in the same insert resumes first. They were removed at the sibling's resume and re-inserted at their own. A boundary whose server output is text only is not covered yet.

  • 623a4f6: Send live and broadcast requests with cache: "no-store". A live answer is never cacheable, and without it Firefox held a second tab's request to the same address for about 20 seconds while the first tab's connection was open.

  • cc3575f: Set rel="stylesheet" before removing as when a warmed stylesheet preload link goes live, so the link is never a rel="preload" without as.

  • 4752ff1: A JSX spread that drops checked, value or selected clears it once and then leaves it alone, so a later unrelated prop change in the same spread no longer clears a checkbox, radio, typed text or chosen option the user set since.

  • d92fc73: Remove class tokens such as constructor and toString when their class map conditions become false, including on spread elements and Dynamic tags.

  • 8fa0476: Share the hydration node collection logic used for live children and captured marker regions.

  • b72a531: Fix DOM rendering when an omitted optional ref prop is forwarded through a local const alias.

  • 6e69108: Keep module scripts registered with useHead in the server-rendered HTML when a modulepreload link for the same URL was registered first.

  • c787ec8: renderToStream now inserts the content of a root hole as written. It was passed to String.prototype.replace as a replacement string, so $`, $&, $' and $$ in rendered text were expanded instead of output (#5275).

  • 0df6d19: Fix server rendering of spread props on audio and video elements so defaultMuted controls the initial muted attribute.

  • Updated dependencies [a3df43a]

  • Updated dependencies [91260dc]

  • Updated dependencies [00fba00]

  • Updated dependencies [7898398]

  • Updated dependencies [a50909b]

  • Updated dependencies [185a5c2]

  • Updated dependencies [0b703b4]

  • Updated dependencies [14f48f4]

  • Updated dependencies [a50909b]

  • Updated dependencies [be566af]

  • Updated dependencies [1465dfd]

    • solid-js@2.0.5

Don't miss a new solid release

NewReleases is sending notifications on new releases.