Skip to content

Conversation

@ardatan
Copy link
Owner

@ardatan ardatan commented Nov 10, 2025

Fixes #2909

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 10, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Zstandard (zstd) compression format now supported for improved data compression options.
  • Chores

    • Patched @whatwg-node/node-fetch and @whatwg-node/server packages.
    • Enhanced compression format detection system.

Walkthrough

Adds Zstandard (zstd) compression support and centralizes zlib usage: new getSupportedFormats(), zstd handling in CompressionStream/DecompressionStream/fetchNodeHttp, fallback encoding update in server utils, and a changeset documenting patches and the feature.

Changes

Cohort / File(s) Summary
Compression stream updates
packages/node-fetch/src/CompressionStream.ts
Added 'zstd' to PonyfillCompressionFormat, switched supportedFormats to getSupportedFormats(), refactored to default zlib import and use zlib.createZstdCompress() branch.
Decompression stream updates
packages/node-fetch/src/DecompressionStream.ts
Replaced per-function zlib imports with default zlib import, use zlib.createZstdDecompress() for 'zstd', and set static supportedFormats = getSupportedFormats().
HTTP fetch handling
packages/node-fetch/src/fetchNodeHttp.ts
Replaced named zlib imports with default zlib namespace and added handling for 'zstd' via zlib.createZstdDecompress() in content-encoding path.
Utilities — format detection
packages/node-fetch/src/utils.ts
New exported getSupportedFormats() that returns supported compression formats including conditional 'deflate-raw' and conditional 'zstd' when available.
Server utils encoding list
packages/server/src/utils.ts
Added 'zstd' to fallback encoding list used by getSupportedEncodings when DecompressionStream formats are unavailable.
Changeset
.changeset/pink-sites-trade.md
Documents patch bumps for @whatwg-node/node-fetch and @whatwg-node/server and notes the zstd feature addition.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Server
    participant FetchLayer
    participant zlib

    Client->>Server: Request (Accept-Encoding: zstd, br, gzip)
    Server->>FetchLayer: choose CompressionStream('zstd')
    FetchLayer->>zlib: zlib.createZstdCompress()
    zlib-->>FetchLayer: Compression stream
    FetchLayer-->>Server: compressed response stream
    Server-->>Client: send zstd-compressed response

    Client->>Server: receives zstd-compressed response
    Server->>FetchLayer: DecompressionStream('zstd')
    FetchLayer->>zlib: zlib.createZstdDecompress()
    zlib-->>FetchLayer: Decompression stream
    FetchLayer-->>Server: decompressed data
    Server-->>Client: deliver decompressed payload
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Files needing focused review:
    • CompressionStream.ts / DecompressionStream.ts — correct selection and error handling for 'zstd' branch.
    • getSupportedFormats() — node-version and runtime capability checks (zlib.createZstdCompress existence).
    • fetchNodeHttp.ts — integration of zstd decompression into existing content-encoding handling.

Suggested reviewers

  • enisdenjo

Poem

🐰 I hopped through streams both quick and neat,

Zstd joined gzip and Brotli's beat,
Smaller bytes and faster flight,
New compressions gleam in moonlit night,
A rabbit cheers for code complete.

Pre-merge checks and finishing touches

✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: zstd support' directly matches the main objective of the PR, which is to add Zstandard compression support.
Description check ✅ Passed The description references issue #2909, which is directly related to adding zstd support as detailed in the changeset.
Linked Issues check ✅ Passed The code changes successfully implement zstd support across multiple files: added 'zstd' to PonyfillCompressionFormat, integrated zlib.createZstdCompress/Decompress, added getSupportedFormats() utility, and updated all relevant compression/decompression streams.
Out of Scope Changes check ✅ Passed All changes are directly related to adding zstd support. The refactoring to use namespace imports and getSupportedFormats() are supporting changes necessary for the feature implementation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch zstd-support

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a399c57 and 4652b77.

📒 Files selected for processing (3)
  • packages/node-fetch/src/CompressionStream.ts (1 hunks)
  • packages/node-fetch/src/DecompressionStream.ts (1 hunks)
  • packages/node-fetch/src/utils.ts (2 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
packages/node-fetch/src/utils.ts (1)
packages/node-fetch/src/CompressionStream.ts (1)
  • PonyfillCompressionFormat (5-12)
packages/node-fetch/src/CompressionStream.ts (3)
packages/node-fetch/src/index.ts (2)
  • PonyfillCompressionStream (22-22)
  • PonyfillTransformStream (21-21)
packages/node-fetch/src/TransformStream.ts (1)
  • PonyfillTransformStream (6-77)
packages/node-fetch/src/utils.ts (1)
  • getSupportedFormats (132-141)
packages/node-fetch/src/DecompressionStream.ts (3)
packages/node-fetch/src/TransformStream.ts (1)
  • PonyfillTransformStream (6-77)
packages/node-fetch/src/CompressionStream.ts (1)
  • PonyfillCompressionFormat (5-12)
packages/node-fetch/src/utils.ts (1)
  • getSupportedFormats (132-141)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: node-fetch (noConsumeBody)
  • GitHub Check: node-fetch (consumeBody)
  • GitHub Check: server (uws)
  • GitHub Check: server (undici)
  • GitHub Check: server (native)
  • GitHub Check: server (ponyfill)
  • GitHub Check: e2e / cloudflare-workers
  • GitHub Check: e2e / aws-lambda
  • GitHub Check: e2e / cloudflare-modules
  • GitHub Check: unit / deno
  • GitHub Check: unit / node 24
  • GitHub Check: unit / node 25
  • GitHub Check: unit / bun
  • GitHub Check: unit / node 20
  • GitHub Check: unit / node 18
🔇 Additional comments (11)
packages/node-fetch/src/utils.ts (2)

3-4: LGTM!

Clean imports for the new compression format support functionality.


132-141: Verify the deflate-raw version check logic.

The zstd capability check using zlib.createZstdCompress != null is correct and future-proof.

However, the deflate-raw version check at line 134 appears problematic. The condition !globalThis.process?.versions?.node?.startsWith('2') excludes deflate-raw for Node.js v20-v29 (since process.versions.node returns strings like "20.0.0"). This means:

  • Node v20-v29: deflate-raw is excluded
  • Node v10-v19 and v30+: deflate-raw is included

This logic seems incorrect. Please clarify:

  1. Was this intended to exclude specific Node versions from deflate-raw support?
  2. Should this use a runtime capability check similar to zstd (e.g., zlib.createDeflateRaw != null)?
  3. Or is there a known issue with deflate-raw in Node v20-v29 that justifies this exclusion?

Consider using a runtime capability check for consistency and future-proofing:

-  if (!globalThis.process?.versions?.node?.startsWith('2')) {
+  if (zlib.createDeflateRaw != null) {
     baseFormats.push('deflate-raw');
   }
packages/node-fetch/src/CompressionStream.ts (5)

1-1: LGTM!

Namespace import of zlib provides cleaner access to compression methods.


3-3: LGTM!

Centralized format detection via getSupportedFormats() promotes consistency across compression/decompression implementations.


12-12: LGTM!

Zstandard format added to the type union appropriately.


18-18: LGTM!

Using getSupportedFormats() for runtime format detection correctly addresses the previous review concern about version checking. The function uses capability detection (zlib.createZstdCompress != null) rather than version string parsing, making it future-proof.


36-38: LGTM!

Zstd compression case follows the established pattern consistently. The runtime capability check in getSupportedFormats() ensures this branch is only reachable when zstd is available.

packages/node-fetch/src/DecompressionStream.ts (4)

1-1: LGTM!

Namespace import of zlib maintains consistency with CompressionStream.ts.


4-4: LGTM!

Consistent use of centralized format detection.


10-10: LGTM!

Static initialization mirrors CompressionStream.ts, ensuring symmetric compress/decompress format support.


28-30: LGTM!

Zstd decompression case properly complements the compression implementation, completing the bidirectional zstd support.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@whatwg-node/node-fetch 0.8.3-alpha-20251110163100-4652b77de1cf710e75445db45d91cdf62127a39f npm ↗︎ unpkg ↗︎
@whatwg-node/server 0.10.16-alpha-20251110163100-4652b77de1cf710e75445db45d91cdf62127a39f npm ↗︎ unpkg ↗︎

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/node-fetch results (noConsumeBody)

   ✓ active_handles.................: avg=139.253773 min=12     med=139     max=191      p(90)=161     p(95)=169    
     data_received..................: 23 MB  777 kB/s
     data_sent......................: 15 MB  503 kB/s
     http_req_blocked...............: avg=2.44µs     min=611ns  med=1.58µs  max=4.45ms   p(90)=2.09µs  p(95)=2.48µs 
     http_req_connecting............: avg=466ns      min=0s     med=0s      max=3.24ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=19.62ms    min=1.99ms med=19.05ms max=978.65ms p(90)=25.66ms p(95)=27.68ms
       { expected_response:true }...: avg=19.62ms    min=1.99ms med=19.05ms max=978.65ms p(90)=25.66ms p(95)=27.68ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 152297
     http_req_receiving.............: avg=36.2µs     min=9.44µs med=26.12µs max=27.32ms  p(90)=40.9µs  p(95)=49.08µs
     http_req_sending...............: avg=12.61µs    min=3.35µs med=7.99µs  max=15.23ms  p(90)=11.02µs p(95)=16.32µs
     http_req_tls_handshaking.......: avg=0s         min=0s     med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=19.57ms    min=1.96ms med=19.01ms max=978.59ms p(90)=25.61ms p(95)=27.6ms 
     http_reqs......................: 152297 5075.640897/s
     iteration_duration.............: avg=39.36ms    min=8.55ms med=37.97ms max=993.53ms p(90)=43.3ms  p(95)=48.32ms
     iterations.....................: 76127  2537.103913/s
     vus............................: 2      min=2         max=100 
     vus_max........................: 100    min=100       max=100 

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/node-fetch results (consumeBody)

   ✓ active_handles.................: avg=138.765272 min=13     med=138     max=190      p(90)=162     p(95)=168    
     data_received..................: 32 MB  1.1 MB/s
     data_sent......................: 21 MB  682 kB/s
     http_req_blocked...............: avg=1.88µs     min=490ns  med=1.11µs  max=14.68ms  p(90)=1.85µs  p(95)=2.26µs 
     http_req_connecting............: avg=245ns      min=0s     med=0s      max=1.58ms   p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=14.31ms    min=1.65ms med=13.83ms max=717.46ms p(90)=18.63ms p(95)=21.28ms
       { expected_response:true }...: avg=14.31ms    min=1.65ms med=13.83ms max=717.46ms p(90)=18.63ms p(95)=21.28ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 208699
     http_req_receiving.............: avg=28.94µs    min=7.86µs med=19.64µs max=19.36ms  p(90)=33.17µs p(95)=39.66µs
     http_req_sending...............: avg=10.26µs    min=2.69µs med=6.24µs  max=20.85ms  p(90)=9.59µs  p(95)=12.34µs
     http_req_tls_handshaking.......: avg=0s         min=0s     med=0s      max=0s       p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=14.27ms    min=1.6ms  med=13.8ms  max=717.39ms p(90)=18.59ms p(95)=21.2ms 
     http_reqs......................: 208699 6955.971517/s
     iteration_duration.............: avg=28.73ms    min=5.54ms med=27.4ms  max=736.61ms p(90)=33.45ms p(95)=36.6ms 
     iterations.....................: 104342 3477.735782/s
     vus............................: 100    min=100       max=100 
     vus_max........................: 100    min=100       max=100 

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/server results (undici)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 182628      ✗ 0    
     data_received..................: 18 MB   606 kB/s
     data_sent......................: 14 MB   454 kB/s
     http_req_blocked...............: avg=1.67µs   min=951ns    med=1.64µs   max=288.03µs p(90)=2.02µs   p(95)=2.24µs  
     http_req_connecting............: avg=1ns      min=0s       med=0s       max=143.18µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=251.94µs min=185.17µs med=236.96µs max=62.74ms  p(90)=271.09µs p(95)=286.71µs
       { expected_response:true }...: avg=251.94µs min=185.17µs med=236.96µs max=62.74ms  p(90)=271.09µs p(95)=286.71µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 91314
     http_req_receiving.............: avg=26.36µs  min=15.01µs  med=25.02µs  max=2.72ms   p(90)=30.88µs  p(95)=33.95µs 
     http_req_sending...............: avg=9.54µs   min=5.67µs   med=9.55µs   max=275.15µs p(90)=11.7µs   p(95)=13.62µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=216.03µs min=155.83µs med=202.14µs max=62.66ms  p(90)=233.78µs p(95)=248.28µs
     http_reqs......................: 91314   3043.667664/s
     iteration_duration.............: avg=323.89µs min=246.42µs med=307.65µs max=62.9ms   p(90)=345.07µs p(95)=364.25µs
     iterations.....................: 91314   3043.667664/s
     vus............................: 1       min=1         max=1  
     vus_max........................: 1       min=1         max=1  

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/server results (native)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 196236      ✗ 0    
     data_received..................: 20 MB   651 kB/s
     data_sent......................: 15 MB   487 kB/s
     http_req_blocked...............: avg=1.58µs   min=922ns    med=1.56µs   max=226.15µs p(90)=1.97µs   p(95)=2.16µs  
     http_req_connecting............: avg=1ns      min=0s       med=0s       max=116.24µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=231.72µs min=168.33µs med=219.53µs max=65.22ms  p(90)=249.89µs p(95)=263.52µs
       { expected_response:true }...: avg=231.72µs min=168.33µs med=219.53µs max=65.22ms  p(90)=249.89µs p(95)=263.52µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 98118
     http_req_receiving.............: avg=25.99µs  min=14.65µs  med=24.68µs  max=3.32ms   p(90)=30.29µs  p(95)=33.45µs 
     http_req_sending...............: avg=9.24µs   min=5.5µs    med=9.36µs   max=1.33ms   p(90)=11.21µs  p(95)=12.78µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=196.48µs min=143.13µs med=185.36µs max=65.14ms  p(90)=213.55µs p(95)=226.21µs
     http_reqs......................: 98118   3269.387817/s
     iteration_duration.............: avg=301.33µs min=228.57µs med=288.09µs max=65.39ms  p(90)=321.47µs p(95)=337.94µs
     iterations.....................: 98118   3269.387817/s
     vus............................: 1       min=1         max=1  
     vus_max........................: 1       min=1         max=1  

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/server results (ponyfill)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 298788      ✗ 0     
     data_received..................: 29 MB   981 kB/s
     data_sent......................: 22 MB   742 kB/s
     http_req_blocked...............: avg=1.25µs   min=654ns    med=1.12µs   max=250.17µs p(90)=1.58µs   p(95)=1.87µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=120.4µs  p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=134.08µs min=80.51µs  med=129.29µs max=6.09ms   p(90)=154.32µs p(95)=162.66µs
       { expected_response:true }...: avg=134.08µs min=80.51µs  med=129.29µs max=6.09ms   p(90)=154.32µs p(95)=162.66µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 149394
     http_req_receiving.............: avg=21.37µs  min=8.47µs   med=19.88µs  max=2.72ms   p(90)=28.06µs  p(95)=31.04µs 
     http_req_sending...............: avg=6.87µs   min=3.67µs   med=6.25µs   max=573.07µs p(90)=9.39µs   p(95)=11.28µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=105.83µs min=59.97µs  med=101.29µs max=5.94ms   p(90)=123.18µs p(95)=130.53µs
     http_reqs......................: 149394  4979.590848/s
     iteration_duration.............: avg=196.75µs min=123.15µs med=192µs    max=6.47ms   p(90)=221.33µs p(95)=231.88µs
     iterations.....................: 149394  4979.590848/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

@benchmarks/server results (uws)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 249676      ✗ 0     
     data_received..................: 21 MB   695 kB/s
     data_sent......................: 19 MB   620 kB/s
     http_req_blocked...............: avg=1.53µs   min=872ns    med=1.47µs   max=242.88µs p(90)=1.93µs   p(95)=2.08µs  
     http_req_connecting............: avg=0ns      min=0s       med=0s       max=108.65µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=166.49µs min=114.06µs med=157.61µs max=19.79ms  p(90)=178.63µs p(95)=186.35µs
       { expected_response:true }...: avg=166.49µs min=114.06µs med=157.61µs max=19.79ms  p(90)=178.63µs p(95)=186.35µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 124838
     http_req_receiving.............: avg=23.3µs   min=12.55µs  med=22.03µs  max=3.05ms   p(90)=27.34µs  p(95)=29.88µs 
     http_req_sending...............: avg=9.07µs   min=5.54µs   med=9.27µs   max=363.22µs p(90)=11.09µs  p(95)=12.83µs 
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=134.11µs min=85.43µs  med=126.05µs max=19.71ms  p(90)=144.52µs p(95)=151.76µs
     http_reqs......................: 124838  4161.115272/s
     iteration_duration.............: avg=235.8µs  min=168.39µs med=225.68µs max=19.95ms  p(90)=251.01µs p(95)=261.12µs
     iterations.....................: 124838  4161.115272/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
packages/node-fetch/src/fetchNodeHttp.ts (1)

39-39: Critical: Add 'zstd' to the accept-encoding header.

The accept-encoding header needs to include 'zstd' to advertise client support for Zstandard compression. Without this, servers won't send zstd-compressed responses even though the client can now decompress them.

Apply this diff to add zstd to the accept-encoding header:

-      nodeHeaders['accept-encoding'] ||= 'gzip, deflate, br';
+      nodeHeaders['accept-encoding'] ||= 'gzip, deflate, br, zstd';
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9bd4e66 and a399c57.

📒 Files selected for processing (5)
  • .changeset/pink-sites-trade.md (1 hunks)
  • packages/node-fetch/src/CompressionStream.ts (3 hunks)
  • packages/node-fetch/src/DecompressionStream.ts (2 hunks)
  • packages/node-fetch/src/fetchNodeHttp.ts (2 hunks)
  • packages/server/src/utils.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-01-29T19:45:36.028Z
Learnt from: ardatan
Repo: ardatan/whatwg-node PR: 0
File: :0-0
Timestamp: 2025-01-29T19:45:36.028Z
Learning: The node-fetch package tries different fetch implementations in the following order: 1) node-libcurl 2) undici 3) built-in undici in Node 4) node:http as fallback

Applied to files:

  • .changeset/pink-sites-trade.md
  • packages/node-fetch/src/fetchNodeHttp.ts
🧬 Code graph analysis (1)
packages/node-fetch/src/DecompressionStream.ts (1)
packages/node-fetch/src/CompressionStream.ts (1)
  • PonyfillCompressionFormat (4-11)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (15)
  • GitHub Check: server (native)
  • GitHub Check: server (uws)
  • GitHub Check: node-fetch (consumeBody)
  • GitHub Check: node-fetch (noConsumeBody)
  • GitHub Check: server (ponyfill)
  • GitHub Check: server (undici)
  • GitHub Check: e2e / cloudflare-modules
  • GitHub Check: e2e / cloudflare-workers
  • GitHub Check: e2e / aws-lambda
  • GitHub Check: unit / node 18
  • GitHub Check: unit / node 20
  • GitHub Check: unit / bun
  • GitHub Check: unit / node 25
  • GitHub Check: unit / node 24
  • GitHub Check: unit / deno
🔇 Additional comments (5)
.changeset/pink-sites-trade.md (1)

1-6: LGTM!

The changeset documentation correctly identifies the affected packages and clearly describes the new zstd support feature.

packages/server/src/utils.ts (1)

525-531: Addition of zstd encoding looks correct.

The 'zstd' encoding is properly added to the list of possible encodings and will be tested for support at runtime along with the other compression formats.

packages/node-fetch/src/fetchNodeHttp.ts (1)

4-4: Import refactor and zstd decompression support look correct.

The switch from named imports to the default zlib import is applied consistently, and the zstd decompression case follows the same pattern as the existing compression formats.

Also applies to: 78-93

packages/node-fetch/src/CompressionStream.ts (1)

1-1: Import refactor and zstd compression support implemented correctly.

The default zlib import is used consistently, and the zstd compression case properly integrates with the existing compression format handling.

Also applies to: 10-11, 27-41

packages/node-fetch/src/DecompressionStream.ts (1)

1-1: Import refactor and zstd decompression support implemented correctly.

The default zlib import and zstd decompression case are consistent with the compression stream implementation. Note that the same version check consideration from CompressionStream.ts applies here as well.

Also applies to: 12-12, 19-33

@ardatan ardatan merged commit 0079afd into master Nov 10, 2025
26 checks passed
@ardatan ardatan deleted the zstd-support branch November 10, 2025 20:41
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.

Add support for Zstandard compression

2 participants