Skip to content

ci: full integration size check and cause of growth in the bundle size report - #513

Merged
chybisov merged 5 commits into
mainfrom
chore/bundle-size-rows
Oct 7, 2026
Merged

chybisov merged 5 commits into
mainfrom
chore/bundle-size-rows

Conversation

@chybisov

@chybisov chybisov commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #511.

What

  • Full integration check: createClient with all 7 providers in one bundle, so the total cost of the SDK is visible in one row. Today it is 560.5 kB brotli; the budget is that size plus 20% (673 kB).
  • Cause of growth: scripts/size-measure.mjs now also bundles each check with size-limit's own esbuild and records the minified bytes per package. scripts/size-report.mjs uses this to add a What changed section that lists the packages behind each notable change.
  • .size-limit.json checks can now use an import object with several files.

Example

With the main from before #507 and #510 as the base, the comment would have shown:

  • Providers · sui (+24.8 kB): 🆕 @noble/curves +42.6 kB, @mysten/sui +24.1 kB, @noble/hashes +11.4 kB, @lifi/sdk-provider-sui +6.39 kB

The scripts are the same files as in lifinance/widget#894 and jumperexchange/jumper-widget#158.

Notes

  • The breakdown is an extra esbuild pass per check, run in parallel with size-limit. With the new full integration check, the local measurement goes from 1.7 s to 5.2 s.
  • No changeset: CI only.

Add a full integration check (the main entry with every provider and
their dependencies) and checks for the published subpaths. Measure the
minified bytes per package next to each size-limit run, and list the
packages that explain each notable change in the PR comment.
@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eacfc6b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

📦 Bundle size

✅ No significant changes. Every check is within budget.

@lifi/sdk

Import Base PR Change Budget used
⚪ createClient + getQuote 4.29 kB 4.29 kB — ▰▰▰▰▰▰▰▱▱▱ 72%
⚪ all exports 16.0 kB 16.0 kB — ▰▰▰▰▰▰▰▰▱▱ 80%
⚪ CJS (no tree-shaking) 19.3 kB 19.3 kB — ▰▰▰▰▰▰▰▰▱▱ 81%

Providers

Import Base PR Change Budget used
⚪ ethereum (+ viem) 95.3 kB 95.3 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ solana 28.1 kB 28.1 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ bitcoin 68.2 kB 68.2 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ sui 91.9 kB 91.9 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ tron 192.5 kB 192.5 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ stellar 122.9 kB 122.9 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
⚪ zcash 6.45 kB 6.45 kB — ▰▰▰▰▰▰▰▰▱▱ 81%

Full integration

Import Base PR Change Budget used
⚪ createClient + all providers 560.5 kB 560.5 kB — ▰▰▰▰▰▰▰▰▱▱ 83%
How to read this
  • Sizes are minified + brotli, measured with size-limit the way an app bundles the import: tree-shaken, with all dependencies included except the ones in the check's ignore list (packages the app already has, such as peers).
  • Code behind a dynamic import() is counted too, unless the check's name says otherwise.
  • 🟠 / 🟢 mark a change of at least 512 B and at least 1% or 5.00 kB. 🔴 means the check is over its budget.
  • Budgets live in .size-limit.json. The base commit is measured with the same checks as the PR.

eacfc6b merged into e120c8e · workflow run

Do not merge. The next commit reverts this.
Save the esbuild metafile of the size-limit build instead of bundling
each check a second time, so the breakdown always matches the measured
bundle. Record bundled copies of a package, log a failed breakdown and
never cache it, keep multi-file checks on a base that lacks a file, and
flag a change of 5 kB or more on large checks.
@chybisov
chybisov marked this pull request as ready for review October 7, 2026 11:42
List the published packages under packages/ and fail the report job when
no check measures one of them, so a new provider cannot be added without
a size check. A package counts as measured when it is in the breakdown of
a measured bundle or a file-only check points into it.
@chybisov
chybisov merged commit db6f1b2 into main Oct 7, 2026
6 checks passed
@chybisov
chybisov deleted the chore/bundle-size-rows branch October 7, 2026 12:31
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