Skip to content

build(mobile): raise the page bundle's code fence from 9 to 9.5 MiB - #37014

Merged
AmoabaKelvin merged 1 commit into
mainfrom
mobile-web-bundle-budget
Nov 1, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
mobile-web-bundle-budget

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Nov 1, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​5 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​1

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_BYTES goes from 9 * 1024 * 1024 to 9.5 * 1024 * 1024 in config/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.
  • Its comment said the fence keeps the bundle "below the phone's per-asset contract ceiling". The code ships split across chunks, so it now says what it is: our own fence, well inside the phone contract in 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.
  • The existing test that the fence stays under the 10 MiB per-asset ceiling still holds.

Why

Measured with build:mobile-web + verify-mobile-web-app-bundle today (code bytes excluding font and catalogs):

Branch Code bytes vs main
main 0dcc811 9,414,296 —
#36999 PR tab rebuild 9,428,080 +13.8 KB
PR tab live checks (stacked on #36999) 9,436,734 +22.4 KB (450 bytes under the fence)
hub next-step bar (sc-hub-changes) 9,433,077 +18.8 KB
diff screen (sc-diff-screen) 9,421,171 +6.9 KB
commits screens (sc-commits) 9,445,288 +31.0 KB, already over

Together 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

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Do not merge before Kelvin OKs the new budget.
  • A separate dead-code sweep of page-reachable mobile/src will follow if it finds real dead modules.
  • No runtime, platform or remote impact; the phone contract is unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

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.
@coderabbitai

coderabbitai Bot commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccd5e96e-89cc-4468-aef3-51e66987ac23
Commits

Reviewing files that changed from the base of the PR and between 0e25b0e and bd1a2e3.

Files selected for processing: 1
  • config/scripts/verify-mobile-web-app-bundle.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

The mobile web app bundle verifier increases the maximum code budget from 9 MiB to 9.5 MiB. The catalog allowance remains 10 chunks and 3 MiB. Comments describe the code budget in relation to the 10 MiB per-asset contract ceiling.

Merge Risk: Minimal · up to bd1a2

The budget increase does not exceed the documented mobile bundle contract, so the change is mergeable.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the change: it raises the page bundle code budget (fence) from 9 to 9.5 MiB, which matches the only functional change, the MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES constant in config/scri…
Description check Passed The description is thorough and closely follows the template. It has a clear ELI5, a What Changed section with the before and after values, a Why section with measured byte counts and alternatives con…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the change: it raises the page bundle code budget (fence) from 9 to 9.5 MiB, which matches the only functional change, the MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES constant in config/scripts/verify-mobile-web-app-bundle.mjs. It is specific and concise. The conventional-commit prefix 'build(mobile):' fits a build-budget change.

Full details: Description check

Explanation

The description is thorough and closely follows the template. It has a clear ELI5, a What Changed section with the before and after values, a Why section with measured byte counts and alternatives considered, Testing notes, a Visual Proof N/A with reason, and an upstream-boundary checkbox. Two template gaps remain. The 'Linked Issue' section says 'No issue' and does not use the 'Fixes #' form, which the template says is required for outside contributors. The template also asks for the 'Review' and 'AI Disclosure' sections; AI Disclosure is left blank (it is optional for internal contributors) and the Review section is only a short note. The checklist's lint/typecheck/test/build item is unchecked, which the author marks as covered by CI or local runs. These gaps are not critical for a one-constant change, so the description is mostly complete.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 1 files.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant