Add a bundle-size budget check to CI

Open
#135 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
github-actions, typescript, vite

Research direction

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.

Written by the indexing model from the issue text.

Description

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

Dominant language
TypeScript
Stars
6
Forks
6
Avg merge
1h 59m
Merged PRs (30d)
59

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Haseeb-MernStack/commune

All issues in Haseeb-MernStack/commune

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.