Skip to content

Update dependency astro-compressor to v2 - #12

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/astro-compressor-2.x
Open

renovate[bot] wants to merge 1 commit into
mainfrom
renovate/astro-compressor-2.x

Conversation

@renovate

@renovate renovate Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Change Age Confidence
astro-compressor ^0.4.1^2.0.0 age confidence

Release Notes

sondr3/astro-compressor (astro-compressor)

v2.0.1

Compare Source

v2.0.1

2026-09-14

Summary

A complete, but backwards compatible rewrite of the internals of the library. The internal
workflow has gone from a Promise-based main loop to a worker pool based main loop to offload
compression to worker threads. This has yielded a ~2x performance increase. A hook-based system
has also been added to give more flexibility and customizability should you need to hook into
per-file, per-format options or ignoring files per format.

Performance

The underlying machinery for compressing was changed from a Promise-based per-format x file
main loop to a worker thread pool that offloads the compression from the main thread to workers
while keeping IO on the main thread. The primary reason for this is that even with Promise.all
the compressors are limited by the libuv threadpool size so you don't get unlimited concurreny.

Based on the default pnpm create astro@latest setup with a [n].astro page generated
a set amount of times, on my M1 Max machine the performance benchmark looks like this:

#num pages v1 v2 diff speedup
100 553ms 253ms -300ms 2.19x
1000 5.33s 2.31s -3.02ds 2.31x
5000 25.77s 11.00s -14.77ds 2.34x
10000 51.46s 22.03s -29.43ds 2.34x
What happened to 2.0.0?

I didn't realize npm does not publish symlinked files and thus the release had no
README when published... 🤦

Commits
  • [1ea4829] Add note about 2.0.1
  • [ed94c95] Move README to lib, symlink in other direction
  • [494ccd1] Bump dependencies
  • [45e06b2] Bump to v2.0.0-rc.1
  • [3d37c9e] Mention that 'inputSize' and 'outputSize' are in bytes
  • [f187610] Use a resolved 'filePath: string' instead of Dirent in 'fileFilter'
  • [d839062] Add missing exports, update README slightly
  • [acce808] 'exports' field to handle exports properly
  • [06ad506] Bump to v2.0.0-rc.0
  • [3e0af97] Use TS config in happy path tests to catch stuff like this
  • [462ea50] Whoops, allow user to pass no options again
  • [13e299f] Add some notes to the changelog
  • [cb2bf08] Re-enable only running CI against main or PRs
  • [74fdd35] Fix fileOptions hook example
  • [31b2640] Bump to v2-beta
  • [feaab39] Whoops, forgot to type check
  • [e29efbe] Refactor fileOptions hook due to types being useless
  • [19dcf94] Update README and documentation
  • [62ba83b] Move types around, rename and de-generify
  • [ece9588] Rename and refactor hooks
  • [00ea934] Continue, not return, whoops
  • [6682808] Run all compressors per file instead of compressor x file
  • [5dba758] 'Order' compressors so tests still pass
  • [d67dc52] Rework queueTask to a queue class, add back compressed counter
  • [62fe746] Correct log output for hook shimming, early return if all compressors disabled
  • [782bbb8] Fix some crashes in WorkerPool
  • [49bbae7] Experiment with worker threads for actual parallelism
  • [0925980] Skip files with compressed extensions outright when finding files
  • [272a424] Run tests only on source files, up timeout
  • [4c8a78f] Create a bunch more integration tests
  • [7906c3d] Fix conditional access of deprecated options
  • [919ba42] Merge hook result type into one
  • [af8d248] Better handling of post compression hook
  • [35ad8ab] Always throw in try/catch in main code
  • [b9114f6] Fix stray ' b' sneaking in file sizes
  • [364b1cb] Handle pre compression hook with old 'fileExtensions'
  • [81089ce] Deep merge hooks in plugin init too
  • [fffd528] Filter out everything besides files, whoops
  • [b593b61] Set node version to v24
  • [40a97e3] Initiate compressor when running to avoid zstd crashing on Node v22
  • [8985a29] Add back deprecated options with logging warnings
  • [5320a58] Add astro check to test build
  • [b5f7771] Deep merge compressor options at construction
  • [ccae937] Swap back to per-compressor worker loops, slightly faster
  • [ffe5825] Add logging for compressed files
  • [6de46cb] Drop unused batchSize, old compress functions
  • [96445de] Use a worker pool instead of batch sizes and such
  • [ed7d76c] Use worker to gather files, wrap in try/catch to avoid swallowing errors
  • [505cfe7] Eh, just log everything in the worker constructor
  • [7f62d0b] Disable lint for overridden methods not using 'this'
  • [7d89972] Split things out into classes
  • [add3526] Handle enabled formats better, log them
  • [a405a8e] Fix #/foo imports
  • [5d3a1fe] Minor beauty fix
  • [28d4344] Change hook return types, implement post hook
  • [cb2cd7f] Initial WIP of hooks instead of extension based input filtering
  • [bff8ef3] Build package with dev for better feedback loop
  • [a31a466] Enable optional chaining
  • [992179d] Fix output changing in pnpm v1 in the tests
  • [c76551d] Run CI on all push for now
  • [82595e4] Upgrade to pnpm v11
  • [aa79713] Lock down CI actions
  • [a3693b5] Use my personal oxfmt/oxlint configs
  • [f9b6f6a] Use fs.readdir directly instead of walkdir generator
  • [e9bc6d3] Upgrade dependencies, refactor TS setup for v7
  • [56efc6c] Bump pnpm/action-setup from 6.0.10 to 6.1.0
  • [90fe7ea] Bump pnpm/action-setup from 6.0.9 to 6.0.10
  • [8c02d43] Bump actions/setup-node from 6 to 7
  • [75f7c30] Bump actions/checkout from 6 to 7
  • [c7e7289] Bump pnpm/action-setup from 6.0.8 to 6.0.9
  • [55d1ae6] Bump pnpm/action-setup from 6.0.7 to 6.0.8
  • [b9d01e3] Bump pnpm/action-setup from 6.0.5 to 6.0.7
  • [e66ea4c] Bump pnpm/action-setup from 6.0.4 to 6.0.5
  • [c12602a] Bump pnpm/action-setup from 6.0.3 to 6.0.4
  • [1f77ca3] Move CHANGELOG, link README to lib
  • [9e22030] Move everything to a monorepo to fix install issues
  • [49e4172] Bump pnpm to 10.33, fix approve builds error
  • [80543d4] Bump pnpm/action-setup from 5.0.0 to 6.0.3
  • [ec4fe52] Upgrade packages
  • [ced43e2] Bump pnpm/action-setup from 4.4.0 to 5.0.0
  • [5581383] Bump pnpm/action-setup from 4.3.0 to 4.4.0
  • [0fd3c65] Bump pnpm/action-setup from 4.2.0 to 4.3.0

v2.0.0

Compare Source

v2.0.0

2026-09-14

Summary

A complete, but backwards compatible rewrite of the internals of the library. The internal
workflow has gone from a Promise-based main loop to a worker pool based main loop to offload
compression to worker threads. This has yielded a ~2x performance increase. A hook-based system
has also been added to give more flexibility and customizability should you need to hook into
per-file, per-format options or ignoring files per format.

Performance

The underlying machinery for compressing was changed from a Promise-based per-format x file
main loop to a worker thread pool that offloads the compression from the main thread to workers
while keeping IO on the main thread. The primary reason for this is that even with Promise.all
the compressors are limited by the libuv threadpool size so you don't get unlimited concurreny.

Based on the default pnpm create astro@latest setup with a [n].astro page generated
a set amount of times, on my M1 Max machine the performance benchmark looks like this:

#num pages v1 v2 diff speedup
100 553ms 253ms -300ms 2.19x
1000 5.33s 2.31s -3.02ds 2.31x
5000 25.77s 11.00s -14.77ds 2.34x
10000 51.46s 22.03s -29.43ds 2.34x
Commits
  • [494ccd1] Bump dependencies
  • [45e06b2] Bump to v2.0.0-rc.1
  • [3d37c9e] Mention that 'inputSize' and 'outputSize' are in bytes
  • [f187610] Use a resolved 'filePath: string' instead of Dirent in 'fileFilter'
  • [d839062] Add missing exports, update README slightly
  • [acce808] 'exports' field to handle exports properly
  • [06ad506] Bump to v2.0.0-rc.0
  • [3e0af97] Use TS config in happy path tests to catch stuff like this
  • [462ea50] Whoops, allow user to pass no options again
  • [13e299f] Add some notes to the changelog
  • [cb2bf08] Re-enable only running CI against main or PRs
  • [74fdd35] Fix fileOptions hook example
  • [31b2640] Bump to v2-beta
  • [feaab39] Whoops, forgot to type check
  • [e29efbe] Refactor fileOptions hook due to types being useless
  • [19dcf94] Update README and documentation
  • [62ba83b] Move types around, rename and de-generify
  • [ece9588] Rename and refactor hooks
  • [00ea934] Continue, not return, whoops
  • [6682808] Run all compressors per file instead of compressor x file
  • [5dba758] 'Order' compressors so tests still pass
  • [d67dc52] Rework queueTask to a queue class, add back compressed counter
  • [62fe746] Correct log output for hook shimming, early return if all compressors disabled
  • [782bbb8] Fix some crashes in WorkerPool
  • [49bbae7] Experiment with worker threads for actual parallelism
  • [0925980] Skip files with compressed extensions outright when finding files
  • [272a424] Run tests only on source files, up timeout
  • [4c8a78f] Create a bunch more integration tests
  • [7906c3d] Fix conditional access of deprecated options
  • [919ba42] Merge hook result type into one
  • [af8d248] Better handling of post compression hook
  • [35ad8ab] Always throw in try/catch in main code
  • [b9114f6] Fix stray ' b' sneaking in file sizes
  • [364b1cb] Handle pre compression hook with old 'fileExtensions'
  • [81089ce] Deep merge hooks in plugin init too
  • [fffd528] Filter out everything besides files, whoops
  • [b593b61] Set node version to v24
  • [40a97e3] Initiate compressor when running to avoid zstd crashing on Node v22
  • [8985a29] Add back deprecated options with logging warnings
  • [5320a58] Add astro check to test build
  • [b5f7771] Deep merge compressor options at construction
  • [ccae937] Swap back to per-compressor worker loops, slightly faster
  • [ffe5825] Add logging for compressed files
  • [6de46cb] Drop unused batchSize, old compress functions
  • [96445de] Use a worker pool instead of batch sizes and such
  • [ed7d76c] Use worker to gather files, wrap in try/catch to avoid swallowing errors
  • [505cfe7] Eh, just log everything in the worker constructor
  • [7f62d0b] Disable lint for overridden methods not using 'this'
  • [7d89972] Split things out into classes
  • [add3526] Handle enabled formats better, log them
  • [a405a8e] Fix #/foo imports
  • [5d3a1fe] Minor beauty fix
  • [28d4344] Change hook return types, implement post hook
  • [cb2cd7f] Initial WIP of hooks instead of extension based input filtering
  • [bff8ef3] Build package with dev for better feedback loop
  • [a31a466] Enable optional chaining
  • [992179d] Fix output changing in pnpm v1 in the tests
  • [c76551d] Run CI on all push for now
  • [82595e4] Upgrade to pnpm v11
  • [aa79713] Lock down CI actions
  • [a3693b5] Use my personal oxfmt/oxlint configs
  • [f9b6f6a] Use fs.readdir directly instead of walkdir generator
  • [e9bc6d3] Upgrade dependencies, refactor TS setup for v7
  • [56efc6c] Bump pnpm/action-setup from 6.0.10 to 6.1.0
  • [90fe7ea] Bump pnpm/action-setup from 6.0.9 to 6.0.10
  • [8c02d43] Bump actions/setup-node from 6 to 7
  • [75f7c30] Bump actions/checkout from 6 to 7
  • [c7e7289] Bump pnpm/action-setup from 6.0.8 to 6.0.9
  • [55d1ae6] Bump pnpm/action-setup from 6.0.7 to 6.0.8
  • [b9d01e3] Bump pnpm/action-setup from 6.0.5 to 6.0.7
  • [e66ea4c] Bump pnpm/action-setup from 6.0.4 to 6.0.5
  • [c12602a] Bump pnpm/action-setup from 6.0.3 to 6.0.4
  • [1f77ca3] Move CHANGELOG, link README to lib
  • [9e22030] Move everything to a monorepo to fix install issues
  • [49e4172] Bump pnpm to 10.33, fix approve builds error
  • [80543d4] Bump pnpm/action-setup from 5.0.0 to 6.0.3
  • [ec4fe52] Upgrade packages
  • [ced43e2] Bump pnpm/action-setup from 4.4.0 to 5.0.0
  • [5581383] Bump pnpm/action-setup from 4.3.0 to 4.4.0
  • [0fd3c65] Bump pnpm/action-setup from 4.2.0 to 4.3.0

v1.3.0

Compare Source

v1.3.0

2026-03-04

Summary

This release adds better default compression for zstd and brotli, and better
handling of compression options. Thanks to @​Daniel15 for this contribution.

Commits

v1.2.0

Compare Source

1.2.0

2025-10-15

Summary

This release adds support for configuring the compression algorithms directly
instead of just a boolean flag for more advanced usage. It also includes a
optimized file searching by only traversing the output directory once.

Commits

v1.1.2

Compare Source

v1.1.2

2025-08-06

Summary

Documentation update to mention zstd compression alongside other compression algorithms.

Commits
  • [c9d3fd7] Mention zstd alongside other compression algorithms

v1.1.1

Compare Source

v1.1.1

2025-07-30

Summary

Bug fix for gracefully handling Node versions without zstd compression.

Commits
  • [9855701] Gracefully fall back when zstd is not supported
  • [9fdc219] Set the engines to proper versions

v1.1.0

Compare Source

v1.1.0

2025-07-28

Summary

Thanks to @​Alex-1701, astro-compressor now also supports zstd compression.

Commits
  • [c3082cc] Update README, set 'engines' field in package.json
  • [f851c2b] Add lefthook to approved builds
  • [b644541] Infer pnpm version from package.json
  • [31f61a0] Upgrade dependencies
  • [9110521] Add zstd (#​19)
  • [4b1e3c3] Bump pnpm/action-setup from 4.0.0 to 4.1.0
  • [a69e499] Only publish from one CI

v1.0.0

Compare Source

v1.0.0

2024-11-28

Summary

The main change is that the compression is now batch parallelized to speed up
compression for larger sites and the custom logger was replaced with the Astro
logger. Bumped packages and moved from ESLint/Prettier to Biome.

Commits
  • [8892cf1] Use AstroIntegrationLogger over custom logger
  • [4853f21] Update README
  • [2b9a0ab] Run CI against latest and LTS NodeJS
  • [2150125] Extract out compression login to shared function
  • [e7bc27d] Parallelize and batch process files
  • [8c56e05] And run correct lint tasks in CI
  • [18cdd9c] Use pnpm@​9 in CI
  • [3d55b57] Bump remaining packages
  • [b2ed13e] Bump typescript, use @​tsconfig/bases packages for config
  • [e28eb3a] Add test step to CI
  • [ce437bd] Add a test site to run integration tests against
  • [0db2b37] Remove prettier and eslint, move to biome
  • [f125d43] Bump pnpm/action-setup from 3.0.0 to 4.0.0
  • [633c1a9] Bump pnpm/action-setup from 2.4.0 to 3.0.0
  • [ec3bff9] Bump actions/setup-node from 3 to 4

Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

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.

0 participants