Repository navigation
build(mobile): raise the page bundle's code fence from 9 to 9.5 MiB - #37014
Conversation
Main's page code is 9,414,296 of 9,437,184 bytes, and the Source Control redesign branches add 7-31 KB each. The phone contract allows 10 MiB per asset and 32 MiB in total, so the fence was our own budget, not a phone limit; 9.5 MiB keeps it under the per-asset ceiling.
|
No actionable comments were generated in the recent review.
|
ELI5
The phone app's pages have a size limit we set ourselves, and main is 22 KB under it. The Source Control redesign PRs each add a little code, so whichever lands last would fail the build. This raises our self-imposed limit from 9 MiB to 9.5 MiB, still under the phone's real limits.
What Changed
MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTESgoes from9 * 1024 * 1024to9.5 * 1024 * 1024inconfig/scripts/verify-mobile-web-app-bundle.mjs. This is the fence on page code, excluding the approved font and the locale catalogs, which have their own allowances.src/shared/mobile-web-bundle/manifest-contract.ts(32 MiB total, 10 MiB per asset). The two sibling comments that said "the 9 MiB fence" no longer hard-code the number.Why
Measured with
build:mobile-web+verify-mobile-web-app-bundletoday (code bytes excluding font and catalogs):0dcc811Together these add about 79 KB, so the 9 MiB fence would fail on whichever lands last. Trimming per PR only moves the failure to the last PR. 9.5 MiB leaves about 470 KB of room and stays under the 10 MiB per-asset ceiling.
Linked Issue
No issue. This unblocks the mobile Source Control redesign PRs (#36999 and its siblings).
Visual Proof
N/A. This changes a build budget only; nothing visible changes.
Testing
config/scripts/build-mobile-web-app-bundle.test.mjs(40 tests, including the fence-under-per-asset-ceiling check).Rebuilt the bundle on main and on each branch above to get the numbers.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Not reviewed beyond the coordinator's numbers check; this changes one constant and its comments.
Agent skill upstream boundary
Notes
mobile/srcwill follow if it finds real dead modules.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)