Skip to content

Add zstd Compressor#10058

Open
solonovamax wants to merge 1 commit intoparcel-bundler:v2from
solonovamax:v2
Open

Add zstd Compressor#10058
solonovamax wants to merge 1 commit intoparcel-bundler:v2from
solonovamax:v2

Conversation

@solonovamax
Copy link
Contributor

@solonovamax solonovamax commented Dec 25, 2024

Closes #10014

↪️ Pull Request

Adds a zstd compressor, as described in #10014.

I have chosen not to enable this by default, as zstd performs worse than brotli.

💻 Examples

Usage is the same as the brotli and gzip compressors, in your .parcelrc:

 {
   "extends": ["@parcel/config-default"],
   "compressors": {
-    "*": ["...", "@parcel/compressor-gzip", "@parcel/compressor-brotli"]
+    "*": ["...", "@parcel/compressor-gzip", "@parcel/compressor-brotli", "@parcel/compressor-zstd"]
   }
 }

🚨 Test instructions

Tests included as integration tests.

✔️ PR Todo

  • Added/updated unit tests for this change
  • Filled out test instructions (In case there aren't any unit tests)
  • Included links to related issues/PRs

Fixes parcel-bundler#10014

Signed-off-by: solonovamax <solonovamax@12oclockpoint.com>
@solonovamax
Copy link
Contributor Author

I've recently learned that nodejs v23.8.0 introduced a zstd compressor. this would remove the reliance on the extra package & simplify the code a good bit, however would gate the use of this behind being on a rather recent node version.

is this an acceptable trade-off, or can this PR move forward as-is?

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.

Support ZSTD Compressor

1 participant