Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 25, 2025

  • Analysis: Identify duplicate and large dependencies in build-tools workspace
  • Plan development: Create detailed plan for dependency reduction
  • Implementation: Replace pako with fflate in bundle-size-tools
  • Documentation: Add plans folder with dependency reduction plan document

Summary

This PR addresses the dependency reduction task for the build-tools workspace by:

  1. Implementing a low-risk change: Replacing pako with fflate (already used in build-cli)
  2. Creating comprehensive documentation in build-tools/plans/dependency-reduction.md

Completed Changes

Replaced pako with fflate in bundle-size-tools:

  • Removed pako and @types/pako dependencies
  • Added fflate (already used in build-cli, consolidates compression libraries)
  • Updated decompressStatsFile.ts to use gunzipSync from fflate
  • Impact: Reduced lockfile by 8 lines, removed 2 dev/dependencies

Added dependency reduction plan document:

  • Created build-tools/plans/ folder for planning documentation
  • Detailed plan covering glob library consolidation opportunities
  • Risk assessments and test coverage analysis
  • Specific risk reduction steps including:
    • Integration test recommendations
    • Compatibility wrapper code for glob migration
    • Incremental migration approach

Plan Highlights (from plans/dependency-reduction.md)

Glob Libraries (Medium-High Risk)

  • 6 libraries with duplicate purposes: glob, globby, multimatch, micromatch, picomatch, minimatch
  • Risk reduction: Add integration tests, create compatibility wrapper, migrate incrementally

Compression (Completed)

  • ✅ Replaced pako with fflate
  • jszip kept for different use case (ZIP archives)

Command Execution (Deferred)

  • execa kept due to high risk and cross-platform needs

File System (Low Priority)

  • fs-extra kept as low-impact, well-maintained

Impact

  • ✅ Lockfile reduced from 14,873 to 14,865 lines (-8)
  • ✅ Removed 2 dependencies (pako, @types/pako)
  • ✅ Consolidated compression libraries
  • Potential: 3-4 more deps with glob consolidation
Original prompt

Develop a plan to reduce the number of dependencies in the build-tools workspace. The test coverage of the packages there is very low, so in cases where there is no test coverage, make sure to take that into account in your plan. There is a lot of packages that have duplicate purposes (e.g. globbing), and some that are very large with smaller alternatives (execa vs. tiny-exec), so there are a lot of opportunities.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: tylerbutler <19589+tylerbutler@users.noreply.github.com>
Copilot AI changed the title [WIP] Develop plan to reduce dependencies in build-tools workspace Reduce dependencies in build-tools: replace pako with fflate Nov 25, 2025
Copilot AI requested a review from tylerbutler November 25, 2025 20:21
Copilot finished work on behalf of tylerbutler November 25, 2025 20:21
@tylerbutler
Copy link
Member

@copilot Add a document to the "plans" folder covering the opportunities you identified. If you have suggested ways to quickly reduce risk of those changes, include them in the plan.

Co-authored-by: tylerbutler <19589+tylerbutler@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 25, 2025

@copilot Add a document to the "plans" folder covering the opportunities you identified. If you have suggested ways to quickly reduce risk of those changes, include them in the plan.

Added build-tools/plans/dependency-reduction.md in commit deaa741. The document includes:

  • Test coverage assessment for each package
  • Detailed glob library consolidation plan with option mapping table
  • Risk reduction steps including a compatibility wrapper code example for glob migration
  • Recommended integration tests for glob-dependent functionality
  • Phased implementation roadmap

Copilot finished work on behalf of tylerbutler November 25, 2025 20:40
@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants