You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit e0e4224
Browse filesBrowse the repository at this point in the historyBrowse files
fix(solid): hydration never asks again for an answer the server already sent (#4313)
* fix(solid,web): draw an Errored fallback for a Loading's async failure, and adopt it (#4287)
Outside a server component, a <Loading> whose async read failed during a
streamed render settled its fragment blank, and the hydrating client
rendered the failed boundary from scratch: it asked again and showed the
loading fallback.
Server: the failing <Loading> now asks the enclosing <Errored> for its
outcome outside server components too, passing its own id. The Errored
answers only when that Loading is all of its content (its resolved markup
is the Loading's placeholder): its fallback is drawn into the fragment, or
inlined pre-flush, and the error is serialized at the Errored id. Deeper
in the content it answers nothing, as before. A rejected fragment's
template is marked `e`, and `$dfr` records the nodes it swaps in for it.
Client: inside a hydrated Errored's no-claim content run, a <Loading>
runs its content with its data adopted instead of waiting on its
fragment, so the Errored holds the client's own error and tracks the
content's inputs (#4273). A boundary that claimed its fallback and then
renders a rejected fragment fresh clears the nodes the swap put in first,
so nothing of the server's outcome is left beside the client's render.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(solid): serialize an Errored's error only when its fallback markup is sent
When a streamed <Loading> fails after the shell and asks the enclosing
<Errored> for its outcome, the fallback may hold an async hole that has
not resolved yet. renderOutcome then returns no markup (the fragment
settles as a plain rejection), but handleError had already serialized
the error at the Errored id. A client hydrating after the failure read
that record, claimed a fallback that was never sent, and went blank
with a hydration key miss.
The outcome path now defers the record and writes it only once the
fallback resolved to finished markup. Without it the client renders the
failure itself, as on `next`. Server-only; no client bytes.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1
* fix(solid,web): stream a parked Errored fallback once its async hole resolves (#4306)
An <Errored> whose fallback reads async data, around a <Loading> that
fails after the shell inside an outer <Loading> still pending, lost its
region: the outcome render met the fallback's pending hole, answered no
markup, and the parked fragment spliced a blank into the outer one while
its `_fr` resolved. The client claimed against the blank and showed
nothing there, with hydration warnings.
renderOutcome now answers a still-resolving fallback with a function
that waits out its holes and returns the finished markup, serializing
the error only then. The <Loading> calls it only while its fragment is
parked in an enclosing pending one (the registry's new `parked()` query
on the settle function), where nothing of the failure shows yet: the
outer fragment carries the fallback, or, if the outer settles first,
the inner fragment streams it when it lands. A failure in a region
already shown settles at once, as before. Server-only; no client bytes.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(solid,web): a failed Errored always waits for its fallback's async holes (#4306)
Per RULES-DERIVED D-18 (a swap to a fallback waits for the fallback to be
ready), the wait for an Errored fallback's async holes no longer depends
on the fragment being parked. A <Loading> that fails after the shell under
an <Errored> whose fallback is still resolving keeps its placeholder until
the finished fallback is ready, then streams it with the error record, in
the parked case (carried by the outer fragment while that is pending) and
the unparked one alike. The registry's `parked()` query is dropped.
#4303's async-fallback scenario now expects the server's finished fallback
and its record: a client hydrating after the failure arrived claims it and
asks nothing again. Server-only; no client bytes.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(solid,web): a hydrated failure re-serves the server's error instead of asking again (#4287, #4306)
A client hydrating mid-stream asked again for an async memo whose server
read failed, and flashed back to the inner <Loading> fallback after the
failure showed: Errored > Loading > read, with the read failing after the
shell, unparked (the fragment rejects and the client renders the failure
fresh over the swapped-in Errored fallback) or parked in a pending outer
Loading (the outer resume runs the hydrated Errored's content, NO_CLAIM).
Both content runs read the shell memo a cycle after its error landed, and
a later tracked read retries an errored async node (PJ-R35). The retry
re-enters the hydration latch, which since f3da41e has taken every
re-entry for a dependency change ("re-entry is always invalidation-
driven"), and since b68a907 computes such a rerun at once for a shell
node outside the claim in progress: one real ask, the Loading fallback
for its duration. Before f3da41e the latch re-served the serialized
answer on every re-entry while hydrating, so the retry asked nothing.
Inside a hydrated failure's content run (NO_CLAIM) a latched rerun now
re-serves the server's answer, its error included, and arms nothing. A
rejected fragment's fresh render runs as such a content run when the swap
brought the outcome the server drew for the failure (the reveal record
lists its nodes); to make that list the outcome alone, a rejected
fragment with no outcome streams an empty template instead of a lone
space. Uncontained failures (no outcome) keep rendering fresh as before.
Tests: the #4287/#4306 hydration specs stream piece by piece with a clock
tick between pieces (the plain-fallback case only passed because no flush
ran between the error landing and the fresh read), assert 0 asks in both
modes and no flash back to a loading fallback, and cover the parked
plain-fallback scenario, which now has an ask counter and an update pass
(the Errored tracks the memo, #4273).
Size: 0 B on every CSR scenario (compiled floor 9,966 B); +65-71 B
minified on the hydrating scenarios.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(solid): a served source's arrival re-serves its dependents' answers instead of asking again
Hydrated mid-stream, an async shell memo `b` reading another, `a`, both
read only inside a streamed <Loading>, asked again when `a`'s server
answer arrived: the landing re-ran `b`, and the hydration latch took the
rerun for a client write (f3da41e's "re-entry is always invalidation-
driven"; b68a907 computes it at once for a shell node). The server's
`b` was computed from that same `a`; nothing on the client diverged.
The latch now has one rule: a latched rerun inside hydration's own pass
over served answers (NO_CLAIM) re-serves its own answer and arms nothing.
That pass is a hydrated failure's content run (the Errored's, or a
rejected fragment's fresh render over the outcome the server drew, from
the previous commit) and, new here, a served answer's arrival:
readHydratedValue hands the runtime a thenable whose landing runs, with
the flush that carries it, under NO_CLAIM. The NO_CLAIM check moves to
the head of the latch rule, so in-claim and held reruns there re-serve
without arming a takeover too. Client writes still compute (the
write-before-resume, nav-before-resume and hydration-latch pins), and a
retry outside that pass still follows the client rule.
Tests: a parity scenario and spec for the b-reads-a shape (0 asks loaded
and streamed piece by piece with clock ticks, one real ask after a client
write to their input); both fail before this commit.
Size: 0 B on every CSR scenario (compiled floor 9,966 B); +19-27 B
minified on the hydrating scenarios over the previous commit.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* fix(solid): a served pass never swallows a client write
A served answer's arrival is hydration's own pass (NO_CLAIM): a latched
node re-running there re-serves its server answer. A client write
carried by that same flush must still make the node compute.
- Client writes already made (pending, unflushed) flush first, outside
the pass (`servedPass`). The async runtime's landing flushes
synchronously, and that flush would otherwise carry them.
- The pass covers only the flush round its served write lands in
(`_servedAt = clock`). An effect's write runs in a later round of the
same flush, and a latched node re-run there computes. The latch tests
`clock > _servedAt`.
`@solidjs/signals` exports its flush-round counter (`clock`), an
internal live binding, at 0 B.
Landings cannot be coalesced into one pass per microtask batch without
changing signals. `asyncWrite` already flushes synchronously on every
landing (`schedule(); flush()`) at the #4308 head, so a served pass
adds no flush per landing. Its trailing `flush()` is a no-op after a
value landing.
Tests: in served-source-landing, a write before the flush and an
effect's write in the landing's flush both give the written value with
1 ask. Both fail on 2b2990a.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* perf(solid): golf the served-pass client code
This changes no behaviour. Client bytes over next go from about +130 B
to +58 B minified.
- A hydrated `<Errored>`'s content run and a served pass are one window
kind: `_claimOwner = ~clock`, a window over no owner for the flush round
it opened in. `~` keeps it truthy when clock is 0.
- That replaces both `NO_CLAIM` and `_servedAt`. The latch checks one
thing, `_claimOwner !== ~clock`, and a later round of an arrival's flush
(an effect's write) still computes. `isClaiming` reads a number as no
owner, so nothing claims, as before.
- `servedPass` is curried (`servedPass(f)(x)`), so the arrival thenable
is `initP.then(servedPass(a), servedPass(b))`.
- A resume clears the hydration flag once, before either branch. The
fresh branch's own flush was redundant with the resume's trailing one.
The outcome check reads `?.[0]` instead of `?.length`.
The pre-flush stays on both paths. Removing it makes the
write-before-landing test fail, and comparing only `_claimOwner` without
the round makes the effect-write test fail.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
* perf(solid): read the page's _$HY directly on the recover path
A recover only runs while hydrating, so the guarded globalThis read is dead
weight: -12 B minified on every hydrating and page scenario.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018LY7F9czoRqdMEvk2QwPr1
---------
Co-authored-by: Claude <[email protected]>
A client hydrating mid-stream no longer asks again for an async read whose server answer was an error, nor flashes back to the `<Loading>` fallback after the failure showed (#4287, #4306). The content of a hydrated failure (a hydrated `<Errored>`'s content run, or a rejected fragment's fresh render over the `<Errored>` fallback the server drew) reads a shell memo a cycle after its error landed, and a later tracked read retries an errored async node; the serialized-value latch took that rerun for a client write and computed. Inside such a content run the rerun now re-serves the server's answer and arms nothing. A rejected fragment with no outcome streams an empty template (it was a lone space), so the nodes its swap lists are the server's outcome alone.
A memo that adopted its server answer no longer asks again when the server's answer for one of its sources arrives mid-stream. Hydrated mid-stream, an async shell memo `b` reading another, `a`, re-ran when `a`'s server value landed, and the serialized-value latch took that rerun for a client write and computed `b`. The arrival of a served answer, with the flush that carries it, is now hydration's own pass (as a hydrated failure's content run is): a latched node re-running there re-serves its own answer and arms nothing. Only a client write makes it compute.
A served answer's arrival during hydration no longer swallows a client write made in the same flush. Writes made before the arrival flush first, outside hydration's own pass, and a write made during it (an effect's, a later round of the flush) makes a node it reaches compute, so the node shows the written value instead of re-serving the server's answer. `@solidjs/signals` exports its internal flush-round counter (`clock`) for this.
0 commit comments