Skip to content

Commit 3b70dd4

Browse files
committed
size: compiled SC pages carry no element spread (maintainer ruling)
Maintainer's ruling (2026-10-07): most server-component apps do not have client element spreads, so the compiled baseline must not carry one. The shell's `<input {...props}>` is gone; the search input binds `value` and `onInput` directly. The ordinary dynamic attribute forms stay (dynamic class/style values, href from a prop, the handler passed through as a prop, For/Show, Errored/Loading, the lazy route). `spread` is absent from both pages' rendered web.js. Still present: `assign`/`assignProp` (through the bind tier's `assign` edge, exactly as on the hand-written pages) and 1,071 B of signals' store/utils.js — the leaf/merge key walkers `readShallow` reaches through `sourceKeys(value, SOURCE_PROXY)`; `readShallow` is what the compiler wraps dynamic class/style values in. `merge`/`omit` themselves are absent. Re-measured: base 108,634 / 34,869 (was 112,967 / 35,914), live 121,963 / 40,266 (was 126,294 / 41,406; still two eager chunks). Caps re-set at local measured + 10 B at the 0.01 KB step: 34.88 KB / 108,634 and 40.28 KB / 121,963 — CI to confirm, lower only. On `next` @ 11e9fb6 the stack is −11,031 br (base) / −9,455 br (live) on these pages; `dynamicComponent` vs `dynamic` on the spread-free compiled base is −1,681 br / −5,812 min. Tooling only; no changeset.
1 parent dd0f771 commit 3b70dd4

5 files changed

Lines changed: 97 additions & 76 deletions

File tree

‎scripts/size/README.md‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,19 @@ same reason (`page: compiled base …`, `page: compiled live …`;
148148
the hand-written `sc-base-app.js` / `sc-live-app.js` keep the runtime alive as
149149
values and never compile a template, so a change that drops the attribute
150150
runtime from those pages drops nothing from a page an application ships —
151-
compiled templates import `className`, `style`, `setAttribute`, `addEvent`,
152-
`delegateEvents` and `spread` themselves. The compiled pages mount the same
153-
server component through `dynamicComponent()` over the same server-function
151+
compiled templates import `className`, `style`, `setAttribute`, `addEvent`
152+
and `delegateEvents` themselves. The compiled pages mount the same server
153+
component through `dynamicComponent()` over the same server-function
154154
reference (the live one through `live(GET(…))`, with `action` and
155155
`isPending`/`latest`), inside a compiled shell: links with a dynamic `class`
156-
and `style`, an `href`, a handler passed through as a prop, one element
157-
spread, `<For>`, `<Show>`, `<Errored>`/`<Loading>` and a `lazy()` child. The
158-
hand-written pages stay as the frames-only floor (their caps are the frozen
159-
ones); the compiled pages are the number a real page moves by.
156+
and `style`, an `href`, a handler passed through as a prop, a search input
157+
with a `value` binding, `<For>`, `<Show>`, `<Errored>`/`<Loading>` and a
158+
`lazy()` child — and **no element spread** (the maintainer's ruling,
159+
2026-10-07: most server-component apps do not have client element spreads, so
160+
the compiled baseline must not carry one; `spread` is absent from both
161+
pages' rendered `web.js`). The hand-written pages stay as the frames-only
162+
floor (their caps are the frozen ones); the compiled pages are the number a
163+
real page moves by.
160164

161165
## Frozen floor caps
162166

‎scripts/size/bundle.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// imports (each brotli'd on its own: two files are two compressions); only
2424
// chunks reached through `import()` alone are lazy. The first scenario to
2525
// split this way was the compiled live server-component page: `isPending`
26-
// on the page and a lazy route with a template put the whole runtime (~70 KB
26+
// on the page and a lazy route with a template put the whole runtime (~66 KB
2727
// minified) in a shared chunk; counted as lazy it would have read as half
2828
// the page. No other scenario splits; their numbers did not move.
2929
//

‎scripts/size/fixtures/compiled/sc-base.jsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// sc-base-app.js — a hydrating client (no client stores) that installs the
33
// frames transport and mounts one server component through
44
// `dynamicComponent()` over a server-function reference, inside the compiled
5-
// shell of sc-shell.jsx (templates with ordinary attributes, a spread, For /
6-
// Show / Loading / Errored, a lazy child). Compiled hydratable by the measured
5+
// shell of sc-shell.jsx (templates with ordinary attributes — no element
6+
// spread — For / Show / Loading / Errored, a lazy child). Compiled hydratable by the measured
77
// checkout's @solidjs/compiler, like the `app: compiled hydrating` scenario.
88
// The delta against the hand-written page is what the compiled templates
99
// retain of @solidjs/web — the attribute runtime and the hydratable walk

‎scripts/size/fixtures/compiled/sc-shell.jsx‎

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
// an application actually ships. The hand-written sc-base-app.js /
44
// sc-live-app.js keep the same runtime pieces alive as values and never
55
// compile a template, so the attribute runtime a compiled template imports
6-
// — `className`, `style`, `setAttribute`, `addEvent`, `delegateEvents`,
7-
// `spread` and `assign` beneath it — is not on those pages, and a change
8-
// that "removes" it there removes nothing from a real one. Here it is
9-
// reached the way compiled templates reach it. Each construct is here
6+
// — `className`, `style`, `setAttribute`, `addEvent`, `delegateEvents` —
7+
// reaches those pages only through the bind tier's `assign` edge, and a
8+
// change that "removes" it there removes nothing from a real one. Here it
9+
// is reached the way compiled templates reach it. Each construct is here
1010
// because a real page has it:
1111
//
1212
// - a nav of links: `href` from a prop (`setAttribute`), `class` and `style`
@@ -15,12 +15,19 @@
1515
// `setStyleProperty` forms), the click handler passed through as a prop
1616
// (`addEvent`: the compiler cannot see that `props.onSelect` is a function,
1717
// so it defers the delegated/direct decision to the runtime);
18-
// - one element spread, `<input {...props}>` (`spread`, `assign`);
18+
// - a search input with a `value` binding (`setProperty`) and a delegated
19+
// `onInput`;
1920
// - a `<For>` over the tabs and a `<Show>` with a function child;
2021
// - the client signal + memo the hand-written pages keep (`d`), `<Errored>`
2122
// and `<Loading>` around the server component, a `lazy()` child under its
2223
// own `<Loading>` (the lazy chunk is reported, not counted).
2324
//
25+
// NO element spread (maintainer's ruling, 2026-10-07: most server-component
26+
// apps do not have client element spreads — the compiled baseline must not
27+
// carry one). `spread` / `assign` / `assignProp` and the store `merge` /
28+
// `omit` view records `spread` reads a source through must be absent from
29+
// these pages; the ledger in scenarios.js records the check.
30+
//
2431
// The server component itself is `props.children` — mounted by the entry
2532
// through `dynamicComponent()` over a server-function reference, as the
2633
// hand-written pages mount it.
@@ -36,10 +43,6 @@ function Tab(props) {
3643
);
3744
}
3845

39-
function SearchBox(props) {
40-
return <input type="search" {...props} />;
41-
}
42-
4346
const TABS = ["Top", "New", "Ask"];
4447

4548
export default function Shell(props) {
@@ -61,7 +64,12 @@ export default function Shell(props) {
6164
</Tab>
6265
)}
6366
</For>
64-
<SearchBox placeholder="Search" value={query()} onInput={e => setQuery(e.target.value)} />
67+
<input
68+
type="search"
69+
placeholder="Search"
70+
value={query()}
71+
onInput={e => setQuery(e.target.value)}
72+
/>
6573
</nav>
6674
<Show when={query()} fallback={<h1>{label()}</h1>}>
6775
{q => <h1>Results for “{q()}”</h1>}

‎scripts/size/scenarios.js‎

Lines changed: 65 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3997,93 +3997,102 @@ module.exports = [
39973997
// Compiled server-component PAGES (2026-10-07): the two page scenarios
39983998
// above are hand-written — they keep the runtime alive as values and never
39993999
// compile a template, so the attribute runtime a compiled template imports
4000-
// (`className`, `style`, `setAttribute`, `addEvent`, `delegateEvents`,
4001-
// `spread` and `assign` beneath it) is not on them, and a change that
4002-
// "removes" it from those pages removes nothing from a page an
4000+
// (`className`, `style`, `setAttribute`, `addEvent`, `delegateEvents`)
4001+
// reaches them only through the bind tier's `assign` edge, and a change
4002+
// that "removes" it from those pages removes nothing from a page an
40034003
// application ships. These two are the same pages as JSX under
40044004
// fixtures/compiled/ (sc-base.jsx, sc-live.jsx, the shared sc-shell.jsx),
40054005
// compiled hydratable by the measured checkout's @solidjs/compiler like
40064006
// the `app: compiled hydrating` scenario, with the templates a real page
4007-
// has. The hand-written pages stay as the frames-only floor (frozen caps);
4008-
// these carry inline caps like the compiled app scenarios: measured + 10 B
4007+
// has — and NO element spread: the maintainer's ruling (2026-10-07) is
4008+
// that most server-component apps do not have client element spreads, so
4009+
// the compiled baseline must not carry one (`spread` must be absent from
4010+
// the rendered web.js of both pages; the notes record the check). The
4011+
// hand-written pages stay as the frames-only floor (frozen caps); these
4012+
// carry inline caps like the compiled app scenarios: measured + 10 B
40094013
// rounded up to 0.01 KB, with the minified recorded from the same run.
40104014
{
4011-
name: "page: compiled base server components (the base page as JSX: templates with class/style/attributes/events/spread, For/Show)",
4015+
name: "page: compiled base server components (the base page as JSX: templates with class/style/attributes/events, For/Show; no spread)",
40124016
// sc-base-app.js as a compiled page: the same server-component mount
40134017
// (`dynamicComponent()` over a server-function reference, the frames
40144018
// transport installed), the same client signal + memo, `lazy()` child,
40154019
// Show / For / Loading / Errored — inside a compiled shell: links with
40164020
// `href` (`setAttribute`), a dynamic `class` and `style` value
4017-
// (`className`, `style`), a handler passed through as a prop
4018-
// (`addEvent`, `delegateEvents`), one element spread (`spread`,
4019-
// `assign`), `<For>`, `<Show>` with a function child. The delta against
4020-
// the hand-written base page is what the compiled templates retain of
4021-
// @solidjs/web (the attribute runtime, `claimElement`, `readShallow`,
4022-
// the hydratable walk helpers) plus the compiled app's own bytes.
4021+
// (`className`, `style`, and the `readShallow` the compiler wraps them
4022+
// in), a handler passed through as a prop (`addEvent`, `delegateEvents`),
4023+
// a search input with a `value` binding (`setProperty`), `<For>`, `<Show>`
4024+
// with a function child. The delta against the hand-written base page is
4025+
// what the compiled templates retain of @solidjs/web plus the compiled
4026+
// app's own bytes.
40234027
//
40244028
// Added 2026-10-07 on feat/web-dynamic-component @ 99915141a (#3870's
40254029
// head; the stack beneath is #3860 -> #3849 -> next). Measured locally
4026-
// (macOS, Node 26): 35,914 B (112,967 B minified; signals=36,336
4027-
// web/frames=26,299 web=18,157 solid=17,700 web/server-functions=12,381
4028-
// app=2,097) — +2,344 B brotli / +8,381 B minified over the hand-written
4029-
// base page's 33,570 / 104,586 on the same build: web +2,719 (`spread`
4030-
// 992, `template`/`getNextElement`/`getNextMarker` 632, `readShallow`
4031-
// 238, `scope`), signals +3,679 (store/utils.js 3,510 — the merge/omit
4032-
// view records `spread` reads a source through, whether or not the page
4033-
// calls `merge`), app +2,097, the rest layout. The attribute runtime
4034-
// proper (`className` 713, `style` 454, `setAttribute` 368, `addEvent`
4035-
// 282, `delegateEvents` 184, `eventHandler` 1,108, `assign` 283 +
4036-
// `assignProp` 921 minified) is on BOTH pages: the hand-written one
4037-
// reaches it through the bind tier's `assign` import (Rolldown attaches
4038-
// bind.js to the entry graph); here the templates import it directly —
4039-
// which is why a cut that drops `assign` from the hand-written page
4040-
// saves nothing here. On `next` @ 537e9451f (same harness; the fixture
4041-
// mounts with `dynamic`, which is all `next` has): 45,936 / 148,705 —
4042-
// the stack is −10,022 B brotli / −35,738 B minified on this page
4043-
// (−11,547 / −41,805 on the hand-written one). Mounted with `dynamic`
4044-
// instead of `dynamicComponent` on this head: 36,599 / 114,362 — the
4045-
// sibling saves 685 B brotli / 1,395 B minified on a compiled page,
4046-
// against 2,152 / 7,417 on the hand-written one (the templates import
4047-
// `spread` and `assign` themselves). Cap at local measured + 10 B at the
4048-
// 0.01 KB step; CI (Linux, Node 24) must confirm — lower only.
4030+
// (macOS, Node 26): 34,869 B (108,634 B minified; signals=33,849
4031+
// web/frames=26,261 solid=17,675 web=16,521 web/server-functions=12,364
4032+
// app=1,966) — +1,299 B brotli / +4,048 B minified over the hand-written
4033+
// base page's 33,570 / 104,586 on the same build: web +1,083
4034+
// (`template`/`getNextElement`/`getNextMarker` 632, `readShallow` 238,
4035+
// `setProperty` 217, `scope` 35), signals +1,192 (store/utils.js 1,071:
4036+
// `readShallow` calls `sourceKeys(value, SOURCE_PROXY)`, which retains
4037+
// the leaf/merge key walkers of the merge/omit view records — the one
4038+
// store-view cost left on a spread-free page; `merge`/`omit` themselves
4039+
// are absent), app +1,966. `spread` is absent (992 B with the spread the
4040+
// fixture first carried; store/utils.js was 3,510 then). The attribute
4041+
// runtime proper (`className` 713, `style` 454, `setAttribute` 368,
4042+
// `addEvent` 282, `delegateEvents` 184, `eventHandler` 1,108, `assign`
4043+
// 283 + `assignProp` 921 minified) is on BOTH pages: the hand-written one
4044+
// reaches all of it through the bind tier's `assign` import (Rolldown
4045+
// attaches bind.js to the entry graph); here the templates import
4046+
// everything but `assign`/`assignProp` directly — which is why a cut
4047+
// that drops the bind edge from the hand-written page saves only
4048+
// `assign`/`assignProp` here. On `next` @ 11e9fb653 (same harness; the
4049+
// fixture mounts with `dynamic`, which is all `next` has): 45,900 /
4050+
// 148,820 — the stack is −11,031 B brotli / −40,186 B minified on this
4051+
// page (−11,569 / −41,837 on the hand-written one). Mounted with
4052+
// `dynamic` instead of `dynamicComponent` on this head: 36,550 / 114,446
4053+
// — the sibling saves 1,681 B brotli / 5,812 B minified on this page,
4054+
// against 2,152 / 7,417 on the hand-written one (the templates already
4055+
// carry `readShallow` and the walk helpers `dynamic`'s tag arm shares).
4056+
// Cap at local measured + 10 B at the 0.01 KB step; CI (Linux, Node 24)
4057+
// must confirm — lower only.
40494058
path: "fixtures/compiled/sc-base.jsx",
40504059
compile: { hydratable: true },
4051-
limit: "35.93 KB",
4052-
capMinified: 112967,
4060+
limit: "34.88 KB",
4061+
capMinified: 108634,
40534062
alias: pageAlias
40544063
},
40554064
{
40564065
name: "page: compiled live server components (the compiled base page + live/GET + action + isPending/latest)",
40574066
// sc-live-app.js as a compiled page: the compiled base page plus
40584067
// `live(GET(...))` on the reference, an `action` dispatched from a
40594068
// compiled click handler, `isPending` / `latest` read in a template's
4060-
// `class` and a text hole. Still no client stores.
4069+
// `class` and a text hole. Still no client stores, no spread.
40614070
//
40624071
// Added 2026-10-07 on feat/web-dynamic-component @ 99915141a. Measured
4063-
// locally (macOS, Node 26): 41,406 B (126,294 B minified; signals=44,398
4064-
// web/frames=27,490 web=17,685 solid=17,245 web/server-functions=16,905
4065-
// app=2,571). This page's eager graph is TWO chunks (bundle.mjs): with
4072+
// locally (macOS, Node 26): 40,266 B (121,963 B minified; signals=41,889
4073+
// web/frames=27,502 solid=17,173 web/server-functions=16,912 web=16,047
4074+
// app=2,439). This page's eager graph is TWO chunks (bundle.mjs): with
40664075
// `isPending` on the page, the frames tiers (trace.js, bind.js) and the
40674076
// lazy comments route all reaching the core, Rolldown hoists the shared
4068-
// runtime — signals core, solid-js, @solidjs/web, 70,576 B minified —
4069-
// into a `web.js` the entry imports statically (entry 55,718 / 18,383 +
4070-
// web.js 70,576 / 23,023). It ships eagerly, so it is counted; the two
4071-
// compressions cost ≈ 1,238 B brotli over one chunk (40,168 concatenated)
4077+
// runtime — signals core, solid-js, @solidjs/web, 66,354 B minified —
4078+
// into a `web.js` the entry imports statically (entry 55,609 / 18,354 +
4079+
// web.js 66,354 / 21,912). It ships eagerly, so it is counted; the two
4080+
// compressions cost ≈ 1,223 B brotli over one chunk (39,043 concatenated)
40724081
// and the export glue ≈ 1.3 KB minified. The hand-written live page does
40734082
// not split only because its lazy page is empty: the same page with a
4074-
// template in its lazy route splits the same way. +5,492 B brotli /
4075-
// +13,327 B minified over the compiled base page (the hand-written pair
4076-
// is +3,671 / +11,899). On `next` @ 537e9451f (same harness, `dynamic`
4077-
// mount, one chunk — no tiers to share with): 49,752 / 161,091 — the
4078-
// stack is −8,346 B brotli / −34,797 B minified on this page (−11,590 /
4079-
// −41,992 on the hand-written one). Mounted with `dynamic` on this head:
4080-
// 42,080 / 127,690 (−674 / −1,396 for `dynamicComponent`). Cap at local
4081-
// measured + 10 B at the 0.01 KB step; CI (Linux, Node 24) must confirm
4082-
// — lower only.
4083+
// template in its lazy route splits the same way. +5,397 B brotli /
4084+
// +13,329 B minified over the compiled base page (the hand-written pair
4085+
// is +3,671 / +11,899). `spread` absent, as on the base page. On `next`
4086+
// @ 11e9fb653 (same harness, `dynamic` mount, one chunk — no tiers to
4087+
// share with): 49,721 / 161,233 — the stack is −9,455 B brotli / −39,270
4088+
// B minified on this page (−11,647 / −42,051 on the hand-written one).
4089+
// Mounted with `dynamic` on this head: 42,002 / 127,779 (−1,736 /
4090+
// −5,816 for `dynamicComponent`). Cap at local measured + 10 B at the
4091+
// 0.01 KB step; CI (Linux, Node 24) must confirm — lower only.
40834092
path: "fixtures/compiled/sc-live.jsx",
40844093
compile: { hydratable: true },
4085-
limit: "41.42 KB",
4086-
capMinified: 126294,
4094+
limit: "40.28 KB",
4095+
capMinified: 121963,
40874096
alias: pageAlias
40884097
},
40894098
{

0 commit comments

Comments
 (0)