Repository navigation
size: add page base + router scenario - #3838
Conversation
The two server-component page floors carry no router, so the "base case" they gate is a page nobody deploys. Two scenarios add @solidjs/router 2.0 (2.0.0-next.35 — the Solid 2 line, peers solid-js / @solidjs/web ^2.0.0-rc.13 — pinned exactly as a devDependency of scripts/size, resolved from its node_modules; .npmrc's legacy-peer-deps keeps the peers out of the lockfile since the page alias routes them to the dists): createRouter with two routes (one preload, one lazy), the instance as the hydrated root and useNavigate in a route component, so the router's runtime — not just its imports — is retained. Measured locally on next @ 49a8dca: base + router 57,001 B br (184,378 minified) against the base page's 44,864 (145,599), the router's contribution +12,137 br; live + router 58,243 (188,800) against 48,527 (157,562), +9,716 br. The router standalone is 32,430 / 11,216 B. Inline caps at local measured + 10 B rounded up to 0.01 KB (57.02 / 58.26 KB), recorded minified from the same measurement; to be confirmed against CI. Co-authored-by: Claude via Cursor <noreply@cursor.com>
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Size (brotli, eager entry chunk)
Bundled with Rolldown (what Vite ships), brotli q11, decimal KB. A scenario fails only when it is over its brotli cap and its minified size is more than 20 B over the minified recorded with the cap; over the cap within that allowance is brotli layout noise and passes with a warning. Caps and their recorded minified in |
Coverage Report for CI Build 37679139128Coverage remained the same at 76.43%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
…ext (#3838) The two router scenarios are the base / live server-component pages plus @solidjs/router; those pages mount through dynamicComponent since #3870 (the documented mount), so the router fixtures do too — with dynamic they measured +2,332 / +2,278 B brotli more (the element runtime dynamic's tag arm keeps). Re-based onto next @ 7233451 (the frames tiers): page base + router 57.02 -> 45.95 KB (45,940 B; 144,082 B min), page live + router 58.26 -> 47.21 KB (47,197 B; 148,526 B min), measured + 10 B rounded up to 0.01 KB. Co-authored-by: Cursor <cursoragent@cursor.com>
Two size scenarios: the two server-component pages under
@solidjs/router2.0. Scenarios and harness tooling only — nothing underpackages/*/src, no changeset.Why
page: baseandpage: livecarry no router, so the "base case" they gate is a page nobody deploys. These two measure the same compositions plus the router an application page actually ships, and attribute the router's contribution (its own modules report as theotherpackage).Compatibility route
@solidjs/router@2.0.0-next.35is published on npm under thenextdist-tag (the Solid 2 line; peerssolid-js/@solidjs/web^2.0.0-rc.13, which matches this checkout's2.0.0-rc.13). It is a devDependency ofscripts/size/package.json, pinned exactly like Rolldown (a router upgrade is a re-base recorded like any other cap change), and resolves fromscripts/size/node_modules— the harness is outside the pnpm workspace, so the workspace graph is untouched. Itssolid-js/@solidjs/web/@solidjs/web/server-functionsimports go through the existing page alias to the built dists like everything else.scripts/size/.npmrcsetslegacy-peer-deps=truesonpm cidoes not install the published peers for nothing (lockfile change: +18 lines, the router only; verified with a cleannpm ci --no-audit --no-fund). CI needs nothing new: thehead/base/checkjobs already runnpm ciinscripts/size.The 2.0 router has no
<A>/<Router>/<Route>components:createRouter({ routes })returns the instance component, anchors are plain<a>the router claims throughregisterElementClaim, and preloads are route-definition fields. The fixtures usecreateRouterwith two routes (onepreload, one whose component is the page'slazy()chunk), the instance as the hydrated root with a render-prop layout, anduseNavigatein a route component — the instance and the route components are reachable from the root, so the router's runtime (matching, integration, context, preloading, link claims, the native event handlers) is retained, not just its imports.Update 2026-10-07 — on
nextafter the frames tiers (#3860)Merged
next@7233451eeinto the branch (no rebase; mergea19cf63b4). The one conflict wasscripts/size/README.md's scenario list — it now names bothnext's two compiled server-component pages (#3875, landed via #3860) and these two router pages;scenarios.jsmerged clean (the router entries sit after the compiled pages).Mount:
dynamicComponent. These scenarios are thepage: base/page: livecompositions plus a router, and those pages mount the server component throughdynamicComponentsince #3870 — the documented server-component mount (11-server-components.md), the sibling ofdynamicwith no tag arm. So the router fixtures now mount the same way, measuring what a user following the docs ships. Withdynamicthe router pages measure +2,332 / +2,278 B brotli (+7,469 B minified each) more —dynamic's tag arm retains the element runtime. The router itself does not retain it on these pages; note that itsserverRouteComponenthelper mounts withdynamic(@solidjs/routerdist), so an app using that helper pays the element runtime — a router-side follow-up if the helper should move todynamicComponent.next@7233451ee, CI)page: base + routerpage: live + routerdynamic(local, for the choice)The router's contribution is unchanged from the landing measurement within ≈ 100 B; the pages under it are what #3860 cut (−11.4 KB br each). Caps are CI brotli + 10 B rounded up to 0.01 KB with CI's minified recorded and dated ledger notes citing #3838 (commit
d1e3d2039; CI's Size run read every scenario to the byte the same as local). Every other scenario is byte-identical tonext(this PR touches onlyscripts/size), includingapp: render + one signal(9,878 / 27,730).CI: Solid CI, Size (base / head / check — Size run 37675752722, every scenario to the byte the same as local), benchmarks, CodSpeed and Socket are green on
d1e3d2039.Landing measurement (2026-10-06, superseded above)
Measured (local, Node 26,
next@ 49a8dca; the local page floors matched CI's seed numbers to the byte)page: base + routerpage: live + routerWhere the +38,779 min on the base page goes: the router's own 28,008 (
createRouterContext3,029,setupNativeEvents2,398 incl. the form-action path,query's preload cache 1,814,setupLinkClaims1,486,createRouter1,226,actionImpl/toAction/handleFormAction≈ 2,360, scroll restoration 788,browserHistory594, …) plus what it retains of ours: signals +8,583 (actionand the optimistic lanes —verdictValue,dissolveLane,laneRead,applyGuesses,isPending/latest,createEffect,onSettled), sf +1,188 (subscribeFlightData,decodeResponsePayload, the redirect header,parseServerFunctionAddress), web +1,137 (takeHydrationValue,registerElementClaim), solid +364 (createContext,children). The live page pays less because it already carriesactionand the verdict.Lazy chunks (reported, not counted):
decode.js6,074 br,lazy-page.js42, and the router'sserver.js1,023 (its server-form fallback,data/serverForms).Caps — to be confirmed against CI (landing; now confirmed and re-based, see the Update)
Inline
limit:at local measured + 10 B rounded up to 0.01 KB —57.02 KBand58.26 KB— withcapMinifiedrecorded from the same measurement (184,378 / 188,800). The caps must be confirmed against CI's measurement (Node 24) + 10 B — never higher. If CI measures lower, lower them in this PR before merging. The gate has no report-only mode (toBytesrejects a missing or non-finitelimit), so an inline cap is the only form.Public API changes
None.