Repository navigation
Infrastructure: Add bundle-size measurement and advisory PR reporting #4253
Description
Goal
Deliver reproducible package-cost measurements, optional-module reachability checks, and advisory pull-request reporting for the agentic Components and Design packages. Parent: #4275.
Status - 2026-10-01
Completed delivery milestone. The original issue combined the measurement foundation with later required regression gates. Following the workstream's milestone/follow-up split, this issue records the delivered foundation; the unfinished gate and dependency criteria are preserved in #4341, not declared complete.
Delivered
- PR Infrastructure: add bundle size checks and pipeline with warnings #4284 introduced the measurement fixture, checked-in baselines, root commands, and advisory CI.
- PR Clean up bundle size reports and add a persistent PR comment #4289 added concise, persistent PR reporting.
- PRs Add appearance-aware Flex theme sources #4295/Add runtime color utilities and contrast validation #4297 established cross-platform Flex/legacy/runtime-color scenarios and positive/negative optional-module checks.
- PR Faster and more concise bundle-size reports #4335 migrated measurement from Metro shell-relative deltas to minified, tree-shaken esbuild package-code cost, with React/React Native externalized, typed
.mtstooling, source maps/metafiles, workspace attribution, and trusted report validation. yarn bundle-sizemeasures seven scenarios for both macOS and Windows.yarn bundle-size:updateis explicit; ordinary measurement does not rewrite baselines.- The PR pipeline compares against the base branch, publishes a job summary and persistent comment, and retains diagnostics, including trusted completion reporting for fork/Dependabot PRs.
- The dead legacy
bundlesizecommand/target is removed.
Completed milestone criteria
- A documented root command measures all currently configured scenarios and produces raw bytes, gzip diagnostics, contributing module counts, and workspace attribution.
- Two runs at audited main
c3a89b0b7have identical measured/comparison inputs for all 14 platform/scenario combinations. - Flex-only entries reject reverse legacy/runtime-color reachability; explicit legacy/color opt-ins positively verify their implementations.
- macOS and Windows baselines and advisory PR summaries/artifacts are available.
- Baseline updates are explicit and the resulting diff is reviewable.
Follow-up
#4341 owns reviewed absolute/percentage budgets, required-status integration, complete production dependency/unused-declaration enforcement, public-primitives and packed-archive measurements, reproducibility metadata, and reviewed baseline-promotion policy.
The component manifest still declares Callout and suppresses it through Knip. Size changes are still advisory, and the Bundle Size PR job is not in the required PR aggregate. Closing this milestone does not claim those gates or the original production acceptance criteria are satisfied.
Activity
[-]Add bundle-size and dependency regression gates[/-][+]Infrastructure: Add bundle-size and dependency regression gates[/+]JasonVMo commentedon Sep 3, 2026
Status update - 2026-09-03
This issue is being reopened so its state matches its original Stage 1 through
Stage 3 scope.
Completed: PR #4284 delivered the package-cost measurement foundation,
checked-in baselines, dependency/reachability checks, and an advisory pull
request pipeline. PR #4295 added cross-platform Flex-theme scenarios and proved
that modern Flex paths exclude reverse legacy compatibility payloads.
Remaining: establish normal CI variance, approve absolute and percentage
growth thresholds, make the budgets required, require reviewed rationale for
baseline changes, and finish any acceptance criteria not yet covered by the
advisory implementation. Advisory warnings do not satisfy this issue's
required-gate acceptance criteria.
This remains a direct child of #4275.
[-]Infrastructure: Add bundle-size and dependency regression gates[/-][+]Infrastructure: Add bundle-size measurement and advisory PR reporting[/+]JasonVMo commentedon Oct 1, 2026
The measurement/advisory delivery milestone is implemented on main. Closing under the approved milestone/follow-up split; required budgets, dependency enforcement, complete measurements, and promotion policy are preserved in direct workstream sub-issue #4341.