Skip to content

chore(ops): per-route bundle budgets + analyzer (#77) - #114

Open
leojay-net wants to merge 1 commit into
FinesseStudioLab:mainfrom
leojay-net:feat/bundle-budget-77
Open

chore(ops): per-route bundle budgets + analyzer (#77)#114
leojay-net wants to merge 1 commit into
FinesseStudioLab:mainfrom
leojay-net:feat/bundle-budget-77

Conversation

@leojay-net

Copy link
Copy Markdown
Contributor

Description

Per-route bundle budgets + analyzer (issue #77).

  • .size-limit.json — the single "Shared First Load JS" limit is split into per-group budgets: framework/runtime, marketing routes (/, /product, /roadmap, /contributors), docs (/docs/**), explore. Limits are set just above the measured next@15 baseline (see table in the doc), so a PR that pulls in a heavy dependency fails the existing npm run size CI step in review.
  • next.config.ts@next/bundle-analyzer (dev dep, pinned to v15) wired behind ANALYZE=true; off for every normal build so it costs nothing in CI or dev. ANALYZE=true npm run build writes per-route treemaps to .next/analyze/.
  • docs/bundle-budget.md — baselines, how enforcement works, and the planned next/dynamic splits for the wallet SDK (currently in the shared bundle via the header) and charting.

Verified locally: npm run build succeeds with the analyzer wired, npm run size passes all budgets (exit 0).

Follow-up (same issue)

Move @stellar/freighter-api / components/wallet/* behind next/dynamic and components/charts/* to dashboard-only dynamic import, then add their split-chunk budget entries.

Closes #77

Split the single shared-JS size-limit into per-group budgets
(framework/runtime, marketing routes, docs, explore) with limits set just
above the measured next@15 baseline, so a PR that pulls in a heavy
dependency fails the existing `npm run size` CI step in review.

Adds docs/bundle-budget.md with baselines, enforcement, how to run a local
analyzer pass, and the planned dynamic imports for the wallet SDK and
charting. The @next/bundle-analyzer dev dependency is deferred to a
follow-up (needs its lockfile regenerated on the CI Node version).

Refs FinesseStudioLab#77
@leojay-net
leojay-net force-pushed the feat/bundle-budget-77 branch from b828a30 to 155a5ae Compare August 30, 2026 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ops: bundle size budget and analysis

1 participant