Skip to content

Releases: ardatan/whatwg-node

February 20, 2025

20 Feb 12:44
e266605
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

@whatwg-node/[email protected]

Patch Changes

  • #2079
    090b4b0
    Thanks @ardatan! - Fix the bug when set-cookies given is ignored
    in HeadersInit;

    import { Headers } from '@whatwg-node/fetch'
    
    const headers = new Headers([
      ['set-cookie', 'a=b'],
      ['set-cookie', 'c=d']
    ])
    expect(headers.getSetCookie()).toEqual(['a=b', 'c=d']) // Previously it was empty

@whatwg-node/[email protected]

Patch Changes

@whatwg-node/[email protected]

Patch Changes

February 14, 2025

14 Feb 15:19
3826dc5
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • #2057
    7d28669
    Thanks @ardatan! - When two plugins use the onResponse hook and
    the first one modifies the response, the second one should get the modified one;

    ;[
      {
        onResponse({ setResponse, fetchAPI }) {
          setResponse(
            fetchAPI.Response.json(
              {
                foo: 'bar'
              },
              { status: 418 }
            )
          )
        }
      },
      {
        onResponse({ response }) {
          console.log(response.status) // 418
        }
      }
    ]

February 13, 2025

13 Feb 12:56
0f6399a
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • #2049
    7c95998
    Thanks @ardatan! - Redirect with correct status codes

  • #2051
    252f68b
    Thanks @ardatan! - Fix crash on null header values during inspect

  • #2009
    5b5ae5f
    Thanks @ardatan! - When fetch('file:///...') is used to read
    files;

    • 404 is returned if the file is missing
    • 403 is returned if the file is not accessible

February 05, 2025

05 Feb 16:11
aecdc2e
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • 337e605
    Thanks @ardatan! - - Use native AbortSignal and AbortController for
    Request.signal
    • Remove custom AbortSignal implementation (ServerAdapterAbortSignal)

@whatwg-node/[email protected]

Patch Changes

  • 337e605
    Thanks @ardatan! - - Use native AbortSignal and AbortController for
    Request.signal
    • Remove custom AbortSignal implementation (ServerAdapterAbortSignal)

January 10, 2025

10 Jan 09:40
02c97ae
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • #1961
    2785c80
    Thanks @ardatan! - ReadableStream's Symbol.asyncIterator now
    returns AsyncIterableIterator like before even if it is ok to return AsyncIterator right now.
    It is safer to return AsyncIterableIterator because it is a common mistake to use
    AsyncIterator as AsyncIterable.
  • Updated dependencies
    [2785c80]:

@whatwg-node/[email protected]

Patch Changes

  • #1961
    2785c80
    Thanks @ardatan! - ReadableStream's Symbol.asyncIterator now
    returns AsyncIterableIterator like before even if it is ok to return AsyncIterator right now.
    It is safer to return AsyncIterableIterator because it is a common mistake to use
    AsyncIterator as AsyncIterable.

January 10, 2025

10 Jan 07:33
6dc3d3f
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

@whatwg-node/[email protected]

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'

December 24, 2024

24 Dec 14:57
fdf8ac0
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • #1926
    bae5de1
    Thanks @ardatan! - While calling handleNodeRequest or
    handleNodeRequestAndResponse, waitUntil is not added automatically as in requestListener for
    Node.js integration. This change adds waitUntil into the serverContext if not present.

    Fixes the issue with Fastify integration that uses the mentioned methods

December 17, 2024

17 Dec 13:51
dd8f5d1
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • #1899
    a84e84a
    Thanks @ardatan! - - New onDispose hook which is alias of
    Symbol.asyncDispose for Explicit Resource Management

    • Registration of the server adapter's disposal to the global process termination listener is now
      opt-in and configurable.
    const plugin: ServerAdapterPlugin = {
      onDispose() {
        console.log('Server adapter is disposed')
      }
    }
    
    const serverAdapter = createServerAdapter(() => new Response('Hello world!'), {
      plugins: [plugin],
      // Register the server adapter's disposal to the global process termination listener
      // Then the server adapter will be disposed when the process exit signals only in Node.js!
      disposeOnProcessTerminate: true
    })
    
    await serverAdapter.dispose()
    // Prints 'Server adapter is disposed'

December 13, 2024

13 Dec 08:28
77f5c26
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes

  • c75e6e3
    Thanks @ardatan! - Export `DisposableSymbols` for disposable
    plugins

December 12, 2024

12 Dec 14:13
6a42223
Compare
Choose a tag to compare

@whatwg-node/[email protected]

Patch Changes