Skip to content

Commit e1beea1

Browse files
committed
test(web): occlusion spec makes the regions tier resident before hydrate
The spec predates #3860, which moved `{$frame}` slot regions into the lazily loaded regions tier: a record naming a region waits for the tier, so the slot fills never mounted and expanding item a rendered nothing. Load it before hydrate (as welcome-status-parity does for trace), assert the document announces it, and re-record the artifact, which predated the announcement. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017PDt8Jv6uf5xRDsrux4UwF
1 parent 98182cf commit e1beea1

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "frame-occlusion-document",
3-
"shell": "<main _hk=1><solid-frame data-fid=\"frame-occlusion-doc/list\" style=\"display:contents\"><ul id=\"list\"><li><!--slot:item#a:start--><div _hk=sc-frame-occlusion-doc/list-item#a-0 class=\"item\" id=\"item-a\"><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#a.children\" style=\"display:contents\"><strong class=\"title\"><!--lh:1-->Title alpha<!--lh:/1--></strong></solid-frame><!--/--><button id=\"toggle-a\">toggle</button><!--$--><!--/--></div><!--slot:item#a:end--></li><li><!--slot:item#b:start--><div _hk=sc-frame-occlusion-doc/list-item#b-0 class=\"item\" id=\"item-b\"><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#b.children\" style=\"display:contents\"><strong class=\"title\"><!--lh:3-->Title bravo<!--lh:/3--></strong></solid-frame><!--/--><button id=\"toggle-b\">toggle</button><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#b.expandedChildren\" style=\"display:contents\"><p class=\"excerpt\"><!--lh:2-->Excerpt bravo<!--lh:/2--></p></solid-frame><!--/--></div><!--slot:item#b:end--></li></ul></solid-frame></main><script>(self.$R=self.$R||{})[\"\"]=[];_$HY.r[\"$B\"]=($R[0]={2000:$R[1]=($R[2]=($R[3]=() => {\n\tconst resolver = {\n\t\tp: 0,\n\t\ts: 0,\n\t\tf: 0\n\t};\n\tresolver.p = new Promise((resolve, reject) => {\n\t\tresolver.s = resolve;\n\t\tresolver.f = reject;\n\t});\n\treturn resolver;\n})()).p,\"2_fr\":$R[4]=($R[5]=$R[3]()).p});(b=>{for(var k in b)_$HY.r[k]=b[k];delete _$HY.r[\"$B\"]})(_$HY.r[\"$B\"]);($R[7]=(resolver, data) => {\n\tresolver.s(data);\n\tresolver.p.s = 1;\n\tresolver.p.v = data;\n})($R[2],$R[6]=(self._$SC||(self._$SC={c:{},a:{},b:{},r(i,a){var c=this.c[i]||(this.c[i]=(p,b)=>self._$SC.impl(i,p,b));if(!a)return c;this.a[a]=i;this.reg&&this.reg(a,i);return this.b[a]||(this.b[a]=Object.assign(p=>c(p,()=>a),{[Symbol.for(\"solid.component-binding\")]:{component:c,address:a}}))}})).r(\"frame-occlusion-doc/list\",\"frame-occlusion-doc/list:18sevpg\"));_$HY.r[\"sc:live\"]=$R[8]=($R[9]=(stream) => new ReadableStream({ start(controller) {\n\tstream.on({\n\t\tnext(value) {\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(value);\n\t\t\t} catch (_error) {}\n\t\t},\n\t\tthrow(value) {\n\t\t\tcontroller.error(value);\n\t\t},\n\t\treturn() {\n\t\t\ttry {\n\t\t\t\tcontroller.close();\n\t\t\t} catch (_error) {}\n\t\t}\n\t});\n} }))($R[10]=($R[11]=() => {\n\tconst buffer = [];\n\tconst listeners = [];\n\tlet alive = true;\n\tlet success = false;\n\tlet count = 0;\n\tconst internal = {\n\t\tflush(value, mode, x) {\n\t\t\tfor (x = 0; x < count; x++) {\n\t\t\t\tconst listener = listeners[x];\n\t\t\t\tif (listener) listener[mode](value);\n\t\t\t}\n\t\t},\n\t\tup(listener, x, z, current) {\n\t\t\tfor (x = 0, z = buffer.length; x < z; x++) {\n\t\t\t\tcurrent = buffer[x];\n\t\t\t\tif (!alive && x === z - 1) listener[success ? \"return\" : \"throw\"](current);\n\t\t\t\telse listener.next(current);\n\t\t\t}\n\t\t},\n\t\ton(listener, temp = 0) {\n\t\t\tlet subscribed = alive;\n\t\t\tif (alive) {\n\t\t\t\tfor (temp = 0; temp < count; temp++) if (!listeners[temp]) break;\n\t\t\t\tif (temp === count) count++;\n\t\t\t\tlisteners[temp] = listener;\n\t\t\t}\n\t\t\tinternal.up(listener);\n\t\t\treturn () => {\n\t\t\t\tif (alive && subscribed) {\n\t\t\t\t\tsubscribed = false;\n\t\t\t\t\tlisteners[temp] = void 0;\n\t\t\t\t\twhile (count > 0 && !listeners[count - 1]) count--;\n\t\t\t\t\tlisteners.length = count;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\treturn {\n\t\t__SEROVAL_STREAM__: true,\n\t\ton(listener) {\n\t\t\treturn internal.on(listener);\n\t\t},\n\t\tnext(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"next\");\n\t\t\t}\n\t\t},\n\t\tthrow(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"throw\");\n\t\t\t\talive = false;\n\t\t\t\tsuccess = false;\n\t\t\t\tlisteners.length = 0;\n\t\t\t}\n\t\t},\n\t\treturn(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"return\");\n\t\t\t\talive = false;\n\t\t\t\tsuccess = true;\n\t\t\t\tlisteners.length = 0;\n\t\t\t}\n\t\t}\n\t};\n})());_$HY.r[\"sc:slot:frame-occlusion-doc/list:item#a\"]=($R[12]={id:\"a\",expandedChildren:$R[13]={$frame:\"frame-occlusion-doc/list.item#a.expandedChildren\"},children:$R[14]={$frame:\"frame-occlusion-doc/list.item#a.children\"}});_$HY.r[\"sc:region:frame-occlusion-doc/list.item#a.expandedChildren\"]=\"\\x3Cp class=\\\"excerpt\\\">\\x3C!--lh:0-->Excerpt alpha\\x3C!--lh:/0-->\\x3C/p>\";_$HY.r[\"sc:slot:frame-occlusion-doc/list:item#b\"]=($R[15]={id:\"b\",expandedChildren:$R[16]={$frame:\"frame-occlusion-doc/list.item#b.expandedChildren\"},children:$R[17]={$frame:\"frame-occlusion-doc/list.item#b.children\"}});$R[7]($R[5],!0);$R[10].return(void 0);</script>",
3+
"shell": "<main _hk=1><solid-frame data-fid=\"frame-occlusion-doc/list\" style=\"display:contents\"><ul id=\"list\"><li><!--slot:item#a:start--><div _hk=sc-frame-occlusion-doc/list-item#a-0 class=\"item\" id=\"item-a\"><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#a.children\" style=\"display:contents\"><strong class=\"title\"><!--lh:1-->Title alpha<!--lh:/1--></strong></solid-frame><!--/--><button id=\"toggle-a\">toggle</button><!--$--><!--/--></div><!--slot:item#a:end--></li><li><!--slot:item#b:start--><div _hk=sc-frame-occlusion-doc/list-item#b-0 class=\"item\" id=\"item-b\"><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#b.children\" style=\"display:contents\"><strong class=\"title\"><!--lh:3-->Title bravo<!--lh:/3--></strong></solid-frame><!--/--><button id=\"toggle-b\">toggle</button><!--$--><solid-frame data-fid=\"frame-occlusion-doc/list.item#b.expandedChildren\" style=\"display:contents\"><p class=\"excerpt\"><!--lh:2-->Excerpt bravo<!--lh:/2--></p></solid-frame><!--/--></div><!--slot:item#b:end--></li></ul></solid-frame></main><script>(self.$R=self.$R||{})[\"\"]=[];_$HY.r[\"$B\"]=($R[0]={2000:$R[1]=($R[2]=($R[3]=() => {\n\tconst resolver = {\n\t\tp: 0,\n\t\ts: 0,\n\t\tf: 0\n\t};\n\tresolver.p = new Promise((resolve, reject) => {\n\t\tresolver.s = resolve;\n\t\tresolver.f = reject;\n\t});\n\treturn resolver;\n})()).p,\"2_fr\":$R[4]=($R[5]=$R[3]()).p});(b=>{for(var k in b)_$HY.r[k]=b[k];delete _$HY.r[\"$B\"]})(_$HY.r[\"$B\"]);($R[7]=(resolver, data) => {\n\tresolver.s(data);\n\tresolver.p.s = 1;\n\tresolver.p.v = data;\n})($R[2],$R[6]=(self._$SC||(self._$SC={c:{},a:{},b:{},r(i,a){var c=this.c[i]||(this.c[i]=(p,b)=>self._$SC.impl(i,p,b));if(!a)return c;this.a[a]=i;this.reg&&this.reg(a,i);return this.b[a]||(this.b[a]=Object.assign(p=>c(p,()=>a),{[Symbol.for(\"solid.component-binding\")]:{component:c,address:a}}))}})).r(\"frame-occlusion-doc/list\",\"frame-occlusion-doc/list:18sevpg\"));_$HY.r[\"sc:live\"]=$R[8]=($R[9]=(stream) => new ReadableStream({ start(controller) {\n\tstream.on({\n\t\tnext(value) {\n\t\t\ttry {\n\t\t\t\tcontroller.enqueue(value);\n\t\t\t} catch (_error) {}\n\t\t},\n\t\tthrow(value) {\n\t\t\tcontroller.error(value);\n\t\t},\n\t\treturn() {\n\t\t\ttry {\n\t\t\t\tcontroller.close();\n\t\t\t} catch (_error) {}\n\t\t}\n\t});\n} }))($R[10]=($R[11]=() => {\n\tconst buffer = [];\n\tconst listeners = [];\n\tlet alive = true;\n\tlet success = false;\n\tlet count = 0;\n\tconst internal = {\n\t\tflush(value, mode, x) {\n\t\t\tfor (x = 0; x < count; x++) {\n\t\t\t\tconst listener = listeners[x];\n\t\t\t\tif (listener) listener[mode](value);\n\t\t\t}\n\t\t},\n\t\tup(listener, x, z, current) {\n\t\t\tfor (x = 0, z = buffer.length; x < z; x++) {\n\t\t\t\tcurrent = buffer[x];\n\t\t\t\tif (!alive && x === z - 1) listener[success ? \"return\" : \"throw\"](current);\n\t\t\t\telse listener.next(current);\n\t\t\t}\n\t\t},\n\t\ton(listener, temp = 0) {\n\t\t\tlet subscribed = alive;\n\t\t\tif (alive) {\n\t\t\t\tfor (temp = 0; temp < count; temp++) if (!listeners[temp]) break;\n\t\t\t\tif (temp === count) count++;\n\t\t\t\tlisteners[temp] = listener;\n\t\t\t}\n\t\t\tinternal.up(listener);\n\t\t\treturn () => {\n\t\t\t\tif (alive && subscribed) {\n\t\t\t\t\tsubscribed = false;\n\t\t\t\t\tlisteners[temp] = void 0;\n\t\t\t\t\twhile (count > 0 && !listeners[count - 1]) count--;\n\t\t\t\t\tlisteners.length = count;\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t};\n\treturn {\n\t\t__SEROVAL_STREAM__: true,\n\t\ton(listener) {\n\t\t\treturn internal.on(listener);\n\t\t},\n\t\tnext(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"next\");\n\t\t\t}\n\t\t},\n\t\tthrow(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"throw\");\n\t\t\t\talive = false;\n\t\t\t\tsuccess = false;\n\t\t\t\tlisteners.length = 0;\n\t\t\t}\n\t\t},\n\t\treturn(value) {\n\t\t\tif (alive) {\n\t\t\t\tbuffer.push(value);\n\t\t\t\tinternal.flush(value, \"return\");\n\t\t\t\talive = false;\n\t\t\t\tsuccess = true;\n\t\t\t\tlisteners.length = 0;\n\t\t\t}\n\t\t}\n\t};\n})());_$HY.r[\"sc:tiers\"]=$R[12]=[\"regions\"];_$HY.r[\"sc:region:frame-occlusion-doc/list.item#a.expandedChildren\"]=\"\\x3Cp class=\\\"excerpt\\\">\\x3C!--lh:0-->Excerpt alpha\\x3C!--lh:/0-->\\x3C/p>\";_$HY.r[\"$B\"]=($R[13]={\"sc:slot:frame-occlusion-doc/list:item#a\":$R[14]=($R[15]=$R[3]()).p,\"sc:slot:frame-occlusion-doc/list:item#b\":$R[16]=($R[17]=$R[3]()).p});(b=>{for(var k in b)_$HY.r[k]=b[k];delete _$HY.r[\"$B\"]})(_$HY.r[\"$B\"]);$R[7]($R[15],$R[18]={id:\"a\",expandedChildren:$R[19]={$frame:\"frame-occlusion-doc/list.item#a.expandedChildren\"},children:$R[20]={$frame:\"frame-occlusion-doc/list.item#a.children\"}});$R[7]($R[17],$R[21]={id:\"b\",expandedChildren:$R[22]={$frame:\"frame-occlusion-doc/list.item#b.expandedChildren\"},children:$R[23]={$frame:\"frame-occlusion-doc/list.item#b.children\"}});$R[7]($R[5],!0);$R[10].return(void 0);</script>",
44
"rest": ""
55
}

‎packages/web/test/hydration/frame-occlusion-document.spec.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { describe, expect, test, vi } from "vitest";
1111
import { flush } from "solid-js";
1212
import { hydrate } from "@solidjs/web";
1313
import { installServerComponents } from "../../frames/src/client.js";
14+
import { prepareTier } from "../../frames/src/frame-client.js";
1415
import { createServerReference } from "../../server-functions/src/client.js";
1516
import { makeHost } from "../lifecycle-matrix/harness.js";
1617
import { ARGS, FID, ITEMS, makeApp } from "../harness/frame-occlusion-document.jsx";
@@ -44,6 +45,11 @@ describe("document face — occluded slot content — hydrate", () => {
4445
const App = makeApp(() => list(...ARGS));
4546

4647
applyChunk(container, shell, true);
48+
// The document announces the regions tier (`sc:tiers`): the slot args
49+
// are `{$frame}` regions. Resident before hydrate, as a page whose
50+
// modulepreload landed — a record naming a region waits for the tier.
51+
expect((globalThis as any)._$HY.r["sc:tiers"]).toEqual(["regions"]);
52+
await prepareTier("regions");
4753
const [a, b] = ITEMS;
4854
const excerptOf = (id: string) => container.querySelector(`#item-${id} .excerpt`);
4955
const toggle = async (id: string) => {

0 commit comments

Comments
 (0)