R5: bundle slimming — retarget the budget to the app, no code slimming #36

Merged
developer merged 1 commits from feature/r5-bundle-budget into development 2026-06-10 13:18:27 +00:00
Owner

R5 — Bundle slimming (PRERELEASE.md)

Outcome: analysed → no code slimming warranted; the budget metric was retargeted to measure the app correctly. No app code change.

Analysis

  • Real dist (gzip + sourcemap attribution): the app bundle is already minified + tree-shaken and dominated by the Connect/FlatBuffers transport runtime + generated FB/PB bindings (~2/3 of main) + the Svelte runtime — irreducible within scope.
  • Lazy-load rejected (screens + i18n): bundle-size.mjs sums every emitted chunk → zero total-size win, plus +N gateway fetches of latency on first navigation. Chunk-collapsing rejected too (keeps the stable Svelte runtime cacheable; HTTP/2 makes the extra preload negligible).

Change

  • bundle-size.mjs now measures per HTML entry with three independent gates:
    • app entry (main) ≤ 100 KB — now 74.2
    • shared (Svelte + i18n) ≤ 30 KB — now 22.9
    • landing-own ≤ 5 KB — now 1.6
  • The app’s real payload = entry + shared = ~97 KB (never landing.js); landing reported separately (~24.5 KB).
  • Same CLI + exit-code contract → CI step unchanged. Fixed the stale “~82 KB” figure in the script + ui/README.md.

Verification

  • pnpm check (0 errors), pnpm test:unit (138 passed), pnpm build + node scripts/bundle-size.mjs (all 3 gates green). No functional change → e2e unaffected.
## R5 — Bundle slimming (`PRERELEASE.md`) **Outcome:** analysed → **no code slimming warranted**; the budget metric was retargeted to measure the app correctly. No app code change. ### Analysis - Real `dist` (gzip + sourcemap attribution): the app bundle is already minified + tree-shaken and dominated by the Connect/FlatBuffers transport runtime + generated FB/PB bindings (~2/3 of `main`) + the Svelte runtime — irreducible within scope. - **Lazy-load rejected** (screens + i18n): `bundle-size.mjs` sums every emitted chunk → zero total-size win, plus +N gateway fetches of latency on first navigation. Chunk-collapsing rejected too (keeps the stable Svelte runtime cacheable; HTTP/2 makes the extra preload negligible). ### Change - `bundle-size.mjs` now measures **per HTML entry** with three independent gates: - app entry (`main`) ≤ 100 KB — now **74.2** - shared (Svelte + i18n) ≤ 30 KB — now **22.9** - landing-own ≤ 5 KB — now **1.6** - The app’s real payload = entry + shared = **~97 KB** (never `landing.js`); landing reported separately (~24.5 KB). - Same CLI + exit-code contract → CI step unchanged. Fixed the stale “~82 KB” figure in the script + `ui/README.md`. ### Verification - `pnpm check` (0 errors), `pnpm test:unit` (138 passed), `pnpm build` + `node scripts/bundle-size.mjs` (all 3 gates green). No functional change → e2e unaffected.
developer added 1 commit 2026-06-10 13:12:17 +00:00
R5: bundle slimming — retarget the budget to the app, no code slimming
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 37s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m0s
d4ef951db9
Analysed the real dist (gzip + sourcemap attribution): the bundle is already minified + tree-shaken and dominated by the Connect/FlatBuffers transport runtime + generated bindings + the Svelte runtime (~2/3 of main), so no in-scope code slimming is warranted. Lazy-loading was rejected (bundle-size.mjs sums every chunk -> zero total-size win, plus +N gateway fetches of latency); i18n lazy-load and chunk-collapsing likewise (caching/HTTP2).

Instead bundle-size.mjs now measures per HTML entry with three independent gates (app entry <=100 KB, Svelte+i18n shared <=30 KB, landing-own <=5 KB): the app's real payload is its entry chunk + the shared chunk (~97 KB), never landing.js. Same CLI + exit-code contract, CI step unchanged. Fixed the stale ~82 KB figure in the script and ui/README.md. No app code change.
owner approved these changes 2026-06-10 13:17:28 +00:00
developer merged commit a372343797 into development 2026-06-10 13:18:27 +00:00
developer deleted branch feature/r5-bundle-budget 2026-06-10 13:18:27 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#36