Skip to content

Add bundle-size budget check to CI #997

@MaxGhenis

Description

@MaxGhenis

Summary

The repo has no bundle-size budget or regression test in CI. The Vercel previews show size only on click-through; contributors have no automated warning when a commit fattens the bundle, and no historical size trend for comparison.

What goes wrong

Related active issues that would benefit from this (making them observable and prioritizable):

Suggested fix

Add one or both:

  1. Bundle-size budget CI check using size-limit or @next/bundle-analyzer:
# .github/workflows/pr.yaml (new job)
bundle-size:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v4
    - uses: oven-sh/setup-bun@v2
    - run: bun install --frozen-lockfile
    - run: bun run build
    - uses: andresz1/size-limit-action@v1
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}

…with per-route budgets in size-limit.config.js.

  1. Lighthouse CI on the Vercel preview URL for perf + bundle metrics, posting a PR comment with the deltas.

Start with budgets based on current sizes (First Load JS per route from next build output); ratchet down over time.

Severity

Low — nice-to-have, becomes higher ROI once #669 / #773 / MarkdownFormatter dedupe (#990) land and you want to lock in the wins.

Relates to

#669, #773, #990.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions