Releases: ardatan/whatwg-node
Release list
July 29, 2025
@whatwg-node/node-fetch@0.7.24
Patch Changes
-
#2643
941e5ce
Thanks @ardatan! - In case of iterator cancellation, ensure the
response stream a.k.a.IncomingMessageis properly closed.const response = await fetch('http://localhost:3000/stream') for await (const chunk of response.body) { console.log('Received chunk:', chunk) if (chunk === 'stop') { console.log('Stopping stream') // In case of `break` which calls the `iterator.return()`, we need to ensure the stream is closed properly. break } }
July 28, 2025
July 17, 2025
May 22, 2025
May 20, 2025
@whatwg-node/fetch@0.10.8
Patch Changes
-
#2424
28c4ad9
Thanks @ardatan! - Performance optimizations- Avoid creating
AbortControllerandAbortSignalif not needed withnew Requestbecause it
is expensive - Avoid creating a map for
Headersand try to re-use the init object forHeadersfor
performance with a single-linewriteHead. - Avoid creating
Bufferforstringbodies for performance - Use
setHeaderswhich acceptsHeaderssince Node 18 if needed to forwardHeadersto Node
- Avoid creating
-
Updated dependencies
[28c4ad9]:- @whatwg-node/node-fetch@0.7.21
@whatwg-node/node-fetch@0.7.21
Patch Changes
-
#2424
28c4ad9
Thanks @ardatan! - Performance optimizations- Avoid creating
AbortControllerandAbortSignalif not needed withnew Requestbecause it
is expensive - Avoid creating a map for
Headersand try to re-use the init object forHeadersfor
performance with a single-linewriteHead. - Avoid creating
Bufferforstringbodies for performance - Use
setHeaderswhich acceptsHeaderssince Node 18 if needed to forwardHeadersto Node
- Avoid creating
@whatwg-node/server@0.10.9
Patch Changes
-
#2424
28c4ad9
Thanks @ardatan! - Performance optimizations- Avoid creating
AbortControllerandAbortSignalif not needed withnew Requestbecause it
is expensive - Avoid creating a map for
Headersand try to re-use the init object forHeadersfor
performance with a single-linewriteHead. - Avoid creating
Bufferforstringbodies for performance - Use
setHeaderswhich acceptsHeaderssince Node 18 if needed to forwardHeadersto Node
- Avoid creating
-
1642a76
Thanks @ardatan! - Remove unnecessary workaround for Bun -
Updated dependencies
[28c4ad9]:- @whatwg-node/fetch@0.10.8
May 16, 2025
May 16, 2025
May 10, 2025
@whatwg-node/fetch@0.10.7
Patch Changes
-
#2383
9527e8f
Thanks @ardatan! - Some implementations likecompressionnpm
package do not implementresponse.write(data, callback)signature, but whatwg-node/server waits
for it to finish the response stream. Then it causes the response stream hangs when the
compression package takes the stream over when the response data is larger than its threshold.It is actually a bug in
compressionpackage;
expressjs/compression#46 But since it is a
common mistake, we prefer to workaround this on our end.Now after calling
response.write, it no longer uses callback but first it checks the result;if it is
true, it means stream is drained and we can callresponse.endimmediately. else if it
isfalse, it means the stream is not drained yet, so we can wait for thedrainevent to call
response.end. -
Updated dependencies
[9527e8f]:- @whatwg-node/node-fetch@0.7.19
@whatwg-node/node-fetch@0.7.19
Patch Changes
-
#2383
9527e8f
Thanks @ardatan! - Some implementations likecompressionnpm
package do not implementresponse.write(data, callback)signature, but whatwg-node/server waits
for it to finish the response stream. Then it causes the response stream hangs when the
compression package takes the stream over when the response data is larger than its threshold.It is actually a bug in
compressionpackage;
expressjs/compression#46 But since it is a
common mistake, we prefer to workaround this on our end.Now after calling
response.write, it no longer uses callback but first it checks the result;if it is
true, it means stream is drained and we can callresponse.endimmediately. else if it
isfalse, it means the stream is not drained yet, so we can wait for thedrainevent to call
response.end. -
Updated dependencies
[d86b4f3]:- @whatwg-node/promise-helpers@1.3.2
@whatwg-node/promise-helpers@1.3.2
Patch Changes
- #2408
d86b4f3
Thanks @slagiewka! - Reuse fake promise Symbol
@whatwg-node/server@0.10.6
Patch Changes
-
#2383
9527e8f
Thanks @ardatan! - Some implementations likecompressionnpm
package do not implementresponse.write(data, callback)signature, but whatwg-node/server waits
for it to finish the response stream. Then it causes the response stream hangs when the
compression package takes the stream over when the response data is larger than its threshold.It is actually a bug in
compressionpackage;
expressjs/compression#46 But since it is a
common mistake, we prefer to workaround this on our end.Now after calling
response.write, it no longer uses callback but first it checks the result;if it is
true, it means stream is drained and we can callresponse.endimmediately. else if it
isfalse, it means the stream is not drained yet, so we can wait for thedrainevent to call
response.end. -
Updated dependencies
[d86b4f3,
9527e8f]:- @whatwg-node/promise-helpers@1.3.2
- @whatwg-node/fetch@0.10.7
April 14, 2025
@whatwg-node/server@0.10.5
Patch Changes
b9f3629
Thanks @enisdenjo! - dependencies updates:- Updated dependency
@whatwg-node/fetch@^0.10.6↗︎
(from^0.10.5, independencies)
- Updated dependency
April 14, 2025
@whatwg-node/fetch@0.10.6
Patch Changes
- #2310
f699a1b
Thanks @enisdenjo! - dependencies updates:- Updated dependency
@whatwg-node/node-fetch@^0.7.18↗︎
(from^0.7.11, independencies)
- Updated dependency