You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 61a33af
Browse filesBrowse the repository at this point in the historyBrowse files
authored
size: measure with Rolldown instead of size-limit/esbuild; re-base caps (#3679)
* size: measure with Rolldown instead of size-limit/esbuild; re-base caps
The harness bundled with esbuild because size-limit only offers esbuild or
webpack. Rolldown is what Vite ships, so its tree-shaking, chunk shapes and
minifier are what applications download: esbuild emitted dead dynamic-import
entries and shaped the shared codec chunk by their union (13.0 vs 6.3 KB br
for the lazy codec), and minified 4-9% larger on every scenario.
- scripts/size/bundle.mjs: Rolldown bundling, real code splitting (lazy
chunks reported, never counted), per-module attribution apportioned to the
entry chunk's minified length.
- size.mjs replaces size-limit as the gate (--json for the PR comment);
attribute.mjs ported; report.mjs renders the head-vs-base comment.
- .size-limit.js -> scenarios.js: modifyEsbuildConfig hooks become plain
alias/external fields; the codec stub (lazy-codec.js) is gone, the page
scenarios resolve the real decode entry as a lazy chunk.
- Every cap re-based to the Rolldown measurement rounded up to the next
0.01 kB, with a switch note at each limit; floor-caps.json lowered (the
freeze check passes without an exception).
- size.yml: check job runs size.mjs and uploads its JSON; compare job builds
the base branch, measures it with the head's harness (SIZE_PACKAGES_ROOT)
and upserts a marker comment, replacing andresz1/size-limit-action.
- Rolldown pinned exactly (1.2.11): its minifier decides the numbers.
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
* size: store-hydrating cap from fresh artifacts (30.36 KB)
The local dists the re-base measured predated #3674; Linux CI measured the
scenario at 30,354 B and a rebuild here agrees to the byte. The other
eleven scenarios were identical on both platforms.
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
* size: rebase the Rolldown caps onto next @ ee49b3e
Three signals fixes landed since the switch was measured at cad2ce7
(#3678 F3/F5, #3684 F6, #3682 F1); the esbuild ledger notes for them are
carried into scenarios.js and every cap is re-measured with Rolldown on
the current artifacts, rounded up to the next 0.01 kB:
core floor 9506 -> 9508 (9.51 KB, unchanged)
+ createStore 16504 -> 16584 (16.59 KB)
+ isPending 12119 -> 12154 (12.16 KB)
render + signal 12039 -> 12047 (12.05 KB)
hydrating 19606 -> 19623 (19.63 KB)
hydrating+stores 30354 -> 30480 (30.48 KB)
CSR 14871 -> 14909 (14.91 KB)
observe tier 16294 -> 16336 (16.34 KB)
observe + attr 30471 -> 30453 (30.46 KB)
frames 11768 -> 11768 (11.77 KB, unchanged)
page: base 44635 -> 44726 (44.73 KB)
page: live 48802 -> 48976 (48.98 KB)
All five frozen caps still go down against next's esbuild values, so
check-floor-caps passes without an exception.
Co-authored-by: Cursor <[email protected]>
* size: observe+attr cap 30.46 -> 30.52 KB after #3692 landed on next
Rebased onto next @ 656f0df (#3686, #3692 merged). Only the attribution
engine scenario moved: 30453 -> 30513 B (+60 B), the #3692 fix on the
attribution path. Ledger note added; no frozen floor cap changed.
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
---------
Co-authored-by: Claude via Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
Copy file name to clipboardExpand all lines: .cursor/rules/signals.mdc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ alwaysApply: false
21
21
22
22
## Changing This Package — Checklist
23
23
24
-
1. **Bundle size is budgeted.** Scenarios and ratcheted caps live in `scripts/size/.size-limit.js`(run `npm run size` from `scripts/size/` after `pnpm build:js`). Every cap bump needs an audit note there. Restructuring golf is measured NO-WIN (brotli compresses repeats free; indirection adds unique tokens — 2026-09-04 notes). The winning move is **relocation into pay-for-use modules** (e.g. the optimistic module) so floor bundles don't pay.
24
+
1. **Bundle size is budgeted.** Scenarios and ratcheted caps live in `scripts/size/scenarios.js`, bundled with Rolldown (run `npm run size` from `scripts/size/` after `pnpm build:js`); the floor and page caps in `scripts/size/floor-caps.json` are frozen. Every cap bump needs an audit note there. Restructuring golf is measured NO-WIN (brotli compresses repeats free; indirection adds unique tokens — 2026-09-04 notes). The winning move is **relocation into pay-for-use modules** (e.g. the optimistic module) so floor bundles don't pay.
25
25
2. **Two gates, three tiers.** Checks (strict reads, invariants, forbidden scopes, console reporting, dev-only error text) go under `__DEV__` — dev builds only. Wiring (attribution hook call sites, `_name` labels, graph edge counters, `emitDiagnostic`) goes under `__OBSERVE__` — dev AND the `dist/observe` tier, which production observability consumers select via the `observe` export condition. `__DEV__` implies `__OBSERVE__` (dev.ts asserts it). Prod folds both — free. The observe tier has its own size scenario; the prod scenarios must not move because of it. Public surface: `OBSERVE` (diagnostics channel + the attribution hook slot and interaction frame, observe-legal) vs `DEV` (devtools hooks, graph getters, console face). The attribution ENGINE is the separate `@solidjs/signals/attribution` entry (`src/attribution.ts`; prod resolves the inert `src/attribution.prod.ts`): nothing in the core may import `core/attribution.ts`, or the observe tier ships the engine to consumers that never enable it. Every build has two entries (`index` + `attribution`) sharing one module instance — the flat dev build is code-split for exactly this. Artifacts are ESM only (`dist/prod/`, `dist/observe/`, `dist/dev*.js`; no `.cjs`, no `require` branch): Node >= 22.12 `require()`s ESM, so a CJS host gets the same files — which is why no shipped module may contain a top-level `await` (`tests/dist-artifacts.test.ts` scans for it and `require`s each tier). See `documentation/plans/observe-tier-plan.md`.
26
26
3. **Downstream tests consume built dist.** After changing signals, `pnpm --filter @solidjs/signals build` and `pnpm --filter solid-js build` BEFORE running `packages/solid` or `packages/web` tests — stale dist has caused false regression alarms repeatedly.
27
27
4. **Facades mirror types.** Store/signal API type changes must be applied in `packages/solid/src/client/hydration.ts` and `packages/solid/src/server/signals.ts` too.
Copy file name to clipboardExpand all lines: documentation/plans/size-reduction-audit.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,13 @@ between chunks or out of apps that skip a feature; under this framing it is seco
16
16
first-order work is making the code everyone ships smaller with the same semantics: §4.I, the
17
17
density audit, comes next.
18
18
19
+
**Harness switched to Rolldown (2026-09-26, later that night).** Every number in this document
20
+
is an esbuild number (size-limit's bundler). The harness now bundles with Rolldown — what Vite
21
+
ships — and every cap was re-based; Rolldown lands 4–9% lower on the same artifacts (floor
22
+
9,922 → 9,506; base SC page 46,852 → 44,635; live 51,156 → 48,802 at `next` @ cad2ce724; rebased onto ee49b3eee: 9,508 / 44,726 / 48,976). Deltas in the tables here
23
+
stay valid as deltas; absolute targets should be read against the Rolldown caps in
24
+
`scripts/size/floor-caps.json`.
25
+
19
26
## 1. Baseline
20
27
21
28
| Scenario | min | br | signals | solid-js | web | frames | sf |
0 commit comments