Skip to content

January 10, 2025

Choose a tag to compare

@theguild-bot theguild-bot released this 10 Jan 07:33
· 1208 commits to master since this release
6dc3d3f

@whatwg-node/fetch@0.10.2

Patch Changes

@whatwg-node/node-fetch@0.7.6

Patch Changes

  • #1929
    b88b85c
    Thanks @ardatan! - dependencies updates:

  • #1947
    9b39c3e
    Thanks @ardatan! - Remove the event listener on the provided
    AbortSignal when node-libcurl is used, the connection finishes to prevent potential memory
    leaks;

    const res = await fetch(URL, { signal: new AbortController().signal })
    // AbortController is never aborted, and HTTP request is done as expected successfully
  • #1929
    b88b85c
    Thanks @ardatan! - - Remove URL ponyfill implementation based on
    fast-url-parser and fast-querystring, because Node now uses Ada URL parser which is fast
    enough.

    • Fix ReadableStream[Symbol.asyncIterator]

    ReadableStream uses Readable so it uses Symbol.asyncIterator method of Readable but the
    returned iterator's .return method doesn't handle cancellation correctly. So we need to call
    readable.destroy(optionalError) manually to cancel the stream.

    This allows ReadableStream to use implementations relying on AsyncIterable.cancel to handle
    cancellation like Readable.from

    Previously the following was not handling cancellation;

    const res = new ReadableStream({
      start(controller) {
        controller.enqueue('Hello')
        controller.enqueue('World')
      },
      cancel(reason) {
        console.log('cancelled', reason)
      }
    })
    
    const readable = Readable.from(res)
    
    readable.destroy(new Error('MY REASON'))
    
    // Should log 'cancelled MY REASON'