Update dependency astro-compressor to v2 - #12
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.4.1→^2.0.0Release Notes
sondr3/astro-compressor (astro-compressor)
v2.0.1Compare Source
v2.0.1
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 offloadcompression 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 filemain 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.allthe compressors are limited by the libuv threadpool size so you don't get unlimited concurreny.
Based on the default
pnpm create astro@latestsetup with a[n].astropage generateda set amount of times, on my M1 Max machine the performance benchmark looks like this:
What happened to 2.0.0?
I didn't realize
npmdoes not publish symlinked files and thus the release had noREADME when published... 🤦
Commits
1ea4829] Add note about 2.0.1ed94c95] Move README to lib, symlink in other direction494ccd1] Bump dependencies45e06b2] Bump to v2.0.0-rc.13d37c9e] Mention that 'inputSize' and 'outputSize' are in bytesf187610] Use a resolved 'filePath: string' instead of Dirent in 'fileFilter'd839062] Add missing exports, update README slightlyacce808] 'exports' field to handle exports properly06ad506] Bump to v2.0.0-rc.03e0af97] Use TS config in happy path tests to catch stuff like this462ea50] Whoops, allow user to pass no options again13e299f] Add some notes to the changelogcb2bf08] Re-enable only running CI against main or PRs74fdd35] Fix fileOptions hook example31b2640] Bump to v2-betafeaab39] Whoops, forgot to type checke29efbe] Refactor fileOptions hook due to types being useless19dcf94] Update README and documentation62ba83b] Move types around, rename and de-generifyece9588] Rename and refactor hooks00ea934] Continue, not return, whoops6682808] Run all compressors per file instead of compressor x file5dba758] 'Order' compressors so tests still passd67dc52] Rework queueTask to a queue class, add back compressed counter62fe746] Correct log output for hook shimming, early return if all compressors disabled782bbb8] Fix some crashes in WorkerPool49bbae7] Experiment with worker threads for actual parallelism0925980] Skip files with compressed extensions outright when finding files272a424] Run tests only on source files, up timeout4c8a78f] Create a bunch more integration tests7906c3d] Fix conditional access of deprecated options919ba42] Merge hook result type into oneaf8d248] Better handling of post compression hook35ad8ab] Always throw in try/catch in main codeb9114f6] Fix stray ' b' sneaking in file sizes364b1cb] Handle pre compression hook with old 'fileExtensions'81089ce] Deep merge hooks in plugin init toofffd528] Filter out everything besides files, whoopsb593b61] Set node version to v2440a97e3] Initiate compressor when running to avoid zstd crashing on Node v228985a29] Add back deprecated options with logging warnings5320a58] Add astro check to test buildb5f7771] Deep merge compressor options at constructionccae937] Swap back to per-compressor worker loops, slightly fasterffe5825] Add logging for compressed files6de46cb] Drop unused batchSize, old compress functions96445de] Use a worker pool instead of batch sizes and suched7d76c] Use worker to gather files, wrap in try/catch to avoid swallowing errors505cfe7] Eh, just log everything in the worker constructor7f62d0b] Disable lint for overridden methods not using 'this'7d89972] Split things out into classesadd3526] Handle enabled formats better, log thema405a8e] Fix #/foo imports5d3a1fe] Minor beauty fix28d4344] Change hook return types, implement post hookcb2cd7f] Initial WIP of hooks instead of extension based input filteringbff8ef3] Build package with dev for better feedback loopa31a466] Enable optional chaining992179d] Fix output changing in pnpm v1 in the testsc76551d] Run CI on all push for now82595e4] Upgrade to pnpm v11aa79713] Lock down CI actionsa3693b5] Use my personal oxfmt/oxlint configsf9b6f6a] Use fs.readdir directly instead of walkdir generatore9bc6d3] Upgrade dependencies, refactor TS setup for v756efc6c] Bump pnpm/action-setup from 6.0.10 to 6.1.090fe7ea] Bump pnpm/action-setup from 6.0.9 to 6.0.108c02d43] Bump actions/setup-node from 6 to 775f7c30] Bump actions/checkout from 6 to 7c7e7289] Bump pnpm/action-setup from 6.0.8 to 6.0.955d1ae6] Bump pnpm/action-setup from 6.0.7 to 6.0.8b9d01e3] Bump pnpm/action-setup from 6.0.5 to 6.0.7e66ea4c] Bump pnpm/action-setup from 6.0.4 to 6.0.5c12602a] Bump pnpm/action-setup from 6.0.3 to 6.0.41f77ca3] Move CHANGELOG, link README to lib9e22030] Move everything to a monorepo to fix install issues49e4172] Bump pnpm to 10.33, fix approve builds error80543d4] Bump pnpm/action-setup from 5.0.0 to 6.0.3ec4fe52] Upgrade packagesced43e2] Bump pnpm/action-setup from 4.4.0 to 5.0.05581383] Bump pnpm/action-setup from 4.3.0 to 4.4.00fd3c65] Bump pnpm/action-setup from 4.2.0 to 4.3.0v2.0.0Compare Source
v2.0.0
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 offloadcompression 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 filemain 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.allthe compressors are limited by the libuv threadpool size so you don't get unlimited concurreny.
Based on the default
pnpm create astro@latestsetup with a[n].astropage generateda set amount of times, on my M1 Max machine the performance benchmark looks like this:
Commits
494ccd1] Bump dependencies45e06b2] Bump to v2.0.0-rc.13d37c9e] Mention that 'inputSize' and 'outputSize' are in bytesf187610] Use a resolved 'filePath: string' instead of Dirent in 'fileFilter'd839062] Add missing exports, update README slightlyacce808] 'exports' field to handle exports properly06ad506] Bump to v2.0.0-rc.03e0af97] Use TS config in happy path tests to catch stuff like this462ea50] Whoops, allow user to pass no options again13e299f] Add some notes to the changelogcb2bf08] Re-enable only running CI against main or PRs74fdd35] Fix fileOptions hook example31b2640] Bump to v2-betafeaab39] Whoops, forgot to type checke29efbe] Refactor fileOptions hook due to types being useless19dcf94] Update README and documentation62ba83b] Move types around, rename and de-generifyece9588] Rename and refactor hooks00ea934] Continue, not return, whoops6682808] Run all compressors per file instead of compressor x file5dba758] 'Order' compressors so tests still passd67dc52] Rework queueTask to a queue class, add back compressed counter62fe746] Correct log output for hook shimming, early return if all compressors disabled782bbb8] Fix some crashes in WorkerPool49bbae7] Experiment with worker threads for actual parallelism0925980] Skip files with compressed extensions outright when finding files272a424] Run tests only on source files, up timeout4c8a78f] Create a bunch more integration tests7906c3d] Fix conditional access of deprecated options919ba42] Merge hook result type into oneaf8d248] Better handling of post compression hook35ad8ab] Always throw in try/catch in main codeb9114f6] Fix stray ' b' sneaking in file sizes364b1cb] Handle pre compression hook with old 'fileExtensions'81089ce] Deep merge hooks in plugin init toofffd528] Filter out everything besides files, whoopsb593b61] Set node version to v2440a97e3] Initiate compressor when running to avoid zstd crashing on Node v228985a29] Add back deprecated options with logging warnings5320a58] Add astro check to test buildb5f7771] Deep merge compressor options at constructionccae937] Swap back to per-compressor worker loops, slightly fasterffe5825] Add logging for compressed files6de46cb] Drop unused batchSize, old compress functions96445de] Use a worker pool instead of batch sizes and suched7d76c] Use worker to gather files, wrap in try/catch to avoid swallowing errors505cfe7] Eh, just log everything in the worker constructor7f62d0b] Disable lint for overridden methods not using 'this'7d89972] Split things out into classesadd3526] Handle enabled formats better, log thema405a8e] Fix #/foo imports5d3a1fe] Minor beauty fix28d4344] Change hook return types, implement post hookcb2cd7f] Initial WIP of hooks instead of extension based input filteringbff8ef3] Build package with dev for better feedback loopa31a466] Enable optional chaining992179d] Fix output changing in pnpm v1 in the testsc76551d] Run CI on all push for now82595e4] Upgrade to pnpm v11aa79713] Lock down CI actionsa3693b5] Use my personal oxfmt/oxlint configsf9b6f6a] Use fs.readdir directly instead of walkdir generatore9bc6d3] Upgrade dependencies, refactor TS setup for v756efc6c] Bump pnpm/action-setup from 6.0.10 to 6.1.090fe7ea] Bump pnpm/action-setup from 6.0.9 to 6.0.108c02d43] Bump actions/setup-node from 6 to 775f7c30] Bump actions/checkout from 6 to 7c7e7289] Bump pnpm/action-setup from 6.0.8 to 6.0.955d1ae6] Bump pnpm/action-setup from 6.0.7 to 6.0.8b9d01e3] Bump pnpm/action-setup from 6.0.5 to 6.0.7e66ea4c] Bump pnpm/action-setup from 6.0.4 to 6.0.5c12602a] Bump pnpm/action-setup from 6.0.3 to 6.0.41f77ca3] Move CHANGELOG, link README to lib9e22030] Move everything to a monorepo to fix install issues49e4172] Bump pnpm to 10.33, fix approve builds error80543d4] Bump pnpm/action-setup from 5.0.0 to 6.0.3ec4fe52] Upgrade packagesced43e2] Bump pnpm/action-setup from 4.4.0 to 5.0.05581383] Bump pnpm/action-setup from 4.3.0 to 4.4.00fd3c65] Bump pnpm/action-setup from 4.2.0 to 4.3.0v1.3.0Compare Source
v1.3.0
Summary
This release adds better default compression for zstd and brotli, and better
handling of compression options. Thanks to @Daniel15 for this contribution.
Commits
9d97f8a] Use a separate release pipeline09f173b] Run 'pnpm fix' in pre-commit hook34e8ca2] Drop @tsconfig packagesd48d4a9] Force NO_COLOR in tests to avoid ANSI shenanigansf0816b8] Refactor the build setup slightlyff616ca] Move to oxlint and oxfmt98cc08f] Bump all packages, fix type errorsde315e0] Improve handling of default options @Daniel159878779] Set default compression levels for Brotli and zstd @Daniel15f3cf8dc] Bump actions/checkout from 5 to 63330a3c] We now use trusted publishing, remove tokensv1.2.0Compare Source
1.2.0
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
eb123a8] Bump actions/setup-node from 5 to 6aeaa6b0] Bump pnpm/action-setup from 4.1.0 to 4.2.040c660e] Bump actions/setup-node from 4 to 50e77401] Test with bools and objects36050b2] Next prerelease405945b] Fix 'enabled' for brotli and zstd4696d84] Update READMEea30882] Use my new, actual last named578795] Mark as prereleasee95738e] Only find files once instead of per compressor8941c4e] Add @tsconfig/node229731ae9] Add compression options to compressions33c0f46] Bump actions/checkout from 4 to 5v1.1.2Compare Source
v1.1.2
Summary
Documentation update to mention
zstdcompression alongside other compression algorithms.Commits
c9d3fd7] Mention zstd alongside other compression algorithmsv1.1.1Compare Source
v1.1.1
Summary
Bug fix for gracefully handling Node versions without zstd compression.
Commits
9855701] Gracefully fall back when zstd is not supported9fdc219] Set the engines to proper versionsv1.1.0Compare Source
v1.1.0
Summary
Thanks to @Alex-1701,
astro-compressornow also supportszstdcompression.Commits
c3082cc] Update README, set 'engines' field in package.jsonf851c2b] Add lefthook to approved buildsb644541] Infer pnpm version from package.json31f61a0] Upgrade dependencies9110521] Add zstd (#19)4b1e3c3] Bump pnpm/action-setup from 4.0.0 to 4.1.0a69e499] Only publish from one CIv1.0.0Compare Source
v1.0.0
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 logger4853f21] Update README2b9a0ab] Run CI against latest and LTS NodeJS2150125] Extract out compression login to shared functione7bc27d] Parallelize and batch process files8c56e05] And run correct lint tasks in CI18cdd9c] Use pnpm@9 in CI3d55b57] Bump remaining packagesb2ed13e] Bump typescript, use @tsconfig/bases packages for confige28eb3a] Add test step to CIce437bd] Add a test site to run integration tests against0db2b37] Remove prettier and eslint, move to biomef125d43] Bump pnpm/action-setup from 3.0.0 to 4.0.0633c1a9] Bump pnpm/action-setup from 2.4.0 to 3.0.0ec3bff9] Bump actions/setup-node from 3 to 4Configuration
📅 Schedule: (UTC)
🚦 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.
This PR was generated by Mend Renovate. View the repository job log.