Skip to content

chore: implement bundle size action#10907

Merged
jasonsaayman merged 5 commits into
v1.xfrom
chore/implement-bundle-size-action
May 19, 2026
Merged

chore: implement bundle size action#10907
jasonsaayman merged 5 commits into
v1.xfrom
chore/implement-bundle-size-action

Conversation

@jasonsaayman
Copy link
Copy Markdown
Member

@jasonsaayman jasonsaayman commented May 18, 2026

Summary

Adds a Bundle Size GitHub Actions workflow that runs on PR open, synchronise, and reopen events, then comments bundle size comparisons for the v1 release stream.

Linked issue

N/A

Changes

  • Add .github/workflows/bundle-size.yml with read-only contents permission and PR comment permission.
  • Build axios with Node 24 using npm ci --ignore-scripts and npm run build.
  • Run pinned axios/bundle-size against key dist/ artefacts and publish the comparison as a PR comment.

Checklist

  • Tests added or updated (or N/A with reason: CI-only workflow change)
  • Docs/types updated if public API changed (index.d.ts and index.d.cts) (N/A: no public API change)
  • No breaking changes (or called out explicitly above)

Summary by cubic

Adds a GitHub Action that builds axios and reports bundle size changes on v1 PRs to catch regressions early. Comments only on non-fork PRs and writes a JSON report.

Description

  • Add .github/workflows/bundle-size.yml with contents: read and pull-requests: write; runs on PR open/sync/reopen for the v1 stream.
  • Build on Node 24 using npm ci --ignore-scripts and npm run build.
  • Compare via axios/bundle-size@f15fb81ae6e3de06418f59498989e5aeeca9785d (release-stream: '1') for: dist/axios.js, dist/axios.min.js, dist/browser/axios.cjs, dist/node/axios.cjs.
  • Output bundle-size-comparison.json and comment only when the PR is from this repo (not forks).

Docs

  • Add a short /docs/ note about the “Bundle Size” workflow: when it runs, which files are compared, v1 stream scope, and that comments appear only on non-fork PRs.

Testing

  • CI-only change; no source or tests modified. No additional tests needed.

Semantic version impact

  • Patch (CI-only; no runtime or API changes).

Written for commit c3b5ed6. Summary will update on new commits. Review in cubic

@jasonsaayman jasonsaayman self-assigned this May 18, 2026
@jasonsaayman jasonsaayman added priority::medium A medium priority commit::chore The PR is related to a chore labels May 18, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

Bundle Size Report

Compared current build against 1.x release stream baseline 1.16.1 for axios.

File Baseline gzip Current gzip Difference Status
dist/axios.js 41.0 KiB 41.0 KiB 0 B (0.00%) 🟢
dist/axios.min.js 20.0 KiB 20.0 KiB 0 B (0.00%) 🟢
dist/browser/axios.cjs 33.9 KiB 33.9 KiB 0 B (0.00%) 🟢
dist/node/axios.cjs 48.5 KiB 48.5 KiB 0 B (0.00%) 🟢
Total 143.4 KiB 143.4 KiB 0 B (0.00%) 🟢
Historical comparison: 1.x release stream baselines
Release Baseline gzip Current gzip Difference Status
1.16.1 latest 143.4 KiB 143.4 KiB 0 B (0.00%) 🟢
1.16.0 140.6 KiB 143.4 KiB 2.8 KiB (+1.99%) 🔵
1.15.2 128.2 KiB 143.4 KiB 15.2 KiB (+11.88%) 🔴
1.15.1 126.4 KiB 143.4 KiB 17.1 KiB (+13.49%) 🔴
1.15.0 123.1 KiB 143.4 KiB 20.3 KiB (+16.49%) 🔴
1.14.0 121.5 KiB 143.4 KiB 21.9 KiB (+18.00%) 🔴
1.13.6 122.4 KiB 143.4 KiB 21.0 KiB (+17.16%) 🔴
1.13.5 118.6 KiB 143.4 KiB 24.8 KiB (+20.89%) 🔴
1.13.4 120.8 KiB 143.4 KiB 22.7 KiB (+18.76%) 🔴
1.13.3 120.9 KiB 143.4 KiB 22.5 KiB (+18.60%) 🔴
1.13.2 119.7 KiB 143.4 KiB 23.7 KiB (+19.78%) 🔴

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Confidence score: 4/5

  • This PR looks safe to merge overall, with only a minor CI workflow reliability concern rather than a product/runtime regression risk.
  • In .github/workflows/bundle-size.yml, enabling comment-pr unconditionally can fail on fork-based pull_request runs because GITHUB_TOKEN is often read-only there, making PR comments non-writable.
  • Pay close attention to .github/workflows/bundle-size.yml - gate comment-pr for non-fork PRs so comment steps don’t fail or behave inconsistently on forks.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread .github/workflows/bundle-size.yml Outdated
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
@jasonsaayman jasonsaayman merged commit a737889 into v1.x May 19, 2026
26 checks passed
@jasonsaayman jasonsaayman deleted the chore/implement-bundle-size-action branch May 19, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commit::chore The PR is related to a chore priority::medium A medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant