Skip to content

Commit 3c1d512

Browse files
ryansolidClaude via Cursorclaudecursoragent
authored
frames: A0 correctness pass, part 2 — park, hydrateWindow, declared records, error propagation, fragment ownership, server half, generic hydration pins (#3849)
* fix(solid): a claim reads the trace's snapshot; the backlog lands after hydration ends (frames-rulings 3.6 (iii), the 3e port) S1's third commit (9927ddd) ported onto next, minus its `claiming` hint: - `materializeContainerTrace` parks a replayed backlog beyond the snapshot (`limit = 1`) until hydration ends — `onHydrationEnd`, the next microtask when none is in progress — then releases it with a version bump so the compute drains the backlog as one ordinary update. A trace is materialized at a fill's arg-read; when that fill CLAIMS adopted markup the snapshot is what the markup was rendered from, the claim trusts the markup (a text hole is never rewritten during a claim), and a store already past it left the DOM diverged for good. Release order (3.2): claim → the frame's hold release → done → backlog. A failure applies in order, after the parked patches. The park is unconditional (every replayed backlog), not keyed on hydration being in progress at materialization: the projection's first compute runs at creation, materialization precedes the frame's claim window, and a claim made AFTER hydration-done — an occurrence inside a server <Loading> whose fragment reveals after done (corollary 4: the server's inner loading state registers nothing) — has no hydration state that says "claim". Keyed on `isHydrationInProgress()` the harness kept 7 / 7 such cases red on the two seeds. A fresh mount pays one beat for not being told apart: its backlog lands a microtask after the snapshot, before any paint. - The projection's root is DETACHED (`runWithOwner(null, createRoot)`): rooted under the reading owner, a trace revived at t=0 consumed one child id while one revived by a late claim consumed none, and a keyed sibling after the frame hydrated under different keys in the two runs. Pins: harness C19 ×2 flip to `test`; `c19-claim-reads-snapshot.spec.tsx` (the t=0 claim past the markup, the deferred claim under the hold, the release order, the post-done claim at a reveal, the C11 consequence, id determinism — S1's container-trace-hold-{snapshot, hydration-end, id-determinism} re-cut for next); solid `container-trace.spec.ts` (id neutrality, the park's three timings, the in-order failure). Harness oracle: the settled trace law exempts a settle point inside a claim's park (contract C11, "every observable point" read as "outside a claim's park"); the end stays strict. Campaign, 500 cases: seed 3289 83 → 0, seed 91501 79 → 0, every law un-ignored. Contract: C11 amended, C19 re-read under (iii), R10 corrected (S1's path is the park, evidence for (iii) not (i)), the fix order's item 3 decided. Co-authored-by: Claude via Cursor <[email protected]> * feat(solid,web/frames): an adopted occurrence claims through the hydration window (hydrateWindow); R.claim deleted The savings plan's A2, S-hold's window form (frames-rulings 3.1 / 3.2): the frame's hold is `initBoundaryResume`'s registration (#3831's `holdBoundary`, kept), and the resumed fill re-enters hydration through the same window a streamed <Loading> resume opens — instead of a registry and a hydrating flag of the frames client's own. solid: `hydrateWindow(id, fn, scope?, o = getOwner())` factored out of `resumeBoundaryHydration` and exposed as `sharedConfig.hydrateWindow` (@internal): the keys under `id` gathered into the registry (the captured `scope` pair when another hydrate() root replaced the live one, #2917), hydrating on, `o` the claim owner (#3504 — a render the window forces elsewhere is a client render), and `o` the snapshot + live scope when none is open: a late claim no longer re-marks the root's scope through `markTopLevelSnapshotScope` and leaves it unreleased (two C11 cases on seed 91501 with a first cut that skipped this), and inside an open scope (the root pass, an enclosing window) the claim joins it and releases with it. A window opened after hydration-done turns snapshot capture on for its span and clears it, as the old setter dance did. `sharedConfig.claimRoots` typed; the claimant sets it. The resume path's behaviour is unchanged (hydration mode off after a resume, whatever the flag read before). web/frames: `claimRender` is one `createOwner({ id: prefix })` and the window call. Deleted: `gatherClaims` (the range walk), `hasPendingFragment` (the window always engages), the root-registry hand-over, and the flip of `sharedConfig.hydrating` through its setter — which reset hydration-done and re-ran `checkHydrationComplete` from outside the runtime. `adoptBoundary` captures the registry/gather pair it adopts under so a claim long after (under the hold, at a fragment's reveal) gathers against the frame's root — pinned by c01-claim-window-roots (fails without the capture). web: `gatherHydratable`'s prefix gather selects natively (`[_hk^="…"]`); it runs once per adopted occurrence now, not only per late resume. Size (local, vs the integration branch): frames eager 43,414 → 42,932 min / 13,787 → 13,678 br (−482 / −109); app hydrating (no stores) 52,626 → 52,744 min (+118) / 17,728 → 17,833 br; compiled hydrating 99,257 → 99,381 (+124) / 31,023 → 31,099; page base 145,757 → 145,501 (−256) / 44,882 → 44,885; page live 157,720 → 157,464 (−256) / 48,595 → 48,631. The hydrating scenarios are over their caps (brotli); no cap raised. Pins: solid hydrate-window.spec (the seam's contract), web c01-claim-window-roots (multi-root). Suites: solid 830; web client 1142 / 1 xfail, server 1474 / 3 xfail, hydrate 367 / 4 xfail; harness 500 cases × 2 seeds, 0 findings. Co-authored-by: Claude via Cursor <[email protected]> * docs(server-components): consistency contract — C1's mechanism is the claim window (A2b); the multi-root pin listed Co-authored-by: Claude via Cursor <[email protected]> * docs(server-components): record the 2026-10-06 rulings on A2b — the park is unconditional; hydrateWindow's hydrating cost accepted - frames-rulings 3.6: "Landed" — the park is unconditional (post-done claims under corollary 4 have no hydration state that says "claim"); S1's `claiming` hint at plan step C3 keys it on the claim again. - frames-rulings 3.2: cost as landed — #3837 + #3840, frames −109 br / hydrating +105 br; the hydrating cost accepted, caps raised under a Size-Exception at the next integration PR. - consistency contract R10 / C19: the park's key described as it landed. - savings-pass plan §3 row A2: landed in two parts, measured vs estimate, further solid-side seams measured on an edited dist copy before they are written. * fix(web/frames): A1b + A4 S-ref — refs settle at the write through the response's table; the dedupe, the latches, stageTables/STAGED_DATA/onStream and the threaded resolver deleted S-ref (frames-rulings 1.3, L1). `createFrameHost.apply` settles a `slot` chunk's `{$ref}` args at the write, through the integration's table for the chunk's RESPONSE (`FrameHostOptions.resolve(ref, frameId, version, current)`), so the record the store holds — and every mount reads — carries values, never refs, and a later response's data can answer none of them. A key the response has not delivered yet resolves to a pending read owned by the store (keyed by version and key; stamped `s`/`v` as a serialized promise once it settles): its `data` chunk settles it and re-applies the records it was the last open read of, the stream's `complete` or `error` rejects it (L1 — a value that never comes surfaces where it is read, instead of leaving the record silently unapplied), a bump drops the superseded response's waits unanswered. A FRESH mount waits for its record to settle (`record.pending`), so the frame's shell shows at its landing with the range as the server left it and the mount's covering boundary pends on the landing alone (A0, corollary 4 — a fill whose first read pended into that boundary would hold the frame's own address follow behind the fallback); a MOUNTED occurrence takes the read as it is and its prop holds what it shows (A17, the DR-2 value tier). The frame no longer resolves refs: `#refsUnresolved`, `#resolveRef`, `#slotResolvedRefs`, `#refArgsUnchanged`, `#reconcileRegions` and the `resolve` parameter threaded through `preview` delete; the host notes a record's `{$frame}` args (`record.regions`) and decoded args (`record.decoded`) so the frame never probes a value (a decoded value may be a live container). Codec data tables are per RESPONSE (frames-rulings 1.2): `client.ts` keys them by frame id and version — the shown response's and a staged refetch's coexist — and drops versions below the store's `current` at the next use. `stageTables`, `STAGED_DATA`, `beginStream`, the prefix walk and `ServerComponentHandlerOptions.onStream` delete; a staged response's data chunks write through to the host as they arrive (into their own table). R.dedupe. A re-sent record always updates the live occurrence's props; the fill's props read through one memo per prop whose `equals` (`sameArg`: identity, then structural for decoded plain data; containers, async values and nodes by identity) is the dedupe — a record whose refs decode to equal values churns no reader. A live container is held boxed in its memo (the core probes a memo's result for `.then`; a pending container's trap throws). `FrameHostOptions.isContainer` / `FrameHost.isContainer` have no caller and delete. R.version / R.error. The applied root and the notified error are keyed by record identity (`#appliedRoot`, `#appliedError`; frames-rulings 2.1/2.2); `Frame.rebase()` (no caller since #3830) deletes. NOT deleted — the gap, reported: `stage`'s buffer + `CONTENT_TOKEN` + `stagedContent.preview/commit` + `FrameImpl#preview`/`host.preview` (reduced). The token is how a refetch of the address a mount SHOWS enters the reactive graph at all (`dynamic` delivers a kept resolution only when its address differs), and the compute-half preview is what stages the refetch's slot args with the transaction that read it: without it a fill deriving optimistic intent over an arg re-derives from the OLD arg in the pass that dissolves the intent (`frames-optimistic-hold` ×3, principles §9.2.2) — one flush before the effect-half commit pushes the new one. C15 itself stays green either way (the DOM never shows the tear; a memo does). Pins: C5 (b, c) re-pinned to observe the rotation through the fill (the host's resolver is no longer a surface); `frames-flight-delivery`'s `onStream` probe → a probe registration seeded from the resident store. * fix(web/frames): A4 S-record — the document declares a slot record at its marker; the #2968 poll deletes The document face (`createDocumentSlotProps`) writes `sc:slot:<fid>:<occ>` as a DECLARED pending value under its key — serialized at the marker, ahead of the fill and of any fragment that carries the range — and settles it with the args once they are classified: the shape a fragment's `<key>_fr` takes, so the adopting client awaits a record that trails its range's reveal through the value's own `.then` instead of polling the registry for a plain write. `adoptBoundary.drainRecords` reads a settled declaration's stamp synchronously (an adopt-time claim must not take a pending beat — readHydratedValue's rule), awaits a pending one, observes a rejected one. A sync render (`renderToString`) has no later script and no serializer for a promise: it writes the settled value, as before. A fill that throws settles its declaration empty so the response is not held open. Output shape: ≈ +32–38 B per document slot record (measured over the eight artifacts carrying one; the resolver/settle helpers are the page's `_fr` declarations' already). The 148 artifacts re-recorded: 8 changed. Client: `#recordRefresh` and the `setTimeout` re-drain poll delete, with `FrameOptions.recordsPending` / `FrameOptions.drainRecords` (no caller); a recordless called occurrence waits — the declaration's settle is the write that re-syncs it. The hold (3.2) is unchanged. No new wire TYPE: the declaration is the hydration-value mechanism the page already uses for fragments, applied to slot records (document face only). Pins: C2 (a2) flips to `test` (the record settled after the reveal, parser done, no fragment pending). The late-record pins re-shaped to the declared protocol (declared at boot/with the fragment, settled where the plain write was): c01 (window roots), c03 (a), c04 (b), c09 (c), c10 (b), c14 (a), c19 (b, c, e), hydration/adopted-slot-late-record; the harness declares a render occurrence's record with the markup that carries its range and settles it at the `record` event. Campaign: 500 cases × seeds 3289, 91501 — 0 findings. * docs(server-components): frames rulings — 1.2/1.3's carriers and the A1b removals landed (A1b + A4); the preview kept as the Transaction's carrier; public surface updated * fix(web/frames): A7 — a frame's error is an errored async value: the landing rejects on :error, the content node throws to the client <Errored>, reset re-asks (a new flight for the same address) A0, corollary 4 outward (frames-rulings 3.3): a frame is one async value, and its `:error` is that value rejecting — exactly as any `createAsync` that rejects. `FrameHost.landing` rejects with the error record at the response's error write; the mount's content node throws it to the nearest client `<Errored>`, so the covering `<Loading>` never releases over an empty `<solid-frame>`. An error AFTER the landing (the same response erroring after its root, a cut-off stream, a refetch's response erroring) is the L2 "errored flight after a landing" case and errors the node as an async iterable that yielded and then threw does — the shown value is not kept beside the error. With no client `<Errored>` the core halts (REACTIVITY_HALTED), as for any uncaught async error. `reset` re-asks: the `<Errored>`'s reset recomputes the node that threw; it re-reads `host.landing(address)`, and an errored landing is not a landing for a fresh consumer — the re-read is a promise for the next flight, which the mount opens itself (`dynamic`'s factory is hoisted and never re-runs for a reset): the handler records the call behind every address it handles or the document answered (`callFor`, @internal) and the client re-invokes it through the same declaration shape (a GET read stays GET). A response for an address whose mounts show an error writes through instead of being staged. Pins: frames-errored-reset-refetch.spec (new, A6's .fails pin made test + 8 arms); the lifecycle error arms, the switch-errored arm, C17 (b) and frames-live's error arms re-pinned to the new reading; four switch pins now send `complete` before closing (a close before complete is a death, which now errors the frame). Co-authored-by: Claude <[email protected]> * fix(web/frames): A7 — the re-ask mints its callable through the late-bound RPC seam, not by importing the transport The first cut imported `createServerReference`/`GET`/`invoke`/`withMeta` from the server-function client entry, which retained the whole transport in the frames eager graph (+11 KB min on the frames scenario). The registry's RPC slot (`provideServerFunctionRPC`, read by routers for the same reason) now carries `createServerReference(id)` on the client half, and the frames client reads the slot and the declaration-metadata brand through their registered symbols — the pattern the frame runtime already uses for every cross-bundle brand — so neither bundle retains a second registry copy. The error tick shared by both mount faces is one helper (`failing`). Co-authored-by: Claude <[email protected]> Co-authored-by: Cursor <[email protected]> * fix(web/frames): A3 — a reveal applies its range; R.reveal's readiness/retry model deleted frames-rulings 2.3 (a reveal is an apply) applied to the stream face's own segments: a revealed segment's content is applied against the store as it is revealed — its fills mount (as before) and the segments whose placeholders it carries reveal INSIDE it, in the same flush and before a reconstructed boundary commits the content — so `#flush` makes one pass over the frame's segments instead of retrying until no pass progresses (the store-model analogue of `$dfd` the re-attribution classed R.reveal), and a segment nested in content a pending fill holds reveals into the detached fragment instead of waiting for a chunk that never comes (pinned: two nested arms in the lifecycle matrix). The second ledger goes with it: `#revealed` / `#fallbackShown` / `isRevealed` — a reveal's applied state is the content record it applied, a fallback's the gate it materialized, by identity (2.1), in the one applied map the hole appliers already use; whether a segment is SHOWN is the DOM's to say (2.4: its placeholder is gone once it swapped). The segment swap's DOM half, the style gate and the per-flush content + gate + placeholder test stay (T.morph, F.assets, and the test the re-attribution says always stays). `Frame.isRevealed(segment)` (public, @experimental) is removed — no caller. Measured (frames eager, min): −45 against A7's head; the estimate (≈ −140 br) counted the fallback pass and the style gate, both kept. Co-authored-by: Claude <[email protected]> Co-authored-by: Cursor <[email protected]> * docs(server-components): frames rulings — 3.3's outward face landed (A7: the landing rejects, a later error errors the value, reset re-asks; the reach gap recorded), 2.3's stream-face half landed (A3); the plan's A3 row measured Co-authored-by: Claude <[email protected]> Co-authored-by: Cursor <[email protected]> * test(web): pin the adopted face of frames-rulings 3.3 — an sc:live error op errors a dynamic mount over the document's element, reset re-asks the intercepted call; the direct-placeholder gap Co-authored-by: Claude <[email protected]> Co-authored-by: Cursor <[email protected]> * frames: A5′ — fragment ownership by rendering, G9 collapse, claimRegionFragments deleted Ruled 2026-10-06 (12:55): a placeholder inside a server component's element is the frame's content by rendering, not by adoption. solid-js (hydration ledger): - fragmentPolicy swaps post-done when the fragment is claimed OR owned — ownedFragment(id): the pl-<id> template is in the document and _$HY.fa(pl) says the integration owns it. No _adoptedRoots, no replay. - _$HY.fr is { pending, subscribe }; claim/release removed (releaseFragment deleted; claimFragment stays for initBoundaryResume). - fragmentPending reads a revealed fragment from _$HY.v before its _fr stamp (the producer's real order: swap script, fe, then the settle) — the latent exhaustion bug under which a page's last reveal never read as exhaustion. @solidjs/web (frames client): - installRevealHook installs _$HY.fa once: pl.closest("[data-fid]") not in disposedFrames (C14: a boundary disposed in place marks its element and the region elements inside it). - claimRegionFragments / claimedFragments / cascade claim half / release loop deleted; the dev-only (c1) rejection report stays as an IS_DEV pl-* scan (0 prod bytes). - documentBoundary pends on awaitBoundary(id) — the intercept's one deferred answer; boundaryWaiters deleted (G9). Pins: adopted-swap-post-done.spec (G4 — adopted/then post-done; swap before the adoption with synchronous record read; nested region; held-outside control), boundary-arrival.spec (G9 — pend then adopt; exhaustion in the real order through the shipped $df; shared answer; disposed during the wait), C14 (e) dispose in place + control, C12 (c3) post-done client half, C2 (c2) re-pinned (no hold, no replay), frames-late-boundary-client swapIn stamps _fr after fe. Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * docs(server-components): A5′ landed — rulings 3.3 claimant by rendering (measured table), decided-by-default 8 superseded, contract mechanism refs, plan row A5 Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * frames: one sweep is one chunk — the `ops` member (C13) The sink's `sweep()` collects the hole / attr re-emissions one pass produces and emits them as ONE `{ type: "ops", id, version, ops: [...] }` chunk on the stream face (one wire line) and one `sc:live` op of the same shape on the document face; a sweep that changes one binding emits that member alone, addressed, as before. Members ride unaddressed — the envelope addresses them. Client: `chunkToRecords` merges a unit's members into one record map, so `FrameImpl.apply` writes them in one write and `#flush` lands them in one hole pass; the hole pass now announces `frame:applied` ONCE per flush (it announced per hole, which let a listener read the DOM with one hole of a sweep moved and its sibling not). `applyFrames.drain` and `applyLiveOp` pass the unit through unchanged. The document op log (`liveOps`, last-value-wins per target) flattens a unit into its members. Pins: `c13-sweep-atomic` (a, b) flip to `test`, fed the unit as the sink now emits it, plus a (log) arm for the catch-up replay; `test/server/frame-sweep-ops.spec.tsx` pins the sink on both faces (a two-hole sweep → one unit; a one-hole sweep → the plain member). `frame-live-holes-projection` reads the unit's members. Wire: additive `FrameChunk` member — RFC addendum in documentation/server-components/frame-streams-rfc.md, with what an old consumer does with it (drops the write; under-updates, never tears). Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * frames: the plain response's streaming bound — `complete.bound` A plain (non-`live`) server component whose content reads a standing source kept its response open until the source settled — never, for a generator that never returns — with none of `live`'s reconnect semantics. `frameStream` now ends such a response at a bound, detectably: - `bound: "yields"` after `maxYields` emitting sweeps past the first flush (default 64; a sweep that emits nothing is not a yield — the sink's new `onYield` hook counts them); - `bound: "time"` `maxDurationMs` after the first flush (default 30 000), or when the request's `signal` aborts after the first flush (a platform deadline the client can tell from a death); before the first flush, or for a `live` response, the abort stays the death it was. The sink's end-latch runs as for any completion, `complete` carries the bound, the body closes, and the render is torn down quietly — the abort reason carries `quiet: true`, which `renderToStream` reads as "the response chose to end" (no SSR_STREAM_ABANDONED). A body's own cancel (the reader left) stays a death: never dressed as a bound. A `live` response is never bounded. Client: `:bound` is stored beside `:complete`; the frame lands as on any `complete`; in dev the host warns once per cut-off, naming `live()`. Public surface: `FrameStreamOptions.maxYields` / `maxDurationMs` (new); `createFrameSink(emit, frame, have, hooks?)` (fourth parameter, `onYield`) and the sink's `end(bound?)`; `FrameChunk`'s `complete` gains `bound?`. RFC addendum in frame-streams-rfc.md. `frameTransformResult` takes the defaults (it is a policy function with no options object). Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * frames: a server <Loading>'s post-flush failure renders its outcome (C12 c) A server `<Loading>` inside a server component that fails after the first flush has no client twin to render over its position; the fragment used to carry a blank (`" "`) and the position emptied silently (R6). The document face now renders what the SERVER rendered for the outcome, as the stream face's `meta.error` path already revealed (frames-rulings 3.3, A0 corollary 4 inward): - the nearest SERVER `<Errored>`'s fallback for the error, at the `<Loading>`'s position — asked through the boundary error handler's new `outcome` mode (`createErrorBoundary` answers with its fallback as finished markup when it is inside the component's scope; a `<Loading>` between passes the question up; an `<Errored>` outside the component — the app's twin at t = 0 — answers nothing). Rule: "a post-flush error inside a server component's <Loading> shows the nearest <Errored>'s fallback at the boundary's position". Ids are the component's own hydration-free scope's; head / asset registrations drop as before; - with no server `<Errored>` the error ESCAPES the component — the frame as one async value errored, the outward face: the stream face's unkeyed `error` chunk (`:error`); the document face's `sc:live` `{ type: "error", fid, error }` op, which only the owning adopted boundary applies (`applyLiveOp`'s `fid` gate now covers unkeyed error ops) — and the position keeps the boundary's own fallback, never a blank. `_fr` still rejects and the keyed error chunk still rides. Outside a server component nothing changes: the blank the client twin renders fresh over. Pins: C12 (c2) flips to `test` (the page carries the Errored's fallback as the server now writes it); (c3) added for the escape arm; `test/server/frame-fragment-error-outcome.spec.tsx` pins the sink on both faces, the nested-Loading pass-up, and the unchanged non-component case. The maintainer's refetch question (a) is pinned `test.fails` in `test/frames-errored-reset-refetch.spec.tsx`: it fails at its first step — the client `<Errored>` never catches a frame's `:error` on this branch (the landing resolves on it) — and the two-part fix is described in the pin and in frames-rulings 3.3. Internal surface: `HydrationContext.registerFragment`'s resolver takes a third `escaped?: { frame?: string }`; `HydrationContext.frameId` (`@internal`, set by `frameTransformDirectResult`); the module-internal `ErrorContext` handler takes `(err, outcome?: true)`. Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * docs(server-components): frames rulings — the server half built (A6), the 2026-10-06 approvals, the refetch rule under 3.3 - The server-half drafts section gets a status block: the three drafts as built on `fix/frames-a6-server-half`, each with where it differs from the draft (the per-flush `frame:applied`, the signal-as-time-bound, the document face's escape op) and what is not built (the client's outward `:error` face). - The maintainer's approvals of 2026-10-06 recorded: A4 = the declared slot record (not the `_$HY.r` hook); A1b's surface removals approved ("not even beta"); S-adopted to be built; the 30 KB target stated against `page: base` without the router, to be reviewed after the first size pass. - 3.3 gains the refetch rule (a) as a ruling-by-A0 with its pin status (`test.fails`, failing at the client <Errored> never catching) and the two-part fix; (b) what slot content can reach today (nothing frame-specific; full app context) and the smallest addition (`SlotContext.address`). - The as-landed table's A6 row, the still-red list and the public-surface list updated with A6's items. - Savings pass §6 decision 5: "accepted for now; review after the first size pass" (maintainer, 2026-10-06). Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * frames: the A6 client half, trimmed (−56 B min) `chunkToRecords`' `ops` arm as one `Object.assign` over the mapped members; `:bound` written beside `:complete` unconditionally (`undefined` for a settled response, as `holes` is for a root without them); `applyLiveOp`'s frame gate as `op.fid && op.fid !== id`. Frames eager: +99 B min / +46 B br over the branch (was +155 / +42). Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Cursor <[email protected]> * test(hydration): generic hydration consistency pins and harness arm Answers "are the frames consistency reds SC-only, or generic hydration holes?" for Solid 2's plain `hydrate()`: classifies C1–C19 / R1–R10, drives the generic twin of every candidate through a frames-free page (two streamed `<Loading>` boundaries over module-level state, rendered by `renderToStream` in both fragment orders), by hand and under a property harness, and pins what it finds. Tests and docs only; no engine change. Six generic reds (`test.fails`, each with a control): - GH1 C19 — a memo created before snapshot capture (module-level) is read live by a boundary resume's claim pass; the server text stays. - GH2 C19 — a shell async memo adopted pending (no creation snapshot), re-run by a client write before a later boundary resumes — same. - GH3 C19/C1 — a store write to a leaf no reader materialized is not snapshotted: `<For>` at the resume renders the post-write length, key miss for the extra row, list short until the next structural change. - GH4 C9/C12/events — a boundary resuming while a shell async source is in flight commits its fallback over the settled server content at the snapshot release (unrevealed core boundary); the server nodes are detached then re-attached, a click queued on them is lost. - GH5 C3 — hydration-done does not count a root's module preload: a second root finishing synchronously drains done while the first still waits; the bootstrap then stops capturing events for it. - GH6 C14 — disposing a root during its module preload does not cancel the deferred render; the root mounts after dispose and stays live. Holds confirmed on plain pages (1000 harness cases, two seeds, nothing outside the six): C2, C3 for `<Loading>` holds, C10, C12 at settle points, C14 for boundary disposal, queued-event replay, the #3504 snapshot for plain signals. packages/web/test/consistency/generic/: scenario.ts, run.tsx (oracle), campaign.spec.tsx (opt-in, `CONSISTENCY_FUZZ=1`, same knobs as test/consistency/harness), replay.spec.tsx (GH1–GH4 + holds), preload-hold.spec.tsx (GH5, GH6), README.md. Shared page test/harness/generic-hydration.tsx; artifacts from test/server/generic-hydration.gen.spec.tsx. Contract doc: new section "Generic hydration — classification and pins (2026-10-06)". Co-authored-by: Claude via Cursor <[email protected]> * size: raise hydrating caps (maintainer Size-Exception); frames/page caps unchanged The three hydrating scenarios carry A2b's sharedConfig.hydrateWindow and A5′'s _$HY.fa in solid-js — costs the maintainer accepted 2026-10-06 (frames-rulings 3.2 "Cost as landed", 3.3). Caps set at measured + 10 B at the 0.01 KB step, recorded minified updated: app: hydrating (no stores) 17.73 -> 17.85 KB (52,626 -> 52,794 min) app: hydrating + stores 28.93 -> 29.08 KB (91,684 -> 91,858 min) app: compiled hydrating 31.03 -> 31.09 KB (99,257 -> 99,431 min) No ratchet: frames eager / page base / page live measure over their caps by 14 / 143 / 115 B brotli with minified −435 / −138 / −138 vs the recorded sizes (the gate's minified rule passes them with a warning); nothing is below its cap by a 0.01 KB step that this PR moved. * docs(server-components): Phase A gate taken — reds green / unrepresentable, harness clean on two seeds, frames eager measured against the target; rulings status → Phase A landed Co-authored-by: Cursor <[email protected]> * test(server): the generic-hydration artifact renders on a fake clock stepped 1 ms — its three flush points are three chunks on every host CI (#3849) ran the server suite under load: the page's 5 ms data value and its 15 ms fragment fell due in one event-loop turn, deferFlush wrote them as one chunk, and the hydrate suite then read a two-chunk artifact — every generic schedule's chunk indices shifted (C2 with no chunk → the C14 dispose pin threw at 'matchAll'; the GH1/GH2 'write between the reveals' pins became writes after both reveals and passed, failing as test.fails). Locally the same artifact self-re-recorded under the parallel suite. The generator now steps a fake clock (setTimeout + setImmediate faked) one millisecond at a time so each timer fires in its own turn with its flush; the chunks are byte-identical to the committed artifacts and stable under load (10/10 runs beside the full server suite). The assertions pin the shape: exactly three chunks, the first a script with no template, the other two fragment templates. Co-authored-by: Cursor <[email protected]> * size: re-derive the hydrating caps after merging next (#3849) CI Size run 37666601776 on the merge measured the three hydrating scenarios over next's caps (+168 / +174 / +174 B minified: A2b's sharedConfig.hydrateWindow and A5′'s _$HY.fa in solid-js). Caps set at CI brotli + 10 B rounded up to 0.01 KB, recorded minified from CI: - app: hydrating (no stores) 17.73 -> 17.85 KB (floor; 52,841 B min) - app: hydrating + every store primitive family 29.02 -> 29.09 KB (92,114 B) - app: compiled hydrating 31.06 -> 31.09 KB (99,477 B) Under the PR body's Size-Exception. Co-authored-by: Cursor <[email protected]> --------- Co-authored-by: Claude via Cursor <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: Cursor <[email protected]>
1 parent 3c7631a commit 3c1d512

84 files changed

Lines changed: 8180 additions & 1875 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"solid-js": patch
3+
---
4+
5+
A fill that claims adopted markup reads the state the server rendered it from (frames-rulings 3.6 (iii), "the consumer parks" — S1's third commit ported onto `next` without its `claiming` hint).
6+
7+
- `materializeContainerTrace` parks a replayed backlog beyond the snapshot until hydration ends (`onHydrationEnd`; the next microtask when no hydration is in progress) and then applies it as one ordinary update. A container trace is materialized at a fill's arg-read; when that fill claims server markup — the document's pass, a frame's deferred claim under its hold, a claim at a fragment's reveal after hydration-done — the snapshot is what the markup was rendered from, the claim trusts the markup (a text hole is never rewritten during a claim), and a store already past the markup left the DOM diverged for good. Parked, the claim reads the snapshot and the backlog lands after it, so the DOM catches up outside hydration. The release order is the one 3.2 pins: the claim, the frame's hold release, done, then the backlog. A fresh mount pays one beat for not being told apart: its backlog lands a microtask after its snapshot, before any paint. A failure in the backlog applies in order, after the parked patches.
8+
- The materializer creates its projection under a DETACHED root. Rooted under the reading owner — during hydration an id-carrying one — a trace revived at t=0 consumed one child id per trace while one revived by a late claim consumed none, and a keyed sibling after the frame hydrated under different keys in the two runs.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: A1b + A4 (S-ref) — a slot record's `{$ref}`s settle at the host's write, through the response's own data table (`FrameHostOptions.resolve(ref, frameId, version, current)`); an undelivered key is a pending read the response's `data` chunk settles and its `complete`/`error` rejects (L1 — a value that never comes is an error, not a silence); a fresh mount waits for the record to settle, a mounted occurrence's prop pends and holds its value. Codec data tables are per response (keyed by frame id and version). Deleted: `ServerComponentHandlerOptions.onStream`, `STAGED_DATA` and the staged tables, `FrameHost.resolve`, `FrameHostOptions.isContainer`/`FrameHost.isContainer`, `Frame.rebase`, the frame's record dedupe (`#refArgsUnchanged`, `#slotResolvedRefs`) — a re-sent record's equality is the fill's per-prop memo's — and the frame's error/root value latches (applied state keyed by record identity). `FrameHost.preview`/`Frame.preview` lose their `resolve` parameter and stay: the compute-half preview is what stages a refetch's args with the transaction that read it.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: a reveal applies its range (frames-rulings 2.3, A3). A revealed segment's content is applied against the store as it is revealed — its fills mount and the segments whose placeholders it carries reveal inside it, in the same flush and before a reconstructed boundary commits the content — so the frame's flush no longer retries over its segments, and a segment nested in content a pending fill holds no longer waits for a chunk that never comes. The readiness/retry model's second ledger (`#revealed` / `#fallbackShown`) is gone: a reveal's applied state is the content record it applied, a fallback's the gate it materialized, by identity, in the one applied map; whether a segment is shown is the DOM's to say. `Frame.isRevealed(segment)` is removed.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: A4 (S-record) — the document face declares a slot record at its marker: `_$HY.r["sc:slot:<fid>:<occurrence>"]` is a pending promise written with the occurrence's markup and settled with the args by the record's data script (the shape a fragment's `<key>_fr` takes), so the adopting client awaits a record that trails its range's reveal through the value's own `.then` instead of polling the registry (C2 (a2) flips). Output shape: ≈ +32–38 B per document slot record (the resolver helpers are shared with the page's fragment declarations); a sync render (`renderToString`) writes the settled value as before. Deleted: the #2968 `setTimeout` re-drain poll and `FrameOptions.recordsPending` / `FrameOptions.drainRecords`.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"solid-js": patch
3+
"@solidjs/web": patch
4+
---
5+
6+
Frames A5′ — a deferred fragment's placeholder inside a server component's element is the frame's content by rendering, not by adoption (frames-rulings 3.3, ruled 2026-10-06).
7+
8+
**`solid-js`:** the document fragment ledger's `fragmentPolicy` lets a post-done swap proceed when the fragment is owned — its `pl-*` template is in the document and the integration's ownership predicate `_$HY.fa(placeholder)` says so — beside the existing claimant case; no hold, no replay for owned fragments. `_$HY.fr.claim` / `_$HY.fr.release` are removed from the published ledger (`_$HY.fr` is `{ pending, subscribe }`); `_$HY.fa(placeholder): boolean` is the new integration hook. `fragmentPending` now reads a revealed fragment from its swap record (`_$HY.v`) before its `_fr` stamp: the producer emits the swap script and then the `_fr` settle in the same batch, so a `_$HY.fr.pending()` read inside the reveal notification saw the revealing fragment as still pending — a page's last reveal never read as exhaustion and a waiter released on exhaustion waited forever.
9+
10+
**`@solidjs/web` (frames client):** installs `_$HY.fa` once (`pl.closest("[data-fid]")`, minus elements of a boundary disposed in place — C14); deletes `claimRegionFragments`, the per-adoption claim set, the cascade's claim half and the release loop (the dev-only rejection report over the region's `pl-*` templates stays, 0 prod bytes); `documentBoundary` pends on the intercept's one arrival answer (`awaitBoundary`) and `boundaryWaiters` is deleted (G9). A post-done swap into server-component markup no client has adopted yet now lands at once; the adoption that follows finds it in place and reads its declared records synchronously.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: a frame's error is an errored async value (frames-rulings 3.3, A7). `FrameHost.landing(address)` rejects with the error record at the response's `:error` write, so the mount's content node throws to the nearest client `<Errored>` — the covering `<Loading>` no longer releases over an empty `<solid-frame>`. An error after the landing (a later yield failing, a cut-off stream, a refetch's response erroring) errors the node the same way; with no client `<Errored>` the core halts, as for any uncaught async error. The `<Errored>`'s `reset` re-asks: an errored landing is not a landing for a fresh consumer, and the re-read opens a new flight for the same address — the handler records the call behind every address it handles or the document answered (`callFor`, `@internal`), and the client re-invokes it through the server-function registry's RPC seam, whose client half now carries `createServerReference(id)`. A response for an address whose mounts show an error writes through instead of being staged. `frame.error` still records the error.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"solid-js": patch
3+
"@solidjs/web": patch
4+
---
5+
6+
A server `<Loading>` inside a server component that fails after the first flush renders the server's outcome into its fragment instead of a blank (C12 (c), frames-rulings 3.3): the nearest server `<Errored>`'s fallback for the error, at the `<Loading>`'s position (asked through the boundary error handler's new `outcome` mode; a `<Loading>` between passes the question up); with no server `<Errored>` the error escapes the component — the frame's own `:error` on the stream face (an unkeyed `error` chunk), a frame-addressed `{ type: "error", fid, error }` op on the document face's `sc:live` channel (only the owning adopted boundary applies it) — and the position keeps the boundary's own fallback. `_fr` still rejects and the keyed error chunk still rides (the diagnostics). Outside a server component nothing changes (the blank the client twin renders fresh over). `HydrationContext.registerFragment`'s resolver gains a third argument (`escaped?: { frame?: string }`) and the context an internal `frameId`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: one server sweep lands as one frame (C13). The sink collects the `hole` / `attr` re-emissions one sweep produces and emits them as one `{ type: "ops", ops: [...] }` chunk on the stream face (one wire line) and one `sc:live` op of the same shape on the document face; a sweep that changes one binding emits that member alone, as before. The client maps the unit to one record map and applies it as one write — one hole pass, one `frame:applied` (the hole pass now announces once per flush, not once per hole). The document op log flattens a unit into its members (last value per hole). Additive wire (`FrameChunk` gains the `ops` member; RFC addendum in `frame-streams-rfc.md`).
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"solid-js": patch
3+
"@solidjs/web": patch
4+
---
5+
6+
An adopted frame occurrence claims its server markup by re-entering hydration the way a streamed `<Loading>` resume does (frames-rulings 3.1 / 3.2, the savings plan's A2 — S-hold's window form).
7+
8+
- `solid-js`: `hydrateWindow(id, fn, scope?)` is factored out of a streamed boundary's resume and reached as `sharedConfig.hydrateWindow` (`@internal`): the keys under `id` gathered into the registry (the captured `scope` pair when another `hydrate()` root replaced the live one, #2917), hydrating on for the synchronous window, the current owner the claim owner (a render the window forces elsewhere is a client render, #3504), the owner the window's snapshot and live scope when none is open — so a write during a late claim is held and replays once the claim is over, and a late claim no longer re-marks the root's scope. `sharedConfig.claimRoots` (`@internal`) is typed: the claimant declares a range that may be detached around its window. `holdBoundary` stays the registration; the resume path is unchanged in behaviour.
9+
- `@solidjs/web` (frames): `claimRender` is the window — one `createOwner({ id: prefix })` and the call — instead of a registry of its own gathered by walking the range, a hydrating flag flipped through `sharedConfig`'s setter (which reset hydration-done and re-ran its completion from outside the runtime), and a hand-over of keys from the root registry: `gatherClaims` and `hasPendingFragment` are deleted (the window gathers by the producer prefix and always engages). `adoptBoundary` captures the registry/gather pair it adopts under so a claim made long after — under the frame's hold, at a fragment's reveal — gathers against the root that holds the frame.
10+
- `@solidjs/web`: `gatherHydratable`'s prefix-scoped gather selects its keys natively (`[_hk^="…"]`) instead of sweeping every `_hk` and filtering in JS — it now runs once per adopted occurrence, not only per late resume.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/web": patch
3+
---
4+
5+
frames: a plain (non-`live`) server component response ends at a streaming bound. A response whose content reads a standing source — a generator memo, a projection — used to stay open until the source settled, which for a source that never returns was never, with none of `live`'s reconnect semantics. The producer now ends it after `maxYields` emitting sweeps past the first flush (default 64) or `maxDurationMs` after the first flush (default 30 000 ms) — and when the request's `signal` aborts after the first flush — emitting `{ type: "complete", bound: "yields" | "time" }` before the body closes, and tears the render down quietly (sources returned, no abandonment finding). Both are new options on `FrameStreamOptions` (`renderServerComponent`, `renderToFrameStream`, `serverComponentResponse`); a `live` response is never bounded. The client stores `:bound` beside `:complete` and, in dev, warns once per cut-off naming `live()` as the declared way past the bound. `createFrameSink` gains an optional fourth `hooks` argument (`onYield`) and its `end(bound?)` takes the bound. Additive wire; RFC addendum in `frame-streams-rfc.md`.

0 commit comments

Comments
 (0)