Skip to content

perf: reduce package and drawing bundle size - #216

Merged
ghiscoding merged 1 commit into
mainfrom
refactor/build-size-improvement
Aug 21, 2026
Merged

ghiscoding merged 1 commit into
mainfrom
refactor/build-size-improvement

Conversation

@ghiscoding

@ghiscoding ghiscoding commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Publish only compiled dist files in the npm package.
  • Remove runtime dependencies on Chart and Picture from Drawings.
  • Use the drawing interface to resolve relationship targets, allowing unused
    drawing implementations to be tree-shaken.
  • Preserve the existing ESM-only package format and source maps.
  • Strengthen drawing relationship regression tests.

Size impact

  • npm package: 109,334 → 74,819 bytes (~32% smaller)
  • Drawings: 4.93 → 1.96 kB gzip
  • Drawings + Picture: 4.93 → 2.99 kB gzip
  • Factory with picture drawings: 13.68 → 11.78 kB gzip
  • Complete build: 67.49 → 67.34 kB

The complete root bundle has a smaller reduction because it intentionally
exports every drawing implementation. Consumers importing individual APIs
receive the larger tree-shaking improvements.

Testing

  • 270 unit tests passed
  • 100% statement, function, and line coverage
  • 22 real-browser XLSX export tests passed
  • Picture and chart relationship targets are explicitly tested
  • TypeScript type-check passed
  • Biome checks passed
  • Production package build passed
  • Packed npm contents verified

AI assistance

Bundle analysis, implementation assistance, and verification were performed
using OpenAI Codex (GPT-5.6 Sol). The resulting changes were reviewed and accepted
by the maintainer.

@ghiscoding
ghiscoding merged commit 2c00ff8 into main Aug 21, 2026
4 checks passed
@ghiscoding
ghiscoding deleted the refactor/build-size-improvement branch August 21, 2026 20:47
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (1b0abaa) to head (83a109f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #216   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files          25       25           
  Lines        1887     1882    -5     
  Branches      373      372    -1     
=======================================
- Hits         1887     1882    -5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

🎉 This pull request is included in version 5.2.4 📦
🔗 The release notes are available at: GitHub Release 🚀

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