From f8715f4ada397f488e9984da9f17f88d36ffe096 Mon Sep 17 00:00:00 2001
From: Claude
Date: Wed, 2 Dec 2026 09:20:55 +0000
Subject: [PATCH 01/15] refactor(solid): For returns its mapArray directly
The lazy create under the component's owner was there for the
patch-mode list driver (#3079), which no longer exists. Without it, the
closure and the hydrating-only eager branch (#3161) have no purpose.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/for-plain-maparray.md | 5 +++++
packages/solid/src/client/flow.ts | 26 ++++++--------------------
2 files changed, 11 insertions(+), 20 deletions(-)
create mode 100644 .changeset/for-plain-maparray.md
diff --git a/.changeset/for-plain-maparray.md b/.changeset/for-plain-maparray.md
new file mode 100644
index 0000000000..18395dd2fe
--- /dev/null
+++ b/.changeset/for-plain-maparray.md
@@ -0,0 +1,5 @@
+---
+"solid-js": patch
+---
+
+`` 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 `` page is about 60 B smaller minified.
diff --git a/packages/solid/src/client/flow.ts b/packages/solid/src/client/flow.ts
index 940a173e2a..ce51b888cf 100644
--- a/packages/solid/src/client/flow.ts
+++ b/packages/solid/src/client/flow.ts
@@ -5,11 +5,9 @@ import {
mapArray,
repeat,
createRevealOrder,
- getOwner,
- runWithOwner,
verdict
} from "@solidjs/signals";
-import { createErrorBoundary, createLoadingBoundary, sharedConfig } from "./hydration.js";
+import { createErrorBoundary, createLoadingBoundary } from "./hydration.js";
import type { Accessor, RevealOrder } from "@solidjs/signals";
export type { RevealOrder };
import type { Element as SolidElement } from "../types.js";
@@ -91,23 +89,11 @@ export function For(props: {
? { keyed: props.keyed, fallback: () => props.fallback }
: { keyed: props.keyed };
if (IS_OBSERVE) options.name = "";
- const owner = getOwner();
- let mapped: (() => any) | undefined;
- const create = () =>
- runWithOwner(owner, () =>
- mapArray(() => props.each, props.children as any, options as any)
- ) as () => any;
- // Hydration id parity (#3161): hydration ids mint at CREATION time, and
- // the server spends the list's id slot at For's source position — so a
- // hydrating client must create the map HERE, not on first read. Deferred
- // creation ran at insert's hole evaluation, AFTER later siblings had
- // already claimed their template keys, shifting every hydration id after
- // the list (the siblings hydrated detached: dead buttons). Outside
- // hydration the laziness stands: an unread list never builds its
- // mapArray at all.
- if (sharedConfig.hydrating) mapped = create();
- const list = () => (mapped ?? (mapped = create()))();
- return list as unknown as SolidElement;
+ return mapArray(
+ () => props.each,
+ props.children as any,
+ options as any
+ ) as unknown as SolidElement;
}
/**
From d2f5ad951e4eea02e55fe5a7d6858a2d37b2b795 Mon Sep 17 00:00:00 2001
From: Claude
Date: Wed, 2 Dec 2026 10:14:56 +0000
Subject: [PATCH 02/15] feat(signals): dev diagnostic RUN_WITH_ANCESTOR_OWNER
(#5280)
A running computation that creates a node on one of its own ancestors
through runWithOwner is reported in dev: the node outlives the code that
made it and takes the ancestor's next child slot at the moment of the
read, which shifts hydration ids (#5280). Nodes their creator places
(an id option, transparent) are exempt, which covers the runtime's own
re-entries. Docs, skill entry, catalog, and a parity-harness scenario
with the up-front-scope fix.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/run-with-ancestor-owner.md | 6 +
.../solid-2.0/02-signals-derived-ownership.md | 14 ++
documentation/solid-2.0/08-dev-diagnostics.md | 7 +
packages/signals/src/core/core.ts | 19 ++-
packages/signals/src/core/dev.ts | 1 +
packages/signals/src/core/owner.ts | 39 +++++
.../run-with-ancestor-owner-5280.test.ts | 141 ++++++++++++++++++
packages/solid/diagnostics.json | 9 ++
.../skills/reactivity-diagnostics/SKILL.md | 9 ++
.../lazy-owner-memo-shows-5280.json | 5 +
packages/web/test/harness/scenarios.tsx | 37 ++++-
11 files changed, 285 insertions(+), 2 deletions(-)
create mode 100644 .changeset/run-with-ancestor-owner.md
create mode 100644 packages/signals/tests/run-with-ancestor-owner-5280.test.ts
create mode 100644 packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
diff --git a/.changeset/run-with-ancestor-owner.md b/.changeset/run-with-ancestor-owner.md
new file mode 100644
index 0000000000..3a7a29cd8a
--- /dev/null
+++ b/.changeset/run-with-ancestor-owner.md
@@ -0,0 +1,6 @@
+---
+"@solidjs/signals": patch
+"solid-js": patch
+---
+
+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.
diff --git a/documentation/solid-2.0/02-signals-derived-ownership.md b/documentation/solid-2.0/02-signals-derived-ownership.md
index 3b12158ff3..bc37005066 100644
--- a/documentation/solid-2.0/02-signals-derived-ownership.md
+++ b/documentation/solid-2.0/02-signals-derived-ownership.md
@@ -50,6 +50,20 @@ export const singleton = runWithOwner(null, () => {
This makes “global lifetime” an explicit opt-in rather than the accidental default.
+#### Lazy work gets its own owner, made up front
+
+`runWithOwner(owner, fn)` re-enters a captured owner from code that runs outside any computation: an event handler, a timer, an async continuation. A running computation (a memo, an effect, a render pass) may not use it to create nodes on its own ancestors. The node would belong to the ancestor, so disposing or re-running the code that made it would leave it behind, and it would take the ancestor's next child slot at the moment of the read. While hydrating, that slot is an id the server spent on a sibling, and every later sibling misses its claim (#5280). Dev reports it as `RUN_WITH_ANCESTOR_OWNER`.
+
+For work created lazily on first read, make the owner when the component runs and create under it later, the way `mapArray` does with its rows:
+
+```js
+function useLazyClass() {
+ const scope = createRoot(() => getOwner()); // owned by the component, made in render order
+ let cls;
+ return () => (cls ??= runWithOwner(scope, () => createMemo(() => "active")))();
+}
+```
+
### Context: context value is the provider component
Context creation still looks the same, but usage becomes simpler: the context itself is a component that takes a `value` prop and provides it to descendants.
diff --git a/documentation/solid-2.0/08-dev-diagnostics.md b/documentation/solid-2.0/08-dev-diagnostics.md
index 54caabbf8b..3495ef4ee6 100644
--- a/documentation/solid-2.0/08-dev-diagnostics.md
+++ b/documentation/solid-2.0/08-dev-diagnostics.md
@@ -559,6 +559,12 @@ A `Loading` or `Errored` boundary was created without a parent owner.
The owner passed to `runWithOwner` has already been disposed. Any reactive primitives created inside will leak.
+#### `RUN_WITH_ANCESTOR_OWNER`
+
+**Message:** "runWithOwner created a computation on an ancestor of the code that is running. It is not disposed with that code, and its place among the ancestor's children depends on when it ran, which shifts hydration ids. Make the owner up front (const scope = createRoot(() => getOwner())) and run the lazy work under it."
+
+A running computation may not create nodes on its own ancestors. `runWithOwner(ancestor, () => createMemo(...))` from inside a memo, effect or render pass attaches the memo to the ancestor: disposing or re-running the code that made it leaves it in place, and it takes the ancestor's next child slot at the moment of the read. While hydrating, that slot is a hydration id the server spent on a sibling, so every later sibling misses its claim (#5280). Make a scope up front (`const scope = createRoot(() => getOwner())` in the component body) and create the lazy work under it, as `mapArray` does with its rows. Reported once per call, for the first node created directly under the ancestor. Not reported: a re-entry from outside any run (an event handler, a timer, an async continuation), one into the running owner itself, one that only reads context, and a node created with an `id` option or `transparent: true`, which is placed by its creator and takes no slot (the runtime's own re-entries, such as a boundary's fallback or a frame's fill, create those).
+
#### `FLUSH_IN_EFFECT_CALLBACK`
**Message:** "flush() called from inside an effect callback is a no-op: the flush that runs effects is already in progress. Writes made here are processed in the same flush's continuation; to force a drain afterwards, defer it: queueMicrotask(() => flush())."
@@ -1117,6 +1123,7 @@ The runtime derives a request's trace itself in every tier — the W3C `tracepar
| `NO_OWNER_CLEANUP` | warn | lifecycle | `onCleanup` called without owner |
| `NO_OWNER_BOUNDARY` | warn | lifecycle | Boundary created without owner |
| `RUN_WITH_DISPOSED_OWNER` | warn | owner | `runWithOwner` with disposed owner |
+| `RUN_WITH_ANCESTOR_OWNER` | warn | owner | `runWithOwner` into an ancestor of the running code creates a computation |
| `FLUSH_IN_EFFECT_CALLBACK` | warn | lifecycle | `flush()` from an effect callback (no-op; the drain is already running) |
| `HUGE_FAN_OUT` | warn | graph | One change reached 2000 live subscribers (always on), or 250 — `fanOut` — on a stamped root write (attribution enabled) |
| `HUGE_FAN_IN` | warn | graph | One recompute tracked 2000 sources (always on) |
diff --git a/packages/signals/src/core/core.ts b/packages/signals/src/core/core.ts
index f8b5eb4713..a76f7a9157 100644
--- a/packages/signals/src/core/core.ts
+++ b/packages/signals/src/core/core.ts
@@ -119,7 +119,14 @@ import {
} from "./dev.js";
import { attrHooks } from "./attribution-hooks.js";
import { devTrackHeldPending } from "./invariants.js";
-import { cleanup, disposeChildren, inheritId, linkChild, markDisposal } from "./owner.js";
+import {
+ cleanup,
+ disposeChildren,
+ inheritId,
+ linkChild,
+ markDisposal,
+ setAncestorEntry
+} from "./owner.js";
// Reader-seat shadow: `__TEST__` only (documentation/archive/plans/reader-seat-rebuild.md §3).
import {
RAISE_FL,
@@ -2474,6 +2481,15 @@ export function runWithOwner(owner: Owner | null, fn: (arg?: unknown) => unknown
)
);
}
+ // Dev: a re-entry into a strict ancestor of the running owner reports the
+ // first node it creates directly under that ancestor (RUN_WITH_ANCESTOR_OWNER,
+ // owner.ts `inheritId`).
+ let prevEntry: Owner | null | undefined;
+ if (__DEV__ && owner && context) {
+ let o = context._parent;
+ while (o && o !== owner) o = o._parent;
+ if (o) prevEntry = setAncestorEntry(owner);
+ }
const oldContext = context;
const prevTracking = tracking;
context = owner;
@@ -2483,6 +2499,7 @@ export function runWithOwner(owner: Owner | null, fn: (arg?: unknown) => unknown
} finally {
context = oldContext;
tracking = prevTracking;
+ if (__DEV__ && prevEntry !== undefined) setAncestorEntry(prevEntry);
}
}
diff --git a/packages/signals/src/core/dev.ts b/packages/signals/src/core/dev.ts
index 9b1839a74e..a0a1d76c2e 100644
--- a/packages/signals/src/core/dev.ts
+++ b/packages/signals/src/core/dev.ts
@@ -70,6 +70,7 @@ export type DiagnosticCode =
| "STORE_WRITE_THROUGH_LOADING"
| "ACTION_CALLED_IN_OWNED_SCOPE"
| "RUN_WITH_DISPOSED_OWNER"
+ | "RUN_WITH_ANCESTOR_OWNER"
| "NO_OWNER_CLEANUP"
| "CLEANUP_IN_FORBIDDEN_SCOPE"
| "SETTLED_CLEANUP_UNOWNED"
diff --git a/packages/signals/src/core/owner.ts b/packages/signals/src/core/owner.ts
index bb7958b50d..57444f6a25 100644
--- a/packages/signals/src/core/owner.ts
+++ b/packages/signals/src/core/owner.ts
@@ -26,6 +26,7 @@ import {
DEV,
emitDiagnostic,
forgetThrownRead,
+ reportDiagnostic,
registerRoot,
unregisterRoot
} from "./dev.js";
@@ -201,6 +202,21 @@ export function disposeChildren(node: Owner, self: boolean = false, zombie?: boo
}
}
+/**
+ * Dev: the owner a `runWithOwner` re-entered while one of its descendants
+ * was running (core.ts). A node created directly under it, taking its id
+ * from that owner's counter, is created on an ancestor of the code that made
+ * it (`RUN_WITH_ANCESTOR_OWNER`, #5280). A node with an explicit `id` or a
+ * transparent one is placed by its creator and takes no slot: the runtime's
+ * own re-entries (a boundary's fallback, a frame's fill) create those.
+ */
+let ancestorEntry: Owner | null = null;
+export function setAncestorEntry(owner: Owner | null): Owner | null {
+ const prev = ancestorEntry;
+ ancestorEntry = owner;
+ return prev;
+}
+
export function linkChild(parent: Owner, node: Owner): void {
const head = parent._firstChild;
node._prevSibling = null;
@@ -264,6 +280,29 @@ export function inheritId(
transparent: boolean,
parent: Owner | null | undefined
): string | undefined {
+ if (
+ __DEV__ &&
+ ancestorEntry !== null &&
+ parent === ancestorEntry &&
+ !transparent &&
+ !(options && "id" in options)
+ ) {
+ ancestorEntry = null;
+ reportDiagnostic(
+ emitDiagnostic(
+ {
+ code: "RUN_WITH_ANCESTOR_OWNER",
+ kind: "owner",
+ severity: "warn",
+ message:
+ "[RUN_WITH_ANCESTOR_OWNER] runWithOwner created a computation on an ancestor of the code that is running. It is not disposed with that code, and its place among the ancestor's children depends on when it ran, which shifts hydration ids. Make the owner up front (const scope = createRoot(() => getOwner())) and run the lazy work under it.",
+ ownerId: parent!.id,
+ ownerName: (parent as any)._name
+ },
+ parent
+ )
+ );
+ }
return (
options?.id ??
(transparent ? parent?.id : parent?.id != null ? getNextChildId(parent) : undefined)
diff --git a/packages/signals/tests/run-with-ancestor-owner-5280.test.ts b/packages/signals/tests/run-with-ancestor-owner-5280.test.ts
new file mode 100644
index 0000000000..72dcd89c28
--- /dev/null
+++ b/packages/signals/tests/run-with-ancestor-owner-5280.test.ts
@@ -0,0 +1,141 @@
+/**
+ * #5280: a running computation may not create nodes on its own ancestors.
+ * `runWithOwner(ancestor, () => createMemo(...))` from inside a descendant's
+ * run attaches the memo to the ancestor, so it outlives the code that made
+ * it and takes the ancestor's next child slot at whatever moment the read
+ * happened (the hydration id shift in #5280). Dev reports it once per call
+ * (`RUN_WITH_ANCESTOR_OWNER`). A scope made up front (the user-space
+ * mapArray shape), a re-entry from outside any run (handlers, timers), a
+ * re-entry that creates nothing, and a node its creator places (an `id`
+ * option, `transparent`: the runtime's own re-entries) stay quiet.
+ */
+import { afterEach, describe, expect, it, vi } from "vitest";
+import {
+ createContext,
+ createMemo,
+ createOwner,
+ createRoot,
+ createSignal,
+ flush,
+ getContext,
+ getOwner,
+ runWithOwner,
+ setContext,
+ OBSERVE
+} from "../src/index.js";
+
+afterEach(() => vi.restoreAllMocks());
+
+function codes(run: () => void) {
+ vi.spyOn(console, "warn").mockImplementation(() => {});
+ const capture = OBSERVE!.diagnostics.capture();
+ run();
+ return capture
+ .stop()
+ .map(e => e.code)
+ .filter(c => c === "RUN_WITH_ANCESTOR_OWNER");
+}
+
+describe("RUN_WITH_ANCESTOR_OWNER (#5280)", () => {
+ it("reports a memo created lazily on the owner of the running computation's ancestor", () => {
+ const found = codes(() => {
+ createRoot(() => {
+ const owner = getOwner();
+ let lazy: (() => string) | undefined;
+ const css = () => (lazy ??= runWithOwner(owner, () => createMemo(() => "active")))();
+ const branch = createMemo(() => css());
+ branch();
+ });
+ flush();
+ });
+ expect(found).toEqual(["RUN_WITH_ANCESTOR_OWNER"]);
+ });
+
+ it("reports once per call, not per node created", () => {
+ const found = codes(() => {
+ createRoot(() => {
+ const owner = getOwner();
+ const branch = createMemo(() =>
+ runWithOwner(owner, () => {
+ createMemo(() => 1);
+ createMemo(() => 2);
+ return 0;
+ })
+ );
+ branch();
+ });
+ flush();
+ });
+ expect(found).toEqual(["RUN_WITH_ANCESTOR_OWNER"]);
+ });
+
+ it("stays quiet for a scope made up front (user-space mapArray)", () => {
+ const found = codes(() => {
+ createRoot(() => {
+ const scope = createRoot(() => getOwner());
+ const [items] = createSignal([1, 2, 3]);
+ const rows = createMemo(() =>
+ items().map(i => runWithOwner(scope, () => createRoot(() => createMemo(() => i * 2))))
+ );
+ rows();
+ });
+ flush();
+ });
+ expect(found).toEqual([]);
+ });
+
+ it("stays quiet for a re-entry from outside any run (handler, timer)", () => {
+ const found = codes(() => {
+ let owner!: ReturnType;
+ createRoot(() => {
+ owner = getOwner();
+ });
+ runWithOwner(owner, () => createMemo(() => 1)());
+ flush();
+ });
+ expect(found).toEqual([]);
+ });
+
+ it("stays quiet for a re-entry that only reads context", () => {
+ const Ctx = createContext("none");
+ const found = codes(() => {
+ createRoot(() => {
+ setContext(Ctx, "outer");
+ const owner = getOwner();
+ const branch = createMemo(() => runWithOwner(owner, () => getContext(Ctx)));
+ expect(branch()).toBe("outer");
+ });
+ flush();
+ });
+ expect(found).toEqual([]);
+ });
+
+ it("stays quiet when creating under the running owner itself", () => {
+ const found = codes(() => {
+ createRoot(() => {
+ const branch = createMemo(() => {
+ const self = getOwner();
+ return runWithOwner(self, () => createMemo(() => 1))();
+ });
+ branch();
+ });
+ flush();
+ });
+ expect(found).toEqual([]);
+ });
+
+ it("stays quiet for nodes their creator places (an id option, transparent)", () => {
+ const found = codes(() => {
+ createRoot(() => {
+ const owner = getOwner();
+ const branch = createMemo(() => {
+ runWithOwner(owner, () => createOwner({ id: undefined }));
+ return runWithOwner(owner, () => createMemo(() => 1, { transparent: true } as any))();
+ });
+ branch();
+ });
+ flush();
+ });
+ expect(found).toEqual([]);
+ });
+});
diff --git a/packages/solid/diagnostics.json b/packages/solid/diagnostics.json
index 7f3025833d..60edae0ca0 100644
--- a/packages/solid/diagnostics.json
+++ b/packages/solid/diagnostics.json
@@ -431,6 +431,15 @@
"repair": "Nested `` with `collapsed`/`together` needs a stream to coordinate on; `renderToString` has none.",
"guideUrl": "https://docs.solidjs.com/reference/solid-js/diagnostics/reveal-in-render-to-string"
},
+ {
+ "code": "RUN_WITH_ANCESTOR_OWNER",
+ "kind": ["owner"],
+ "severity": ["warn"],
+ "category": "owner",
+ "trigger": "`runWithOwner` into an ancestor of the running code creates a computation",
+ "repair": "`runWithOwner` created a computation on an ancestor of the code that was running, so it is not disposed with that code and its place among the ancestor's children depends on when it ran (hydration ids shift).",
+ "guideUrl": "https://docs.solidjs.com/reference/solid-js/diagnostics/run-with-ancestor-owner"
+ },
{
"code": "RUN_WITH_DISPOSED_OWNER",
"kind": ["owner"],
diff --git a/packages/solid/skills/reactivity-diagnostics/SKILL.md b/packages/solid/skills/reactivity-diagnostics/SKILL.md
index 7dff9b27a7..3b7bfa7622 100644
--- a/packages/solid/skills/reactivity-diagnostics/SKILL.md
+++ b/packages/solid/skills/reactivity-diagnostics/SKILL.md
@@ -309,6 +309,15 @@ inside leaks. This usually means a stale owner captured across an await or
stored past its lifetime — re-capture the owner at call time or guard with
`isDisposed()`.
+### RUN_WITH_ANCESTOR_OWNER
+
+`runWithOwner` created a computation on an ancestor of the code that was
+running, so it is not disposed with that code and its place among the
+ancestor's children depends on when it ran (hydration ids shift). Make the
+owner up front, `const scope = createRoot(() => getOwner())` in the component
+body, and run the lazy work under `scope`, which is what `mapArray` does. A
+re-entry from an event handler, timer or async continuation is fine.
+
## API misuse
### MISSING_EFFECT_FN
diff --git a/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json b/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
new file mode 100644
index 0000000000..c34c603363
--- /dev/null
+++ b/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
@@ -0,0 +1,5 @@
+{
+ "name": "lazy-owner-memo-shows-5280",
+ "shell": "",
+ "rest": ""
+}
\ No newline at end of file
diff --git a/packages/web/test/harness/scenarios.tsx b/packages/web/test/harness/scenarios.tsx
index 9a937e7eb9..a6a870bb53 100644
--- a/packages/web/test/harness/scenarios.tsx
+++ b/packages/web/test/harness/scenarios.tsx
@@ -41,7 +41,10 @@ import {
NoHydration,
createContext,
children,
- latest
+ latest,
+ createRoot,
+ getOwner,
+ runWithOwner
} from "solid-js";
import {
Portal,
@@ -2543,6 +2546,30 @@ function PropConditionForwarded() {
);
}
+// #5280: a memo created lazily, on first read, from inside the first 's
+// branch. Created on the component's own owner it took that owner's next slot
+// mid-render and shifted the sibling 's ids (dev: RUN_WITH_ANCESTOR_OWNER).
+// Under a scope made up front, as mapArray does, both sides agree, lowered or not.
+let setLazyOwnerClicked!: (v: boolean) => void;
+function LazyOwnerMemoShows() {
+ const [clicked, set] = createSignal(false);
+ setLazyOwnerClicked = set;
+ const owner = createRoot(() => getOwner());
+ let memo: (() => string) | undefined;
+ const css = () => (memo ??= runWithOwner(owner, () => createMemo(() => "active"))!)();
+ return (
+
+
+
+
+
+
+
+
+
+ );
+}
+
// ---------------------------------------------------------------------------
// Text separators (#3383). The server decides `` on what each array
// item RESOLVES to; the client claims a flattened value positionally. These
@@ -4187,6 +4214,14 @@ export const scenarios: Scenario[] = [
expectedTextAfterUpdate: "Some Team",
stableSelector: "main, div, h1"
},
+ {
+ name: "lazy-owner-memo-shows-5280",
+ App: LazyOwnerMemoShows,
+ expectedText: "Clickwaiting",
+ update: () => setLazyOwnerClicked(true),
+ expectedTextAfterUpdate: "clicked",
+ stableSelector: "main, output"
+ },
{
name: "separator-memo-element-list",
App: MemoElementList,
From 5366c31c6ed476c8d525622bb65f545fe0095d38 Mon Sep 17 00:00:00 2001
From: Claude
Date: Wed, 2 Dec 2026 10:24:16 +0000
Subject: [PATCH 03/15] test(web): re-record lazy-owner-memo-shows-5280
artifact in default Show mode
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.../test/harness/__artifacts__/lazy-owner-memo-shows-5280.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json b/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
index c34c603363..10091358eb 100644
--- a/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
+++ b/packages/web/test/harness/__artifacts__/lazy-owner-memo-shows-5280.json
@@ -1,5 +1,5 @@
{
"name": "lazy-owner-memo-shows-5280",
- "shell": "",
+ "shell": "",
"rest": ""
}
\ No newline at end of file
From 7157b1dbbdc1c3334b8d4cbcc9d43d455758e145 Mon Sep 17 00:00:00 2001
From: Claude
Date: Wed, 2 Dec 2026 10:50:05 +0000
Subject: [PATCH 04/15] fix(web): production server components get a site per
mount (#5281)
documentSiteId cached a site per owner. Production createComponent makes no
owner, so sibling mounts and rows all reused the first mount's
data-fid and the client could adopt only the first. Key the cache by the
hydration position instead (owner, scope slot, child count): a retry at the
same position still reuses its site.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/frames-prod-site-id.md | 5 ++
packages/web/frames/src/frame-sink.ts | 11 +++--
.../test/server/prod-site-id-5281.spec.tsx | 48 +++++++++++++++++++
3 files changed, 60 insertions(+), 4 deletions(-)
create mode 100644 .changeset/frames-prod-site-id.md
create mode 100644 packages/web/test/server/prod-site-id-5281.spec.tsx
diff --git a/.changeset/frames-prod-site-id.md b/.changeset/frames-prod-site-id.md
new file mode 100644
index 0000000000..9449056299
--- /dev/null
+++ b/.changeset/frames-prod-site-id.md
@@ -0,0 +1,5 @@
+---
+"@solidjs/web": patch
+---
+
+Frames: in production, sibling mounts of one server component (and `` rows) get their own `data-fid` site again instead of all sharing the first one (#5281).
diff --git a/packages/web/frames/src/frame-sink.ts b/packages/web/frames/src/frame-sink.ts
index dde637c45d..f15d602df9 100644
--- a/packages/web/frames/src/frame-sink.ts
+++ b/packages/web/frames/src/frame-sink.ts
@@ -2067,8 +2067,10 @@ function frameElementOpen(id, args?) {
// hydration-key owner. Sharing one scope makes the second claim walk the
// first site's nodes (the registry is first-key-wins) and the second button
// never becomes live. The first site keeps the bare function id, so a page
-// with one mount is byte-identical. Keyed by owner: a re-render of the same
-// mount reuses the scope it already minted.
+// with one mount is byte-identical. Keyed by hydration position (owner, scope
+// slot, child count): a re-render or retry of the same mount reuses the scope
+// it already minted, and siblings that share an owner (production components
+// make none, #5281) still get their own.
const DOCUMENT_SITES = Symbol();
function contextSites(ctx) {
if (ctx[DOCUMENT_SITES]) return ctx[DOCUMENT_SITES];
@@ -2094,10 +2096,11 @@ function documentSiteId(fnId) {
if (!owner) return mintSiteId(sites, fnId);
let byFn = sites.byOwner.get(owner);
if (!byFn) sites.byOwner.set(owner, (byFn = new Map()));
- const prev = byFn.get(fnId);
+ const key = fnId + "\0" + owner.id + "\0" + owner._scopeSlot + "\0" + owner._childCount;
+ const prev = byFn.get(key);
if (prev) return prev;
const siteId = mintSiteId(sites, fnId);
- byFn.set(fnId, siteId);
+ byFn.set(key, siteId);
return siteId;
}
const FRAME_ELEMENT_CLOSE = `${FRAME_TAG}>`;
diff --git a/packages/web/test/server/prod-site-id-5281.spec.tsx b/packages/web/test/server/prod-site-id-5281.spec.tsx
new file mode 100644
index 0000000000..ac4955d3b4
--- /dev/null
+++ b/packages/web/test/server/prod-site-id-5281.spec.tsx
@@ -0,0 +1,48 @@
+/**
+ * #5281: in production every mount of one server component under one owner
+ * got the same `data-fid`. `documentSiteId` reused a site per owner, and the
+ * production `createComponent` makes no owner, so sibling mounts and ``
+ * rows all hit the first mount's site. A site is now keyed by the hydration
+ * position it is minted at (owner, scope slot, child count), so a retry at
+ * the same position still reuses its site.
+ *
+ * Runs the built production artifacts in a child process (the rest of this
+ * suite aliases solid-js to source), so it needs a prior `pnpm build`.
+ */
+import { expect, test } from "vitest";
+import { execFileSync } from "node:child_process";
+import { resolve } from "node:path";
+
+const webDir = resolve(import.meta.dirname, "../..");
+
+test("production: sibling mounts, rows and scoped holes get distinct sites; a retry keeps its site", () => {
+ const script = `
+ const web = await import(${JSON.stringify(webDir + "/dist/server.js")});
+ const frames = await import(${JSON.stringify(webDir + "/frames/dist/server.js")});
+ const { createMemo } = await import(${JSON.stringify(webDir + "/../solid/dist/server.js")});
+ const { renderToStream, createComponent, ssr, escape, For, Loading, scope } = web;
+ const Inline = frames.frameTransformDirectResult(p => ssr(["
"], scope(() => createComponent(Inline, { n: 1 })), scope(() => [createComponent(Inline, { n: 2 }), escape(m())]));
+ } })));
+ process.stdout.write(JSON.stringify({ siblings, rows, scoped, retry }));
+ `;
+ const out = JSON.parse(
+ execFileSync(process.execPath, ["--input-type=module", "-e", script], {
+ cwd: webDir,
+ encoding: "utf8"
+ })
+ );
+ expect(out).toEqual({
+ siblings: ["sc-fn", "sc-fn~2"],
+ rows: ["sc-fn", "sc-fn~2", "sc-fn~3"],
+ scoped: ["sc-fn", "sc-fn~2"],
+ retry: ["sc-fn", "sc-fn~2"]
+ });
+});
From 068936829347edb6e3f4e14bfe97818140ac411f Mon Sep 17 00:00:00 2001
From: Claude
Date: Thu, 3 Dec 2026 16:02:54 +0000
Subject: [PATCH 05/15] fix(web): an escaped async render failure is the
frame's :error (#5283)
The render's wind-down ends a frame stream's writable with end() on success
and failure alike, so a rejection with no server boundary answered a bare
:complete. renderToStream now tells a custom sink about the failure
(sink.failed) before it winds down, and the frame stream answers it with
the same :error record a synchronous throw does.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/frame-preflush-rejection.md | 5 +++
packages/web/frames/src/frame-sink.ts | 13 +++++-
packages/web/src/server.ts | 3 ++
.../frame-preflush-rejection-5283.spec.tsx | 45 +++++++++++++++++++
4 files changed, 65 insertions(+), 1 deletion(-)
create mode 100644 .changeset/frame-preflush-rejection.md
create mode 100644 packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
diff --git a/.changeset/frame-preflush-rejection.md b/.changeset/frame-preflush-rejection.md
new file mode 100644
index 0000000000..dc8f433053
--- /dev/null
+++ b/.changeset/frame-preflush-rejection.md
@@ -0,0 +1,5 @@
+---
+"@solidjs/web": patch
+---
+
+Frames: a server component whose async read rejects before the first flush, with no server `` around it, now answers the frame's `:error` record instead of a bare `:complete` (#5283).
diff --git a/packages/web/frames/src/frame-sink.ts b/packages/web/frames/src/frame-sink.ts
index f15d602df9..7ff809b64e 100644
--- a/packages/web/frames/src/frame-sink.ts
+++ b/packages/web/frames/src/frame-sink.ts
@@ -1163,6 +1163,11 @@ function frameStream(makeCode, options) {
if (upstream && upstream.aborted) return finish();
if (upstream) upstream.addEventListener("abort", onSignal, { once: true });
const code = makeCode(sink, frame);
+ // A render failure that escaped every boundary (an async rejection with
+ // no server ``, #5283). `end()` below is how the render's
+ // wind-down completes this stream, success or not: this tells them apart.
+ let failed;
+ sink.failed = err => (failed = [err]);
try {
// Frames default to the keyed JSON codec for data records (eval-free
// nodes; decode with createJSONDataTable). `options.serializer` can
@@ -1182,8 +1187,14 @@ function frameStream(makeCode, options) {
write() {},
end() {
if (ended) return;
+ // The same `:error` a synchronous throw answers (catch below).
+ if (failed) {
+ const wire = ssrSanitizeError(failed[0], null);
+ sink.error("", wire instanceof Error ? wire.message : String(wire));
+ }
sink.end();
- observation && observation.settle("complete");
+ observation &&
+ (failed ? observation.settle("error", failed[0]) : observation.settle("complete"));
finish();
}
});
diff --git a/packages/web/src/server.ts b/packages/web/src/server.ts
index c979a370ff..69ecf45def 100644
--- a/packages/web/src/server.ts
+++ b/packages/web/src/server.ts
@@ -2303,6 +2303,9 @@ export function renderToStream(code, options = {}) {
// this a no-op (once per error). With no hook anywhere the failure is
// never silent.
reportFailure(err, "failed");
+ // A frame stream answers the failure in-band (its `:error` record,
+ // #5283); the document has no such record and ends through `abandon`.
+ if (options.sink && options.sink.failed) options.sink.failed(err);
abandon();
};
// The same containment reached from the renderer's OWN retry passes (root
diff --git a/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx b/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
new file mode 100644
index 0000000000..ab9495eec1
--- /dev/null
+++ b/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
@@ -0,0 +1,45 @@
+/**
+ * @jsxImportSource @solidjs/web
+ *
+ * #5283: a server component whose async read rejects before the first flush,
+ * with no server `` around it, answered `:complete` with no `:error`
+ * record. The render's wind-down ends the stream's writable the same way on
+ * success and failure, so the failure never reached the wire: the client's
+ * `` was never told and the response was cacheable. A failure that
+ * escapes a server component is the frame's `:error` (frames-rulings 3.3),
+ * the same record a synchronous throw answers.
+ */
+import { expect, it } from "vitest";
+import { createMemo } from "solid-js";
+import { renderServerComponent } from "../../frames/src/frame-sink.js";
+import { record } from "./wire.js";
+
+const collect = (stream: any) =>
+ new Promise(resolve => {
+ const chunks: any[] = [];
+ stream.pipe({ write: (c: any) => chunks.push(c), end: () => resolve(chunks) });
+ });
+
+it("control: a synchronous throw is the frame's :error", async () => {
+ const chunks = await collect(
+ renderServerComponent(
+ () => {
+ throw new Error("db down");
+ },
+ { frame: { id: "pre" }, onError() {} }
+ )
+ );
+ expect(record(chunks, ":error")).toBe("db down");
+});
+
+it("an async rejection with no server boundary is the frame's :error", async () => {
+ const Comp = () => {
+ const rows = createMemo(async () => {
+ await new Promise(r => setTimeout(r, 5));
+ throw new Error("db down");
+ });
+ return
{rows() as any}
;
+ };
+ const chunks = await collect(renderServerComponent(Comp, { frame: { id: "pre" }, onError() {} }));
+ expect(record(chunks, ":error")).toBe("db down");
+});
From 2af54fa3d56e859b3d6b828fcc64a7d496703cae Mon Sep 17 00:00:00 2001
From: Claude
Date: Fri, 4 Dec 2026 06:32:23 +0000
Subject: [PATCH 06/15] fix(web): a frame response's head leaves at its shell
(#5283)
serverComponentResponse built its Response right after the sync pass, so a
failure before the shell (async read at the root with no ) could
not reach the head and a cacheable response kept its cache headers. It now
resolves at the shell, as createSSRResponse does for a document: a failure
before it answers no-store with the :error record. After the shell
everything streams as before.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/frame-preflush-rejection.md | 2 +-
.../server-components/frames-rulings.md | 13 +++
packages/web/frames/src/frame-sink.ts | 65 ++++++++++-----
.../test/server/frame-live-framing.spec.tsx | 2 +-
.../test/server/frame-plain-bound.spec.tsx | 13 +--
.../frame-preflush-rejection-5283.spec.tsx | 79 ++++++++++++++++++-
.../web/test/server/frame-teardown.spec.tsx | 6 +-
.../web/test/server/tier-announce.spec.tsx | 15 ++--
8 files changed, 159 insertions(+), 36 deletions(-)
diff --git a/.changeset/frame-preflush-rejection.md b/.changeset/frame-preflush-rejection.md
index dc8f433053..359113ea47 100644
--- a/.changeset/frame-preflush-rejection.md
+++ b/.changeset/frame-preflush-rejection.md
@@ -2,4 +2,4 @@
"@solidjs/web": patch
---
-Frames: a server component whose async read rejects before the first flush, with no server `` around it, now answers the frame's `:error` record instead of a bare `:complete` (#5283).
+Frames: a server component whose async read rejects before the first flush, with no server `` or `` 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` (experimental API); responses made through `frameTransformResult` are unaffected.
diff --git a/documentation/server-components/frames-rulings.md b/documentation/server-components/frames-rulings.md
index 1c09179e99..b1cd4fcdd8 100644
--- a/documentation/server-components/frames-rulings.md
+++ b/documentation/server-components/frames-rulings.md
@@ -1046,6 +1046,19 @@ rule:
own path. A frames-owned `refetch()` on the slot context is the larger
form and needs (a)'s per-address re-invoke first.
+**Landed (2026-12-04, #5313, Ryan: "Go"):** a failure that escapes a
+server component before its shell (async read at the root with no server
+``, rejecting) is the frame's `:error`, the same record a
+synchronous throw answers (#5283). `serverComponentResponse` resolves its
+`Response` at the shell, as `createSSRResponse` does for a document, so such
+a failure also declares the response uncacheable (`no-store`, CDN fields
+removed). After the shell nothing changes: everything streams, and a later
+failure is a boundary's or rides in-band. A server component that wraps its
+async in `` reaches its shell right after the sync pass, so its
+head leaves then, as before. `serverComponentResponse` now returns
+`Promise`; `frameTransformResult`'s result was already awaited by
+`handleServerFunctionRequest`.
+
### 3.4 The client consumes what the server consumed
**The adopted component takes the same hydration ids the server's render of the
diff --git a/packages/web/frames/src/frame-sink.ts b/packages/web/frames/src/frame-sink.ts
index 7ff809b64e..d1371353c8 100644
--- a/packages/web/frames/src/frame-sink.ts
+++ b/packages/web/frames/src/frame-sink.ts
@@ -1072,6 +1072,11 @@ const DISCONNECTED = Symbol("solid.frames.disconnected");
// into the response head, which it builds right after the pass. Module-
// private — the `pipe` writable's public shape is `write`/`end`.
const ANNOUNCE = Symbol("solid.frames.announce");
+// A pipe writable's hook for the shell: the root's html has gone into the
+// stream (or, on a resume the client already shows, its differing holes).
+// `serverComponentResponse` sends its head here, as `createSSRResponse` does
+// for a document (#5283). Module-private, like `ANNOUNCE`.
+const SHELL = Symbol("solid.frames.shell");
function frameStream(makeCode, options) {
const { id = "", version = 1 } = options.frame || {};
@@ -1168,6 +1173,11 @@ function frameStream(makeCode, options) {
// wind-down completes this stream, success or not: this tells them apart.
let failed;
sink.failed = err => (failed = [err]);
+ const shell = sink.shell;
+ sink.shell = (source, meta) => {
+ shell(source, meta);
+ if (w[SHELL]) w[SHELL]();
+ };
try {
// Frames default to the keyed JSON codec for data records (eval-free
// nodes; decode with createJSONDataTable). `options.serializer` can
@@ -2989,7 +2999,7 @@ export function serverComponentResponse(
component: (props: Record) => unknown,
options?: FrameStreamOptions,
init?: { headers?: HeadersInit; status?: number }
-): Response;
+): Promise;
export function serverComponentResponse(component, options = {}, init = {}) {
const { id = "", version = 1 } = options.frame || {};
@@ -3033,12 +3043,27 @@ export function serverComponentResponse(component, options = {}, init = {}) {
// every road the body ends by.
let stopLive = null;
// The frame itself failed as one value (an unkeyed `error` record; a keyed
- // one is a fragment's diagnostic). Seen during the sync pass, it decides
- // the head below.
+ // one is a fragment's diagnostic). Seen before the shell, it decides the
+ // head below.
let failed = false;
- const body = new ReadableStream({
+ // The head leaves at the shell, as a document's does (`createSSRResponse`,
+ // #5283): a failure before it (a sync throw, or async read at the root
+ // with no `` rejecting) is known when the head is built. After
+ // the shell everything streams, and a failure is a boundary's or rides
+ // in-band. The stream's end (a failure, a teardown) sends it too.
+ let body;
+ let shelled = false;
+ let sendHead;
+ const head = new Promise(resolve => (sendHead = resolve));
+ const shellReached = () => {
+ if (shelled) return;
+ shelled = true;
+ if (body) respondNow();
+ };
+ body = new ReadableStream({
start(controller) {
const end = () => {
+ shellReached();
if (closed) return;
closed = true;
disarm();
@@ -3073,14 +3098,13 @@ export function serverComponentResponse(component, options = {}, init = {}) {
},
end,
// The tiers the sync render pass minted, into the response head
- // (`X-Frame-Tiers`; frames savings pass §2). `start` runs
- // synchronously inside the `ReadableStream` constructor, so this
- // fires before the `Response` below is built — the head carries
- // what the render knew at its first flush; anything later rides
- // in-band on a chunk. Omitted when the pass minted nothing.
+ // (`X-Frame-Tiers`; frames savings pass §2). The pass ends before
+ // the shell, so this lands before the head is built; anything later
+ // rides in-band on a chunk. Omitted when the pass minted nothing.
[ANNOUNCE](tiers) {
if (tiers.length) headers.set(FRAME_TIERS_HEADER, tiers.join(","));
- }
+ },
+ [SHELL]: shellReached
});
},
cancel() {
@@ -3093,20 +3117,25 @@ export function serverComponentResponse(component, options = {}, init = {}) {
}
});
// The author's cache headers arrived with the head (`respond()`) and
- // describe a success. A sync render failure is a 200 whose body is the
- // `:error` record, seen above before this head exists: declare it
+ // describe a success. A failure before the shell is a 200 whose body is
+ // the `:error` record, seen above before this head exists: declare it
// uncacheable, for every cache. A CDN-targeted field (`CDN-Cache-Control`,
// `-CDN-Cache-Control`, RFC 9213) or `Surrogate-Control` overrides
// `Cache-Control` at the CDN, so those go too. Status stays 200: the client
// reads the frame stream, and a 4xx/5xx without the body-format header is
// a transport failure instead of the component's error. A failure after
- // this, once a suspended shell has to leave, can no longer change the head.
- if (failed) {
- headers.set("Cache-Control", "no-store");
- for (const name of [...headers.keys()])
- if (name === "surrogate-control" || name.endsWith("cdn-cache-control")) headers.delete(name);
+ // the shell can no longer change the head.
+ function respondNow() {
+ if (failed) {
+ headers.set("Cache-Control", "no-store");
+ for (const name of [...headers.keys()])
+ if (name === "surrogate-control" || name.endsWith("cdn-cache-control"))
+ headers.delete(name);
+ }
+ sendHead(new Response(body, { status: init.status || 200, headers }));
}
- return new Response(body, { status: init.status || 200, headers });
+ if (shelled) respondNow();
+ return head;
}
/**
diff --git a/packages/web/test/server/frame-live-framing.spec.tsx b/packages/web/test/server/frame-live-framing.spec.tsx
index a16768ca61..342ccbfd13 100644
--- a/packages/web/test/server/frame-live-framing.spec.tsx
+++ b/packages/web/test/server/frame-live-framing.spec.tsx
@@ -133,7 +133,7 @@ describe("a frame stream at the live address (Stage 8 B2)", () => {
it("a standing component's response stays open without a complete, and writes the heartbeat while idle", async () => {
const { source, state } = standing();
- const response = serverComponentResponse(componentOver(source), {
+ const response = await serverComponentResponse(componentOver(source), {
frame: { id: "f0" },
live: true
});
diff --git a/packages/web/test/server/frame-plain-bound.spec.tsx b/packages/web/test/server/frame-plain-bound.spec.tsx
index 1cd16368c0..7641c07237 100644
--- a/packages/web/test/server/frame-plain-bound.spec.tsx
+++ b/packages/web/test/server/frame-plain-bound.spec.tsx
@@ -325,7 +325,7 @@ describe("the plain-response streaming bound", () => {
it('aborting after the first flush ends a plain response as the time bound does: `:bound: "time"`, then the body closes', async () => {
const ch = channel();
const controller = new AbortController();
- const response = serverComponentResponse(
+ const response = await serverComponentResponse(
holeComponent(() => ch.iterable),
{
frame: { id: "sig" },
@@ -361,14 +361,15 @@ describe("the plain-response streaming bound", () => {
const text = createMemo(() => ch.iterable);
return
{text()}
;
};
- const response = serverComponentResponse(Comp, {
+ // The head waits for the shell (#5283): before it, the abort is what
+ // sends it, with the body already ended.
+ const pending = serverComponentResponse(Comp, {
frame: { id: "sig0" },
signal: controller.signal
});
- const reading = readBody(response);
await tick();
controller.abort();
- const chunks = await reading;
+ const chunks = await readBody(await pending);
expect(chunks.map(c => c.type)).toEqual(["start"]);
expect(ch.state.closed).toBe(true);
});
@@ -376,7 +377,7 @@ describe("the plain-response streaming bound", () => {
it("aborting a `live` response ends the body without `complete`", async () => {
const ch = channel();
const controller = new AbortController();
- const response = serverComponentResponse(
+ const response = await serverComponentResponse(
holeComponent(() => ch.iterable),
{
frame: { id: "sigl" },
@@ -401,7 +402,7 @@ describe("the plain-response streaming bound", () => {
it("the body's own cancel (the reader left) is a death, never a bound", async () => {
const ch = channel();
- const response = serverComponentResponse(
+ const response = await serverComponentResponse(
holeComponent(() => ch.iterable),
{
frame: { id: "cancel" }
diff --git a/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx b/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
index ab9495eec1..d344421300 100644
--- a/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
+++ b/packages/web/test/server/frame-preflush-rejection-5283.spec.tsx
@@ -8,12 +8,42 @@
* `` was never told and the response was cacheable. A failure that
* escapes a server component is the frame's `:error` (frames-rulings 3.3),
* the same record a synchronous throw answers.
+ *
+ * The response head leaves at the shell, as a document's does
+ * (`createSSRResponse`), so such a failure also declares the response
+ * uncacheable. A component that wraps its async in `` still gets
+ * its head right after the sync pass: streaming is unchanged.
*/
import { expect, it } from "vitest";
import { createMemo } from "solid-js";
-import { renderServerComponent } from "../../frames/src/frame-sink.js";
+import { Loading } from "@solidjs/web";
+import { renderServerComponent, serverComponentResponse } from "../../frames/src/frame-sink.js";
+import { ChunkReader } from "../../server-functions/src/shared.js";
import { record } from "./wire.js";
+async function readBody(response: Response) {
+ const reader = new ChunkReader(response.body!);
+ const chunks: any[] = [];
+ for (let r = await reader.next(); !r.done; r = await reader.next()) {
+ chunks.push(JSON.parse(r.value as string));
+ }
+ return chunks;
+}
+
+const cacheable = {
+ headers: { "cache-control": "public, max-age=60", "cdn-cache-control": "max-age=600" }
+};
+const later = (ms: number, fn: () => T) =>
+ new Promise((resolve, reject) =>
+ setTimeout(() => {
+ try {
+ resolve(fn());
+ } catch (err) {
+ reject(err);
+ }
+ }, ms)
+ );
+
const collect = (stream: any) =>
new Promise(resolve => {
const chunks: any[] = [];
@@ -43,3 +73,50 @@ it("an async rejection with no server boundary is the frame's :error", async ()
const chunks = await collect(renderServerComponent(Comp, { frame: { id: "pre" }, onError() {} }));
expect(record(chunks, ":error")).toBe("db down");
});
+
+it("the head waits for the shell: a rejection before it answers no-store", async () => {
+ const Comp = () => {
+ const rows = createMemo(() =>
+ later(5, () => {
+ throw new Error("db down");
+ })
+ );
+ return
;
+ };
+ const response = await serverComponentResponse(Comp, { frame: { id: "ok" } }, cacheable);
+ expect(response.headers.get("cache-control")).toBe("public, max-age=60");
+ expect(record(await readBody(response), ":error")).toBeUndefined();
+});
+
+it("async under does not hold the head: it leaves after the sync pass", async () => {
+ let release!: (v: string) => void;
+ const data = new Promise(r => (release = r));
+ const Comp = () => {
+ const rows = createMemo(() => data);
+ return (
+ loading
}>
+
{rows()}
+
+ );
+ };
+ const response = await serverComponentResponse(Comp, { frame: { id: "ld" } }, cacheable);
+ // The data is still pending: the head did not wait for it.
+ expect(response.headers.get("cache-control")).toBe("public, max-age=60");
+ release("ok");
+ expect(record(await readBody(response), ":error")).toBeUndefined();
+});
diff --git a/packages/web/test/server/frame-teardown.spec.tsx b/packages/web/test/server/frame-teardown.spec.tsx
index 30d68e9ff8..26d42b0c0b 100644
--- a/packages/web/test/server/frame-teardown.spec.tsx
+++ b/packages/web/test/server/frame-teardown.spec.tsx
@@ -88,7 +88,7 @@ afterEach(() => {
describe("frame teardown on disconnect (Stage 8 B1)", () => {
it("cancelling the response body returns the standing source and records the abandonment", async () => {
const { source, state } = standing();
- const response = serverComponentResponse(componentOver(source), { frame: { id: "f0" } });
+ const response = await serverComponentResponse(componentOver(source), { frame: { id: "f0" } });
const { reader } = await readUntil(response.body!, "first");
expect(state.returned).toBe(false);
@@ -103,7 +103,7 @@ describe("frame teardown on disconnect (Stage 8 B1)", () => {
it("the request's abort tears the render down and ends the body", async () => {
const { source, state } = standing();
const controller = new AbortController();
- const response = serverComponentResponse(componentOver(source), {
+ const response = await serverComponentResponse(componentOver(source), {
frame: { id: "f0" },
signal: controller.signal
});
@@ -126,7 +126,7 @@ describe("frame teardown on disconnect (Stage 8 B1)", () => {
const { source, state } = standing();
const controller = new AbortController();
controller.abort();
- const response = serverComponentResponse(componentOver(source), {
+ const response = await serverComponentResponse(componentOver(source), {
frame: { id: "f0" },
signal: controller.signal
});
diff --git a/packages/web/test/server/tier-announce.spec.tsx b/packages/web/test/server/tier-announce.spec.tsx
index 97d314e738..9d4b143882 100644
--- a/packages/web/test/server/tier-announce.spec.tsx
+++ b/packages/web/test/server/tier-announce.spec.tsx
@@ -78,7 +78,7 @@ const Traced = (props: any) => {
describe("tier announcement — stream face", () => {
it("announces nothing when nothing is minted: no header, no `tiers` on any chunk", async () => {
- const response = serverComponentResponse(Plain, { frame: { id: "ta-none" } });
+ const response = await serverComponentResponse(Plain, { frame: { id: "ta-none" } });
expect(response.headers.has(FRAME_TIERS_HEADER)).toBe(false);
const chunks = await bodyChunks(response);
expect(chunks.some(c => "tiers" in c)).toBe(false);
@@ -86,7 +86,7 @@ describe("tier announcement — stream face", () => {
});
it("`regions`: a nested region is announced, once, and rides the head", async () => {
- const response = serverComponentResponse(Regioned, { frame: { id: "ta-reg" } });
+ const response = await serverComponentResponse(Regioned, { frame: { id: "ta-reg" } });
expect(response.headers.get(FRAME_TIERS_HEADER)).toBe("regions");
const chunks = await bodyChunks(response);
expect(records(chunks, "slot:")[0][1].args.body).toEqual({
@@ -95,7 +95,7 @@ describe("tier announcement — stream face", () => {
});
it("`trace`: a traced container in a slot arg announces on its own data chunk", async () => {
- const response = serverComponentResponse(Traced, { frame: { id: "ta-tr" } });
+ const response = await serverComponentResponse(Traced, { frame: { id: "ta-tr" } });
const chunks = await bodyChunks(response);
// The announcement rides the record's data chunk itself: the mint
// (`argBorderForm` meeting the container) precedes the serializer's
@@ -117,7 +117,7 @@ describe("tier announcement — stream face", () => {
});
it("`wire`: a `live` response announces the wire tier", async () => {
- const response = serverComponentResponse(Plain, { frame: { id: "ta-wire" }, live: true });
+ const response = await serverComponentResponse(Plain, { frame: { id: "ta-wire" }, live: true });
expect(response.headers.get(FRAME_TIERS_HEADER)).toBe("wire");
expect(response.headers.get("Content-Type")).toBe("text/event-stream");
// Not read: a live body stays open for its heartbeat; cancel it.
@@ -125,7 +125,10 @@ describe("tier announcement — stream face", () => {
});
it("several tiers: comma-separated, in mint order", async () => {
- const response = serverComponentResponse(Regioned, { frame: { id: "ta-both" }, live: true });
+ const response = await serverComponentResponse(Regioned, {
+ frame: { id: "ta-both" },
+ live: true
+ });
expect(response.headers.get(FRAME_TIERS_HEADER)!.split(",").sort()).toEqual([
"regions",
"wire"
@@ -152,7 +155,7 @@ describe("tier announcement — stream face", () => {
);
};
- const response = serverComponentResponse(Late, { frame: { id: "ta-late" } });
+ const response = await serverComponentResponse(Late, { frame: { id: "ta-late" } });
// The head knew nothing yet: no header.
expect(response.headers.has(FRAME_TIERS_HEADER)).toBe(false);
const chunks = await bodyChunks(response);
From 185678cbbd68b6fb0ace4b2b750d145d3f4bfe15 Mon Sep 17 00:00:00 2001
From: Claude
Date: Fri, 4 Dec 2026 08:10:47 +0000
Subject: [PATCH 07/15] fix(web): different server component arguments get
different frame addresses (#5284)
The client keys a call's content, binding and version by its frame address,
but the argument digest's text was ambiguous (1 and "1", ["a,b"] and
["a","b"], every URL/URLSearchParams as {}) and folded with h*31+c, so
two calls could share an address and one mount showed the other's markup.
Strings and keys are quoted, class instances carry their string form, and
the fold is FNV-1a. Harness artifacts re-recorded for the new addresses.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/frame-address-collision.md | 5 ++
packages/web/server-functions/src/shared.ts | 31 ++++---
.../frames-address-collision-5284.spec.tsx | 80 +++++++++++++++++++
.../dynamic-component-parity-inline.json | 2 +-
.../dynamic-component-parity-streamed.json | 2 +-
.../__artifacts__/frame-dependency-edges.json | 2 +-
.../frame-live-document-loaded.json | 4 +-
.../frame-live-document-streamed.json | 4 +-
.../frame-live-document-switched.json | 4 +-
.../frame-nested-fill-context.json | 2 +-
...e-nonlive-document-3666-inline-loaded.json | 2 +-
...nonlive-document-3666-streamed-loaded.json | 2 +-
...nlive-document-3666-streamed-streamed.json | 2 +-
.../frame-occlusion-document.json | 2 +-
.../multicall-hydration-3932.json | 2 +-
.../site-order-hydration-4042.json | 2 +-
16 files changed, 120 insertions(+), 28 deletions(-)
create mode 100644 .changeset/frame-address-collision.md
create mode 100644 packages/web/test/frames-address-collision-5284.spec.tsx
diff --git a/.changeset/frame-address-collision.md b/.changeset/frame-address-collision.md
new file mode 100644
index 0000000000..f4eaa8e04f
--- /dev/null
+++ b/.changeset/frame-address-collision.md
@@ -0,0 +1,5 @@
+---
+"@solidjs/web": patch
+---
+
+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.
diff --git a/packages/web/server-functions/src/shared.ts b/packages/web/server-functions/src/shared.ts
index 7359ba7793..a1c478597e 100644
--- a/packages/web/server-functions/src/shared.ts
+++ b/packages/web/server-functions/src/shared.ts
@@ -495,23 +495,27 @@ export function frameAddress(id, args) {
}
// A structural digest, stable across peers: key order is normalized so two
-// equal argument lists always agree, and anything the codec would have to
-// think about (class instances, cycles) degrades to its shape rather than
-// throwing. Collisions cost a mis-routed region, not correctness — an
-// unaddressed region simply finds no boundary.
+// equal argument lists always agree, and cycles degrade to a marker rather
+// than throwing. The client keys a call's content, binding and version by
+// this address, so two different argument lists must not share one
+// (#5284): the text is unambiguous (strings quoted, primitives
+// typed, a class instance tagged with its own string form) and the hash is
+// FNV-1a, which spreads short inputs (`"Aa"` and `"BB"` folded together
+// under the old `h * 31 + c`).
function hashArguments(args) {
- let hash = 0;
+ let hash = 0x811c9dc5;
const text = stableString(args);
- for (let i = 0; i < text.length; i++) {
- hash = (hash << 5) - hash + text.charCodeAt(i);
- hash |= 0;
- }
+ for (let i = 0; i < text.length; i++) hash = Math.imul(hash ^ text.charCodeAt(i), 16777619);
return (hash >>> 0).toString(36);
}
function stableString(value, seen) {
if (value === null || typeof value !== "object") {
- return typeof value === "bigint" ? value + "n" : String(value);
+ return typeof value === "string"
+ ? JSON.stringify(value)
+ : typeof value === "bigint"
+ ? value + "n"
+ : String(value);
}
// Realm-stable forms for the codec's rich argument types: `String(value)`
// for these is implementation-defined (a Date stringifies with the local
@@ -540,10 +544,13 @@ function stableString(value, seen) {
for (let i = 0; i < value.length; i++) out += (i ? "," : "") + stableString(value[i], seen);
return out + "]";
}
+ // A class instance (a `URL`, `URLSearchParams`, typed array) carries its
+ // state where `Object.keys` cannot see it: its own string form names it
+ // (a plain object's is the same constant for all of them).
+ let out = (typeof value.toString == "function" ? "" + value : "") + "{";
const keys = Object.keys(value).sort();
- let out = "{";
for (let i = 0; i < keys.length; i++) {
- out += (i ? "," : "") + keys[i] + ":" + stableString(value[keys[i]], seen);
+ out += (i ? "," : "") + JSON.stringify(keys[i]) + ":" + stableString(value[keys[i]], seen);
}
return out + "}";
} /**
diff --git a/packages/web/test/frames-address-collision-5284.spec.tsx b/packages/web/test/frames-address-collision-5284.spec.tsx
new file mode 100644
index 0000000000..c0ca9c3bed
--- /dev/null
+++ b/packages/web/test/frames-address-collision-5284.spec.tsx
@@ -0,0 +1,80 @@
+/**
+ * @jsxImportSource @solidjs/web
+ * @vitest-environment jsdom
+ *
+ * #5284: the client keys a server component call's content, binding and
+ * version by its frame address (`id` + a digest of the arguments). The
+ * digest's text was ambiguous (`1` and `"1"`, `["a,b"]` and `["a","b"]`,
+ * every `URL` / `URLSearchParams` as `{}`) and folded to 32 bits, so two
+ * calls with different arguments could share an address and one mount
+ * showed the other's markup.
+ */
+import { afterEach, expect, test, vi } from "vitest";
+import { createRoot, Loading } from "solid-js";
+import { dynamic } from "../src/index.js";
+import { installServerComponents } from "../frames/src/client.js";
+import { createServerReference } from "../server-functions/src/client.js";
+import { enableRichArguments } from "../server-functions/src/rich-args.js";
+import { frameAddress } from "../server-functions/src/shared.js";
+import { frameResponse, makeHost, pump } from "./lifecycle-matrix/harness.js";
+
+const ID = "panel";
+
+function mount(Comp: any) {
+ let div!: HTMLDivElement;
+ createRoot(() => {
+
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/dynamic-component-parity-streamed.json b/packages/web/test/harness/__artifacts__/dynamic-component-parity-streamed.json
index 6f8f8b142d..edea2b3183 100644
--- a/packages/web/test/harness/__artifacts__/dynamic-component-parity-streamed.json
+++ b/packages/web/test/harness/__artifacts__/dynamic-component-parity-streamed.json
@@ -1,5 +1,5 @@
{
"name": "dynamic-component-parity-streamed",
"shell": "
client
shell-fallback
",
- "rest": "
note v1
"
+ "rest": "
note v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-dependency-edges.json b/packages/web/test/harness/__artifacts__/frame-dependency-edges.json
index 3aea5f5149..aadccf0d58 100644
--- a/packages/web/test/harness/__artifacts__/frame-dependency-edges.json
+++ b/packages/web/test/harness/__artifacts__/frame-dependency-edges.json
@@ -1,5 +1,5 @@
{
"name": "frame-dependency-edges",
- "shell": "
",
+ "shell": "
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-live-document-loaded.json b/packages/web/test/harness/__artifacts__/frame-live-document-loaded.json
index 16b4f6ab11..8559945df0 100644
--- a/packages/web/test/harness/__artifacts__/frame-live-document-loaded.json
+++ b/packages/web/test/harness/__artifacts__/frame-live-document-loaded.json
@@ -1,5 +1,5 @@
{
"name": "frame-live-document-loaded",
- "shell": "
shell-fallback
",
- "rest": "
room v1
"
+ "shell": "
shell-fallback
",
+ "rest": "
room v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-live-document-streamed.json b/packages/web/test/harness/__artifacts__/frame-live-document-streamed.json
index f23488a919..10478872ed 100644
--- a/packages/web/test/harness/__artifacts__/frame-live-document-streamed.json
+++ b/packages/web/test/harness/__artifacts__/frame-live-document-streamed.json
@@ -1,5 +1,5 @@
{
"name": "frame-live-document-streamed",
- "shell": "
shell-fallback
",
- "rest": "
room v1
"
+ "shell": "
shell-fallback
",
+ "rest": "
room v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-live-document-switched.json b/packages/web/test/harness/__artifacts__/frame-live-document-switched.json
index a8ac8608f2..7a0d64c796 100644
--- a/packages/web/test/harness/__artifacts__/frame-live-document-switched.json
+++ b/packages/web/test/harness/__artifacts__/frame-live-document-switched.json
@@ -1,5 +1,5 @@
{
"name": "frame-live-document-switched",
- "shell": "
shell-fallback
",
- "rest": "
room v1
"
+ "shell": "
shell-fallback
",
+ "rest": "
room v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-nested-fill-context.json b/packages/web/test/harness/__artifacts__/frame-nested-fill-context.json
index 0459884a43..3dabcaf57c 100644
--- a/packages/web/test/harness/__artifacts__/frame-nested-fill-context.json
+++ b/packages/web/test/harness/__artifacts__/frame-nested-fill-context.json
@@ -1,5 +1,5 @@
{
"name": "frame-nested-fill-context",
- "shell": "
",
+ "shell": "
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-inline-loaded.json b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-inline-loaded.json
index 79f5c1bc48..f020f5bd9c 100644
--- a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-inline-loaded.json
+++ b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-inline-loaded.json
@@ -1,5 +1,5 @@
{
"name": "frame-nonlive-document-3666-inline-loaded",
- "shell": "
note v1
",
+ "shell": "
note v1
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-loaded.json b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-loaded.json
index 8ed43883dc..ab9a395f0a 100644
--- a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-loaded.json
+++ b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-loaded.json
@@ -1,5 +1,5 @@
{
"name": "frame-nonlive-document-3666-streamed-loaded",
"shell": "
shell-fallback
",
- "rest": "
note v1
"
+ "rest": "
note v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-streamed.json b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-streamed.json
index 076a48a41e..5c8771e556 100644
--- a/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-streamed.json
+++ b/packages/web/test/harness/__artifacts__/frame-nonlive-document-3666-streamed-streamed.json
@@ -1,5 +1,5 @@
{
"name": "frame-nonlive-document-3666-streamed-streamed",
"shell": "
shell-fallback
",
- "rest": "
note v1
"
+ "rest": "
note v1
"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/frame-occlusion-document.json b/packages/web/test/harness/__artifacts__/frame-occlusion-document.json
index 0f9f896ca9..418fe91d6a 100644
--- a/packages/web/test/harness/__artifacts__/frame-occlusion-document.json
+++ b/packages/web/test/harness/__artifacts__/frame-occlusion-document.json
@@ -1,5 +1,5 @@
{
"name": "frame-occlusion-document",
- "shell": "
Title alpha
Title bravo
Excerpt bravo
",
+ "shell": "
Title alpha
Title bravo
Excerpt bravo
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/multicall-hydration-3932.json b/packages/web/test/harness/__artifacts__/multicall-hydration-3932.json
index f9e61f8c10..878bc2bcb6 100644
--- a/packages/web/test/harness/__artifacts__/multicall-hydration-3932.json
+++ b/packages/web/test/harness/__artifacts__/multicall-hydration-3932.json
@@ -1,5 +1,5 @@
{
"name": "multicall-hydration-3932",
- "shell": "
one
two
three
",
+ "shell": "
one
two
three
",
"rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/site-order-hydration-4042.json b/packages/web/test/harness/__artifacts__/site-order-hydration-4042.json
index a02c9ed2f5..012aa9820d 100644
--- a/packages/web/test/harness/__artifacts__/site-order-hydration-4042.json
+++ b/packages/web/test/harness/__artifacts__/site-order-hydration-4042.json
@@ -1,5 +1,5 @@
{
"name": "site-order-hydration-4042",
- "shell": "
preview original
documentation
",
+ "shell": "
preview original
documentation
",
"rest": ""
}
\ No newline at end of file
From c818f9847902412e6c08f10d8d440bf975d54dc0 Mon Sep 17 00:00:00 2001
From: Claude
Date: Fri, 4 Dec 2026 08:21:33 +0000
Subject: [PATCH 08/15] chore(size): raise the frames page caps for the
frame-address digest (#5284)
Accepted by the maintainer 2026-12-04. Numbers from CI size head job
144913328286; recorded minified = measured, caps at measured + 10 B.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
scripts/size/floor-caps.json | 6 +++---
scripts/size/scenarios.js | 21 ++++++++++++++-------
2 files changed, 17 insertions(+), 10 deletions(-)
diff --git a/scripts/size/floor-caps.json b/scripts/size/floor-caps.json
index 9ca7aed2f9..39330cc659 100644
--- a/scripts/size/floor-caps.json
+++ b/scripts/size/floor-caps.json
@@ -12,12 +12,12 @@
"minified": 54093
},
"page: base server components (hydrating + dynamic + frames + sf reference)": {
- "cap": "34.31 KB",
- "minified": 102604
+ "cap": "34.36 KB",
+ "minified": 102661
},
"page: live server components (base + live/GET + action + isPending/latest)": {
"cap": "41.79 KB",
- "minified": 125464
+ "minified": 125521
},
"server: floor (getRequestEvent + isServer)": {
"cap": "1.33 KB",
diff --git a/scripts/size/scenarios.js b/scripts/size/scenarios.js
index 9ccf515ad9..1458941d46 100644
--- a/scripts/size/scenarios.js
+++ b/scripts/size/scenarios.js
@@ -5064,8 +5064,9 @@ module.exports = [
// Re-recorded on next @ 7ad2342c (2026-10-19, accepted by the maintainer): recorded minified 34,852 -> 34,886 B, measured locally (linux) at 11,754 B brotli. #4154 recorded its sizes one commit before its final head, so next sat 34 B or more over the recorded minified and brotli noise failed unrelated PRs. Cap unchanged.
// Batch re-record (2026-10-29, over next @ 3b7ea81c): 11.76 -> 11.77 KB, recorded minified 34,886 -> 34,886 B (+0 B), measured in CI at 11,754 B brotli. Growth is the 2026-10-29 bug-fix batch (#4401, #4397, #4383, #4393, #4406); the maintainer asked for one re-record on next after it (2026-10-29). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-11-13 (the frames client parses server HTML through the app's Trusted Types policy, over next @ f00ce6f52, measured locally): 11.77 KB -> 11.80 KB, recorded minified 34,886 -> 34,948 B (+62 B), measured at 11,784 B brotli. `parseFragment` assigns what an installed wrap returns (frame-client.ts `setTrustedHTML`), and the client entry installs `trustedHTML` from `@solidjs/web`, which is the policy `setTrustedTypesPolicy` set. Every page scenario carries the same wiring (+62 to +76 B minified); the frozen floors stay under their caps and the compiled live page is re-recorded with this; a compiled page with no server components is unchanged (0 B). Cap at measured + 10 B rounded up to 0.01 KB.
- limit: "11.80 KB",
- capMinified: 34948,
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): 11.80 KB -> 11.82 KB, recorded minified 34,948 -> 35,078 B, measured at 11,809 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ limit: "11.82 KB",
+ capMinified: 35078,
alias: framesAlias,
external: framesExternal
},
@@ -5495,6 +5496,7 @@ module.exports = [
// 2026-11-26 (re-record on main @ 50a4bfd, CI size job 139854329831 on #5218 (71c1e57), whose tree is main @ 50a4bfd; growth from #4906 (thin store engine), #5209 (prod effect cleanup check) and #5218 (re-park drops a disposed source)): frozen floor 34.21 KB -> 34.24 KB, recorded minified 102,359 -> 102,403 B, measured at 34,225 B brotli. Frozen floor in floor-caps.json, Size-Exception in the PR body. Accepted by the maintainer (2026-11-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 34.24 KB -> 34.25 KB, recorded minified 102,403 -> 102,498 B (+57 B minified over base, the parent walk in `keeps()`), measured at 34,239 B brotli. A frozen floor, Size-Exception in this PR. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): frozen floor 34.25 KB -> 34.31 KB, recorded minified 102,498 -> 102,604 B, measured at 34,295 B brotli (Size-Exception). Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): frozen floor 34.31 KB -> 34.36 KB, recorded minified 102,604 -> 102,661 B, measured at 34,343 B brotli. Size-Exception in this PR. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
limit: floorCaps["page: base server components (hydrating + dynamic + frames + sf reference)"],
capMinified:
floorMinified["page: base server components (hydrating + dynamic + frames + sf reference)"],
@@ -5896,6 +5898,7 @@ module.exports = [
// 2026-11-26 (re-record on main @ 50a4bfd, CI size job 139854329831 on #5218 (71c1e57), whose tree is main @ 50a4bfd; growth from #4906 (thin store engine), #5209 (prod effect cleanup check) and #5218 (re-park drops a disposed source)): frozen floor 41.66 KB -> 41.68 KB, recorded minified 125,175 -> 125,252 B, measured at 41,668 B brotli. Frozen floor in floor-caps.json, Size-Exception in the PR body. Accepted by the maintainer (2026-11-26). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 41.68 KB -> 41.68 KB, recorded minified 125,252 -> 125,358 B (+57 B minified over base, the parent walk in `keeps()`), measured at 41,647 B brotli. A frozen floor, Size-Exception in this PR. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): frozen floor 41.68 KB -> 41.79 KB, recorded minified 125,358 -> 125,464 B, measured at 41,779 B brotli (Size-Exception). Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): frozen floor cap unchanged at 41.79 KB, recorded minified 125,464 -> 125,521 B, measured at 41,724 B brotli. Size-Exception in this PR. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
limit: floorCaps["page: live server components (base + live/GET + action + isPending/latest)"],
capMinified:
floorMinified["page: live server components (base + live/GET + action + isPending/latest)"],
@@ -6081,8 +6084,9 @@ module.exports = [
// 2026-11-27 (re-record on main @ f7b6b9c, CI size job 140452073488 on #5241 (94568d1), whose tree is main @ f7b6b9c plus a test-only change; growth from #5221, #5225, #5228, #5235 and #5236 (all merged 2026-11-27)): 36.17 KB -> 36.25 KB, recorded minified 108,562 -> 108,644 B, measured at 36,240 B brotli. Accepted by the maintainer (merges approved 2026-11-27). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 36.25 KB -> 36.25 KB, recorded minified 108,644 -> 108,691 B (+57 B minified over base, the parent walk in `keeps()`), measured at 36,215 B brotli. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): 36.25 KB -> 36.27 KB, recorded minified 108,691 -> 108,797 B, measured at 36,256 B brotli. Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
- limit: "36.27 KB",
- capMinified: 108797,
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): 36.27 KB -> 36.29 KB, recorded minified 108,797 -> 108,885 B, measured at 36,275 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ limit: "36.29 KB",
+ capMinified: 108885,
alias: pageAlias
},
{
@@ -6290,11 +6294,12 @@ module.exports = [
// 2026-11-26 (re-record on main @ 5420b4a, after the 11-24 fix batch and 2.0.4): measured 45,853 B brotli / 133,520 B minified (was over its cap with the minified allowance nearly spent). Cap at measured + 10 B; recorded minified reset to the measure.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 45.87 KB -> 45.91 KB, recorded minified 133,520 -> 133,760 B (+57 B minified over base, the parent walk in `keeps()`), measured at 45,891 B brotli. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): 45.91 KB -> 45.96 KB, recorded minified 133,760 -> 133,866 B, measured at 45,946 B brotli. Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): cap unchanged at 45.96 KB, recorded minified 133,866 -> 133,954 B, measured at 45,944 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
limit: "45.96 KB",
// An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 123,191 -> 123,249 B (+58 B minified over next's record), measured locally (linux) at 41,899 B brotli. Recorded minified = measured; CI re-bases.
// Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 123,203 -> 123,224 B (+21 B minified over next's record), measured locally (linux) at 41,966 B brotli. Recorded minified = measured; CI re-bases.
// latest() read inline and through a memo show the same screen (#4284 through a memo; a plain write beside an async memo), 2026-10-29, over next @ 7ebd4a32: recorded minified 123,224 -> 123,733 B (+403 B minified over next), measured locally (linux) at 42,119 B brotli (+169 B over next). A render effect a verdict memo's change re-runs reads as its verdict reader for that pass (`laneDirty`), a pass that read a staging before the frame had a transaction re-derives once as a verdict reader only if the frame parks, `latest()` of a first load in flight in a verdict lane is loading (also through an identity memo, a derived store and `isPending`), a lane's dissolution leaves such a load and the nodes pending on it uninitialized instead of committing `undefined`, a verdict lane born at a seam is judged at it, a pass born in a staged reader stays the frame's on a verdict-memo read (C4, #4010), a plain write beside `latest()` computes once (the seam re-derives a pre-transaction staged reader only if the frame parks), a verdict reader's plain read of a staging in a transaction only a `latest()` opened is the frame's read, so a memo of `latest()` computes once too (D-22; not a pass with no value yet, D-6), and an error stays the display while the memo it came through re-asks, a Loading fallback behind it included (D-39, async-gen 91501 #1831). recompute's CONFIG_VERDICT clear now sits behind the lane engine: -21 B minified on every floor. Correctness; the maintainer: "only flag me if brotli goes more than 20kb" (2026-10-29). Cap unchanged; recorded minified = measured.
- capMinified: 133866,
+ capMinified: 133954,
alias: pageAlias
},
{
@@ -6525,8 +6530,9 @@ module.exports = [
// 2026-11-27 (re-record on main @ f7b6b9c, CI size job 140452073488 on #5241 (94568d1), whose tree is main @ f7b6b9c plus a test-only change; growth from #5221, #5225, #5228, #5235 and #5236 (all merged 2026-11-27)): 41.75 KB -> 41.78 KB, recorded minified 126,354 -> 126,488 B, measured at 41,762 B brotli. Accepted by the maintainer (merges approved 2026-11-27). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 41.78 KB -> 41.80 KB, recorded minified 126,488 -> 126,535 B (+57 B minified over base, the parent walk in `keeps()`), measured at 41,783 B brotli. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): 41.80 KB -> 41.84 KB, recorded minified 126,535 -> 126,641 B, measured at 41,821 B brotli. Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): cap unchanged at 41.84 KB, recorded minified 126,641 -> 126,698 B, measured at 41,828 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
limit: "41.84 KB",
- capMinified: 126641,
+ capMinified: 126698,
alias: pageAlias,
conditions: solidConditions,
compile: { hydratable: true }
@@ -6779,12 +6785,13 @@ module.exports = [
// 2026-11-27 (re-record on main @ f7b6b9c, CI size job 140452073488 on #5241 (94568d1), whose tree is main @ f7b6b9c plus a test-only change; growth from #5221, #5225, #5228, #5235 and #5236 (all merged 2026-11-27)): 51.52 KB -> 51.63 KB, recorded minified 151,135 -> 151,366 B, measured at 51,612 B brotli. Accepted by the maintainer (merges approved 2026-11-27). Cap at measured + 10 B rounded up to 0.01 KB; recorded minified = measured.
// Nested Errored release (#5269, 2026-12-02, over main @ a88836f, measured locally with the CI gate): 51.63 KB -> 51.64 KB, recorded minified 151,366 -> 151,413 B (+57 B minified over base, the parent walk in `keeps()`), measured at 51,626 B brotli. Accepted by the maintainer (2026-12-02, "Fine raise cap"; three trims measured, none smaller). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
// 2026-12-02 (#5177: a GET server function throws a clear error when its codec arguments encode to multipart (a file among them), and its long-argument POST fallback sends the encoding it already made instead of encoding the arguments again; +106 B minified on every server-function page; re-recorded over main @ 9f7d51d, measured locally with the CI gate): 51.64 KB -> 51.69 KB, recorded minified 151,413 -> 151,519 B, measured at 51,671 B brotli. Accepted by the maintainer (2026-12-02, "as is and we can revisit"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
+ // 2026-12-04 (#5319 for #5284: the frame-address argument digest quotes strings and keys, names a class instance by its own string form, and folds with FNV-1a, so different arguments no longer share an address; +110 B minified on every page with the frames client; CI size head job 144913328286 on 4a37e13, over main @ 6e6963b): cap unchanged at 51.69 KB, recorded minified 151,519 -> 151,576 B, measured at 51,646 B brotli. Accepted by the maintainer (2026-12-04, decision card "Accept and raise the cap"). Cap at measured + 10 B rounded up to 0.01 KB, never lowered; recorded minified = measured.
limit: "51.69 KB",
// An Errored heals when the last reader that caught its error is disposed (#4373, #4384, 2026-10-28, re-recorded over next @ cbc0eebd): recorded minified 140,451 -> 140,509 B (+58 B minified over next's record), measured locally (linux) at 47,516 B brotli. Recorded minified = measured; CI re-bases.
// Boundary readers keyed by the source they wait on (#4373), with enterLane's tail folded into one else-chain as an offset (-29 B on lane pages) (#4384, 2026-10-28, re-recorded over next @ 1b32ff2e): recorded minified 140,463 -> 140,485 B (+22 B minified over next's record), measured locally (linux) at 47,547 B brotli. Recorded minified = measured; CI re-bases.
// latest() read inline and through a memo show the same screen (#4284 through a memo; a plain write beside an async memo), 2026-10-29, over next @ 7ebd4a32: recorded minified 140,485 -> 140,983 B (+405 B minified over next), measured locally (linux) at 47,722 B brotli (+162 B over next). A render effect a verdict memo's change re-runs reads as its verdict reader for that pass (`laneDirty`), a pass that read a staging before the frame had a transaction re-derives once as a verdict reader only if the frame parks, `latest()` of a first load in flight in a verdict lane is loading (also through an identity memo, a derived store and `isPending`), a lane's dissolution leaves such a load and the nodes pending on it uninitialized instead of committing `undefined`, a verdict lane born at a seam is judged at it, a pass born in a staged reader stays the frame's on a verdict-memo read (C4, #4010), a plain write beside `latest()` computes once (the seam re-derives a pre-transaction staged reader only if the frame parks), a verdict reader's plain read of a staging in a transaction only a `latest()` opened is the frame's read, so a memo of `latest()` computes once too (D-22; not a pass with no value yet, D-6), and an error stays the display while the memo it came through re-asks, a Loading fallback behind it included (D-39, async-gen 91501 #1831). recompute's CONFIG_VERDICT clear now sits behind the lane engine: -21 B minified on every floor. Correctness; the maintainer: "only flag me if brotli goes more than 20kb" (2026-10-29). Cap unchanged; recorded minified = measured.
// 2026-11-19 (#5055: markRaw accepts a class; CI size head job 135428351139 on 8d9bf2b, over main @ 7f86b2d): recorded minified 150,907 -> 150,927 B, measured 51,339 B brotli; cap unchanged. Recorded minified = measured.
- capMinified: 151519,
+ capMinified: 151576,
alias: pageAlias,
conditions: solidConditions,
compile: { hydratable: true }
From 326859bfeec6e3a31bca9165eb42e14298b77247 Mon Sep 17 00:00:00 2001
From: Claude
Date: Fri, 4 Dec 2026 10:52:29 +0000
Subject: [PATCH 09/15] fix(web): keep the Loading fallback when a post-shell
failure has no server outcome (#5223)
A failing after the shell with no server answering at
its position used to swap in an empty template, blanking the fallback until
the client hydrated (and forever without JS). The document sink now swaps
nothing in and only drops the pl-* markers; the fallback stays until the
client renders the failure over it.
Co-Authored-By: Claude Opus 5.5
Claude-Session: https://claude.ai/code/session_0117BoWPLP5ZgG1wSyxASVwK
---
.changeset/keep-loading-fallback-5223.md | 5 ++
packages/solid/src/client/hydration.ts | 7 +-
packages/web/src/server.ts | 18 +++--
.../abandoned-sibling-computes.json | 2 +-
...element-4242-issue-streamed-reference.json | 2 +-
...sync-memo-element-4242-issue-streamed.json | 2 +-
...o-element-4242-jsx-streamed-reference.json | 2 +-
.../async-memo-element-4242-jsx-streamed.json | 2 +-
.../__artifacts__/bare-client-late-final.json | 2 +-
...ored-fallback-hole-async-failure-4316.json | 2 +-
...llback-hole-async-failure-parked-4316.json | 2 +-
...rored-fallback-hole-sync-failure-4316.json | 2 +-
...allback-hole-sync-failure-parked-4316.json | 2 +-
.../errored-outside-loading-4372-text.json | 2 +-
...tion-loading-postflush-rejection-4287.json | 2 +-
.../nested-rejection-no-outcome.json | 2 +-
.../parked-fragment-failure-inner-4316.json | 2 +-
...ed-fragment-failure-inner-A-late-4316.json | 2 +-
.../parked-fragment-failure-inner-B-4316.json | 2 +-
...rked-fragment-failure-inner-late-4316.json | 2 +-
.../parked-fragment-failure-twin-4316.json | 2 +-
.../parked-fragment-failure-twin-B-4316.json | 2 +-
.../rejected-fragment-client-only.json | 2 +-
.../rejected-fragment-dynamic.json | 2 +-
.../__artifacts__/rejected-fragment-for.json | 2 +-
.../rejected-fragment-nested-loading.json | 2 +-
.../rejected-fragment-nohydration.json | 2 +-
.../rejected-fragment-portal.json | 2 +-
.../rejected-fragment-stylesheet.json | 2 +-
packages/web/test/harness/scenarios.tsx | 7 +-
.../async-memo-element-4242.spec.tsx | 11 ++-
.../errored-fallback-wait-4317.spec.tsx | 7 +-
.../errored-nested-postflush-5223.spec.tsx | 68 +++++++++++++++++++
.../frame-fragment-error-outcome.spec.tsx | 9 +--
.../test/server/hydration-harness.spec.tsx | 12 ++--
.../parked-fragment-failure-4316.spec.tsx | 9 ++-
36 files changed, 151 insertions(+), 54 deletions(-)
create mode 100644 .changeset/keep-loading-fallback-5223.md
create mode 100644 packages/web/test/server/errored-nested-postflush-5223.spec.tsx
diff --git a/.changeset/keep-loading-fallback-5223.md b/.changeset/keep-loading-fallback-5223.md
new file mode 100644
index 0000000000..3de8ec822a
--- /dev/null
+++ b/.changeset/keep-loading-fallback-5223.md
@@ -0,0 +1,5 @@
+---
+"@solidjs/web": patch
+---
+
+Keep a `` fallback on the page when its content fails after the shell is sent and no server `` drew a fallback at that position (for example `…`). The server used to swap in a blank there until the client hydrated. Now the fallback stays until the client renders the `` fallback over it.
diff --git a/packages/solid/src/client/hydration.ts b/packages/solid/src/client/hydration.ts
index e1a81f7f59..a4c20e291f 100644
--- a/packages/solid/src/client/hydration.ts
+++ b/packages/solid/src/client/hydration.ts
@@ -3062,9 +3062,10 @@ function hydratedCreateLoadingBoundary(
if (s === 1 || s === 2) {
if (s === 2) {
- // Rejected stream fragments swap to an empty template (or, under a
- // hydrated ``, the fallback it claims — above); any outer
- // error fallback here is created as fresh client DOM.
+ // Rejected stream fragments with no server outcome swap nothing
+ // in: the fallback stays (#5223) (under a hydrated ``,
+ // the fallback it claims — above); any outer error fallback here
+ // is created as fresh client DOM.
// Observe: the fresh render is a "recovery" record; prod folds the
// branch and `recover` with it.
waitAndResume(
diff --git a/packages/web/src/server.ts b/packages/web/src/server.ts
index fcc02088e8..05f08644d1 100644
--- a/packages/web/src/server.ts
+++ b/packages/web/src/server.ts
@@ -2571,6 +2571,15 @@ export function renderToStream(code, options = {}) {
// A rejected fragment's template is marked: its swap lists the nodes
// it inserts in the reveal record (`_$HY.v`), for a client boundary
// that renders the failure fresh to clear first (#4287).
+ // A failure the server drew no outcome for (no server ``
+ // answered at this position) has nothing to swap in: the fallback
+ // stays until the hydrating client renders the failure over it,
+ // rather than a blank in its place (#5223). Only the `pl-*` markers
+ // go, as a swap would take them: nothing will land between them.
+ if (meta.blank)
+ return pushTask(
+ `(e=>{let o=document.getElementById(e),n=o;for(;n&&(8!==n.nodeType||n.nodeValue!==e);)n=n.nextSibling;n&&n.remove(),o&&o.remove()})("pl-${key}")`
+ );
const tpl = `${value}`;
for (let i = 0; i < styles.inline.length; i++) {
buffer.write(renderInlineStyle(styles.inline[i], nonce));
@@ -3320,13 +3329,14 @@ export function renderToStream(code, options = {}) {
// error path `value` is what the boundary rendered for the
// outcome — a server 's fallback or the boundary's own
// markup inside a server component (frames-rulings 3.3) — and
- // nothing outside one, where the client twin renders fresh over
- // the blank: an empty template, so what its swap lists is the
- // outcome alone (the client reads a listed outcome as the
- // server's answer for the failure, #4287).
+ // nothing outside one (`blank`): the document keeps the
+ // boundary's fallback and the client twin renders the failure
+ // fresh over it (#5223). A listed outcome is the server's
+ // answer for the failure (#4287).
sink.fragment(key, value !== undefined ? value : error ? "" : " ", {
styles,
revealGroup,
+ blank: error && value === undefined,
error: error
? ssrSanitizeError(error, null, undefined, undefined, errorScope)
: error
diff --git a/packages/web/test/harness/__artifacts__/abandoned-sibling-computes.json b/packages/web/test/harness/__artifacts__/abandoned-sibling-computes.json
index d2900804b4..c8429aea5e 100644
--- a/packages/web/test/harness/__artifacts__/abandoned-sibling-computes.json
+++ b/packages/web/test/harness/__artifacts__/abandoned-sibling-computes.json
@@ -1,5 +1,5 @@
{
"name": "abandoned-sibling-computes",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed-reference.json b/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed-reference.json
index 0543d7ef56..259842be58 100644
--- a/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed-reference.json
+++ b/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed-reference.json
@@ -1,5 +1,5 @@
{
"name": "async-memo-element-4242-issue-streamed-reference",
"shell": "outer",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed.json b/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed.json
index 9549bf4a92..d33697ca0a 100644
--- a/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed.json
+++ b/packages/web/test/harness/__artifacts__/async-memo-element-4242-issue-streamed.json
@@ -1,5 +1,5 @@
{
"name": "async-memo-element-4242-issue-streamed",
"shell": "outer",
- "rest": "nested-41"
+ "rest": "nested-41"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed-reference.json b/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed-reference.json
index 3a9f601dfc..87bfa6c8c8 100644
--- a/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed-reference.json
+++ b/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed-reference.json
@@ -1,5 +1,5 @@
{
"name": "async-memo-element-4242-jsx-streamed-reference",
"shell": "outer",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed.json b/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed.json
index eecb99e11f..6917bcb57d 100644
--- a/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed.json
+++ b/packages/web/test/harness/__artifacts__/async-memo-element-4242-jsx-streamed.json
@@ -1,5 +1,5 @@
{
"name": "async-memo-element-4242-jsx-streamed",
"shell": "outer",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/bare-client-late-final.json b/packages/web/test/harness/__artifacts__/bare-client-late-final.json
index 008beb7c79..ff9bed420f 100644
--- a/packages/web/test/harness/__artifacts__/bare-client-late-final.json
+++ b/packages/web/test/harness/__artifacts__/bare-client-late-final.json
@@ -1,5 +1,5 @@
{
"name": "bare-client-late-final",
"shell": "
wait
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-4316.json b/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-4316.json
index a0d33d37c6..9db3d1a393 100644
--- a/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-4316.json
+++ b/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-4316.json
@@ -1,5 +1,5 @@
{
"name": "errored-fallback-hole-async-failure-4316",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-parked-4316.json b/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-parked-4316.json
index 19d23f6b3d..84ab1e1494 100644
--- a/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-parked-4316.json
+++ b/packages/web/test/harness/__artifacts__/errored-fallback-hole-async-failure-parked-4316.json
@@ -1,5 +1,5 @@
{
"name": "errored-fallback-hole-async-failure-parked-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-4316.json b/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-4316.json
index a2dd76cf95..11ff04c979 100644
--- a/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-4316.json
+++ b/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-4316.json
@@ -1,5 +1,5 @@
{
"name": "errored-fallback-hole-sync-failure-4316",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-parked-4316.json b/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-parked-4316.json
index 6f2987ba89..867cef10da 100644
--- a/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-parked-4316.json
+++ b/packages/web/test/harness/__artifacts__/errored-fallback-hole-sync-failure-parked-4316.json
@@ -1,5 +1,5 @@
{
"name": "errored-fallback-hole-sync-failure-parked-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-outside-loading-4372-text.json b/packages/web/test/harness/__artifacts__/errored-outside-loading-4372-text.json
index e77fff9b51..99f5496556 100644
--- a/packages/web/test/harness/__artifacts__/errored-outside-loading-4372-text.json
+++ b/packages/web/test/harness/__artifacts__/errored-outside-loading-4372-text.json
@@ -1,5 +1,5 @@
{
"name": "errored-outside-loading-4372-text",
"shell": "[LOAD]",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/errored-section-loading-postflush-rejection-4287.json b/packages/web/test/harness/__artifacts__/errored-section-loading-postflush-rejection-4287.json
index 2afd458694..da69c1e9c4 100644
--- a/packages/web/test/harness/__artifacts__/errored-section-loading-postflush-rejection-4287.json
+++ b/packages/web/test/harness/__artifacts__/errored-section-loading-postflush-rejection-4287.json
@@ -1,5 +1,5 @@
{
"name": "errored-section-loading-postflush-rejection-4287",
"shell": "
title
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/nested-rejection-no-outcome.json b/packages/web/test/harness/__artifacts__/nested-rejection-no-outcome.json
index 319a99a24e..6d3c77c808 100644
--- a/packages/web/test/harness/__artifacts__/nested-rejection-no-outcome.json
+++ b/packages/web/test/harness/__artifacts__/nested-rejection-no-outcome.json
@@ -1,5 +1,5 @@
{
"name": "nested-rejection-no-outcome",
"shell": "
outer loadingtail
",
- "rest": "ainner loading"
+ "rest": "ainner loading"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-4316.json
index 1e9e033bf8..2689b2dbea 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-inner-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-A-late-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-A-late-4316.json
index 490c074291..e206b31aba 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-A-late-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-A-late-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-inner-A-late-4316",
"shell": "
outer loadingtail
",
- "rest": "outerloading"
+ "rest": "outerloading"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-B-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-B-4316.json
index 9f4aa9aaa8..cd8420efc4 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-B-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-B-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-inner-B-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-late-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-late-4316.json
index 43bcb1c5f8..c1353fb2bc 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-late-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-inner-late-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-inner-late-4316",
"shell": "
outer loadingtail
",
- "rest": "outerloading"
+ "rest": "outerloading"
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-4316.json
index 3c27d7b1b9..4358159580 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-twin-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-B-4316.json b/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-B-4316.json
index 1de6eae62b..0d9230ea71 100644
--- a/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-B-4316.json
+++ b/packages/web/test/harness/__artifacts__/parked-fragment-failure-twin-B-4316.json
@@ -1,5 +1,5 @@
{
"name": "parked-fragment-failure-twin-B-4316",
"shell": "
outer loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-client-only.json b/packages/web/test/harness/__artifacts__/rejected-fragment-client-only.json
index d32207ef6b..89e0f9f809 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-client-only.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-client-only.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-client-only",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-dynamic.json b/packages/web/test/harness/__artifacts__/rejected-fragment-dynamic.json
index bb7885ce05..fac837a81b 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-dynamic.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-dynamic.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-dynamic",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-for.json b/packages/web/test/harness/__artifacts__/rejected-fragment-for.json
index e5f6eed60a..a59502333a 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-for.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-for.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-for",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-nested-loading.json b/packages/web/test/harness/__artifacts__/rejected-fragment-nested-loading.json
index 4eab1b54aa..c4dfdb5882 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-nested-loading.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-nested-loading.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-nested-loading",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-nohydration.json b/packages/web/test/harness/__artifacts__/rejected-fragment-nohydration.json
index 89b5235ecb..6ae7a0cfae 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-nohydration.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-nohydration.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-nohydration",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-portal.json b/packages/web/test/harness/__artifacts__/rejected-fragment-portal.json
index bf0b627302..4a4d03499e 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-portal.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-portal.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-portal",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/__artifacts__/rejected-fragment-stylesheet.json b/packages/web/test/harness/__artifacts__/rejected-fragment-stylesheet.json
index 77a9f5f35e..e7fb1f8bf1 100644
--- a/packages/web/test/harness/__artifacts__/rejected-fragment-stylesheet.json
+++ b/packages/web/test/harness/__artifacts__/rejected-fragment-stylesheet.json
@@ -1,5 +1,5 @@
{
"name": "rejected-fragment-stylesheet",
"shell": "
loadingtail
",
- "rest": ""
+ "rest": ""
}
\ No newline at end of file
diff --git a/packages/web/test/harness/scenarios.tsx b/packages/web/test/harness/scenarios.tsx
index a6a870bb53..8422571008 100644
--- a/packages/web/test/harness/scenarios.tsx
+++ b/packages/web/test/harness/scenarios.tsx
@@ -1587,9 +1587,10 @@ function PostflushRejectionAsyncFallback() {
// The same failure with markup between the Errored and the Loading: the
// Loading's position is not the Errored's, and after the shell the
-// Errored's markup is already out, so the server draws nothing there (the
-// client twin's fallback replaces the whole ) and the client
-// renders the failure fresh, then recovers. (Before the shell it draws a
+// Errored's markup is already out, so the server swaps nothing in there:
+// the Loading fallback stays (#5223) until the client renders the failure
+// fresh (the client twin's fallback replaces the whole ), then
+// recovers. (Before the shell it draws a
// fallback ready as it renders in the shell: `preflushNested` below.)
let setNestedKey!: (v: string) => void;
function PostflushRejectionNested() {
diff --git a/packages/web/test/hydration/async-memo-element-4242.spec.tsx b/packages/web/test/hydration/async-memo-element-4242.spec.tsx
index 4e53cc3d74..c346c0e7a4 100644
--- a/packages/web/test/hydration/async-memo-element-4242.spec.tsx
+++ b/packages/web/test/hydration/async-memo-element-4242.spec.tsx
@@ -215,7 +215,8 @@ describe("async memo resolving to rendered output (#4242) — hydration", () =>
// asked for again (hydration never refetches). Nothing on the client
// catches it (a does not), so it is an uncaught error, as
// on any client render: the reactive system halts, the element
- // never renders (no counter to click). The boundary has resumed all
+ // never renders (no counter to click) and the Loading fallback
+ // stays. The boundary has resumed all
// the same, so hydration completes. Recovery is a real input change
// or a reset() of a client boundary, as for any hydrated failure
// (#4273).
@@ -228,9 +229,13 @@ describe("async memo resolving to rendered output (#4242) — hydration", () =>
expect(o.runs).toEqual(variant.shape === "jsx" ? [] : ["inner"]);
expect(o.halted).toBe(true);
expect(o.done).toBe(true);
- expect(o.text).toBe("");
+ // Streamed, the server swapped nothing in for the failure
+ // (#5223): the fallback stays, as on a client render the uncaught
+ // error halts.
+ const kept = variant.timing === "streamed";
+ expect(o.text).toBe(kept ? "outer" : "");
expect(o.afterClick).toBe(undefined);
- expect(o.shown).toEqual(mode === "streamed" ? ["outer", ""] : [""]);
+ expect(o.shown).toEqual(kept ? ["outer"] : mode === "streamed" ? ["outer", ""] : [""]);
}
});
}
diff --git a/packages/web/test/server/errored-fallback-wait-4317.spec.tsx b/packages/web/test/server/errored-fallback-wait-4317.spec.tsx
index 4fbb5007a7..ea11147eb3 100644
--- a/packages/web/test/server/errored-fallback-wait-4317.spec.tsx
+++ b/packages/web/test/server/errored-fallback-wait-4317.spec.tsx
@@ -68,9 +68,10 @@ describe("#4317: the wait for an Errored fallback's async holes", () => {
// The discovery render plus one per budgeted pass, never more.
expect(asks).toBe(MAX_RESUME_PASSES + 1);
const html = chunks.join("");
- // No finished fallback: the fragment rejects with nothing drawn, and no
- // error record claims a fallback that was never sent.
- expect(html).toMatch(/<\/template>/);
+ // No finished fallback: the fragment rejects with nothing drawn (no
+ // swap, the Loading fallback stays, #5223), and no error record claims
+ // a fallback that was never sent.
+ expect(html).not.toMatch(//);
expect(html).not.toContain("failed:");
expect(html).toContain('new Error("no user 7")');
}, 20000);
diff --git a/packages/web/test/server/errored-nested-postflush-5223.spec.tsx b/packages/web/test/server/errored-nested-postflush-5223.spec.tsx
new file mode 100644
index 0000000000..dc6795b961
--- /dev/null
+++ b/packages/web/test/server/errored-nested-postflush-5223.spec.tsx
@@ -0,0 +1,68 @@
+/**
+ * @jsxImportSource @solidjs/web
+ *
+ * #5223: an `` whose content is more than the `` that
+ * fails, the failure landing after the shell is out. The server has no
+ * outcome to draw at the ``'s position (the Errored's markup is
+ * already sent), so it swaps nothing in: the `` fallback stays
+ * until the hydrating client renders the Errored fallback over it, instead
+ * of a blank in its place. Only the `pl-*` markers go, as a swap would take
+ * them. The hydration side is the harness scenario
+ * `errored-section-loading-postflush-rejection-4287`.
+ */
+import { describe, expect, test } from "vitest";
+import { createMemo, Errored, Loading } from "solid-js";
+import { recordStream } from "./artifact-recorder.js";
+
+const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
+const strip = (html: string) => html.replace(/