Add a bundle-size budget check to CI

Aperta
#135 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
github-actions, typescript, vite

Direzione di ricerca

Start with .github/workflows/ci.yml to see where the build step runs, then apps/web/vite.config.ts to see how the manualChunks split produces the entry and vendor chunks. The new check reads gzip sizes from apps/web/dist/assets after npm run build -w @commune/web, compares them with limits in a small JSON file, and prints a table. Done means a PR that adds a large dependency fails with a readable message, while main passes with headroom. Check docs/PERFORMANCE.md for any existing budget notes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ci help wanted web

Difficulty: Intermediate · Estimated size: half a day to 1 day

Context

The web app is split into chunks in apps/web/vite.config.ts (manualChunks). Nothing stops a new dependency from making the first page load much heavier.

Problem or goal

Fail (or warn on) a pull request that grows the main JavaScript bundle beyond an agreed budget.

Suggested approach

  • After npm run build -w @commune/web, read the gzip size of the entry and vendor chunks from apps/web/dist/assets and compare it with limits stored in a small JSON file.
  • Print a short table in the CI log. Make the limits easy to raise on purpose in a reviewed change.
  • Document how to check locally.

Where to look

  • .github/workflows/ci.yml
  • apps/web/vite.config.ts
  • docs/PERFORMANCE.md

Acceptance criteria

  • A PR that adds a large dependency fails the check with a readable message.
  • The check passes on main today with some headroom.
  • No flaky results: sizes come from files, not from timing.

How to work on it

  1. Comment here to claim it, so two people do not do the same work.
  2. Fork the repo and branch from main (feat/short-name or fix/short-name). Setup steps are in docs/DEVELOPMENT.md.
  3. Keep the change focused and add tests for backend logic.
  4. Run npm run typecheck, npm test and npm run lint and npm run format before opening the pull request.
  5. Use a Conventional Commits title (for example feat(web): add bookmarks). More in CONTRIBUTING.md.

Stuck? Ask in this issue. Questions are welcome.


Generated by Claude Code

Lingua principale
TypeScript
Stelle
6
Fork
6
Merge medio
1h 59m
PR unite (30g)
59

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Haseeb-MernStack/commune

Tutte le issue di Haseeb-MernStack/commune

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.