Skip to content

Build: Add export and module tracing to bundle-size bot - #286

Open
jlukic wants to merge 7 commits into
mainfrom
feat/size-export-tracing
Open

Build: Add export and module tracing to bundle-size bot#286
jlukic wants to merge 7 commits into
mainfrom
feat/size-export-tracing

Conversation

@jlukic

@jlukic jlukic commented Jul 1, 2026

Copy link
Copy Markdown
Member

The size bot learns to explain itself, designed for SNR: rows are findings, never inventory.

Changes

  • from column on the changed-bundles table plus a , from x`` clause in the alert when one source dominates
  • Tracked import costs: every export of utils/reactivity/query priced per PR with its module-graph fingerprint. The reporter clusters by graph transition and delta cohort, rendering one row per co-movement group named by its master (cheapest member, stable tie-break) — slaves are priced but never listed
  • A master jump ≥ 512 B min earns an alert line even when no bundle moved — the single-export-grows-40% case that is currently invisible
  • Signal/result table removed (it repeated the title, alert, and counts line) — the denominator moves into the changed-bundles heading
  • ~170 fixture builds per collect (seconds), static analysis only, harness stays main-pinned

Risk

2/10

Trace failures degrade to measurement-only, one-sided traces to no-section, artifact fields sanitized before the privileged reporter renders. 42/42 harness tests. Consumption study in ai/workspace (private).

Sample comment — the five-pragma retention leak, rendered as implemented

🟡 Bundle size: component +371 B brotli · +0 shipped LOC for demo123

Base: main · Run: #0 · Raw: size-report.json

Demo

[!WARNING]
component grew +371 B brotli to 48.8 KB (+0.7%, from utils/strings.js) across +0 shipped LOC.
Import costs moved: $ +1.45 KB min (query), joinWords +1.44 KB min (utils) and 6 more — see Tracked import costs.

2 larger · 0 smaller · 22 unchanged · +0 shipped LOC · +0 comment LOC

Bundles that changed (2 of 24)

bundle brotli Δ brotli change from
component 🎯 48.8 KB +371 B +0.7% utils/strings.js 100%
framework 130.1 KB +342 B +0.3%

Sorted by absolute brotli delta, increases first. 🎯 = bundle most relevant to this PR. from = share of the movement by source module, from the harness build.

Tracked import costs (query · reactivity · utils): 9 moved
package export min Δ min
query $ 39.3 KB +1.45 KB (+4%)
query registerBehavior 52.4 KB +1.06 KB (+2%)
utils joinWords 1.8 KB +1.44 KB (+360%)
utils capitalize 1.5 KB +1.40 KB (+2143%)
utils toTitleCase 1.5 KB +1.09 KB (+288%)
utils log 2.4 KB +1.09 KB (+84%)
utils getArticle 1.5 KB +1.03 KB (+232%)
utils toNumber 1.0 KB +706 B (+193%)
utils humanize 1.5 KB +345 B (+30%)

The minified cost of importing just this export, standalone. One row per co-movement group, named by its master — full per-export pricing in size-report.json.

LOC by scope: +0 shipped LOC · +0 comment LOC

No change in shipped source lines.

All 24 bundles, gzip, and raw sizes
bundle group brotli Δ brotli gzip Δ gzip raw Δ raw
compiler package 5.5 KB 6.2 KB 16.3 KB
component 🎯 package 48.8 KB +371 B 55.8 KB +363 B 170.5 KB +921 B
query package 15.9 KB 17.6 KB 52.1 KB
reactivity package 5.5 KB 6.0 KB 16.5 KB
renderer package 42.0 KB 47.9 KB 146.0 KB
specs package 53.7 KB 63.5 KB 235.7 KB
tailwind package 67.4 KB 85.3 KB 335.3 KB
templating package 28.0 KB 31.3 KB 93.2 KB
utils package 17.3 KB 19.3 KB 49.9 KB
framework framework 130.1 KB +342 B 166.0 KB +421 B 698.1 KB +921 B
button primitive 12.0 KB 15.1 KB 128.5 KB
card primitive 3.0 KB 3.5 KB 15.8 KB
container primitive 694 B 888 B 2.4 KB
divider primitive 1.6 KB 1.9 KB 6.5 KB
icon primitive 26.3 KB 35.0 KB 143.7 KB
image primitive 776 B 993 B 2.2 KB
input primitive 3.9 KB 4.5 KB 15.6 KB
label primitive 1.3 KB 1.6 KB 5.5 KB
menu primitive 14.1 KB 16.3 KB 64.3 KB
modal primitive 1.7 KB 2.0 KB 6.7 KB
rail primitive 534 B 695 B 1.5 KB
segment primitive 3.1 KB 3.7 KB 19.7 KB
spinner primitive 1.8 KB 2.1 KB 8.0 KB
table primitive 555 B 692 B 1.3 KB

brotli q11 · gzip l9 · vs main · fresh build both sides

@github-actions github-actions Bot added the Docs Modifies documentation label Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Docs Modifies documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant