Skip to content

Releases: ardatan/whatwg-node

March 25, 2025

25 Mar 12:31
9a12fdc
Compare
Choose a tag to compare

@whatwg-node/node-fetch@0.7.15

Patch Changes

  • #2208
    ff052a3
    Thanks @ardatan! - When any Request method is called outside
    server adapter scope, it used to hang. This PR prevents it to hang and throw an error if the
    readable stream is destroyed earlier.

    let request: Request
    const adapter = createServerAdapter(req => {
      request = req
      return new Response('Hello World')
    })
    
    await request.text() // Was hanging but now throws an error

@whatwg-node/server@0.10.3

Patch Changes

  • #2208
    ff052a3
    Thanks @ardatan! - When any Request method is called outside
    server adapter scope, it used to hang. This PR prevents it to hang and throw an error if the
    readable stream is destroyed earlier.

    let request: Request
    const adapter = createServerAdapter(req => {
      request = req
      return new Response('Hello World')
    })
    
    await request.text() // Was hanging but now throws an error

March 21, 2025

21 Mar 16:26
3533135
Compare
Choose a tag to compare

@whatwg-node/server@0.10.2

Patch Changes

March 19, 2025

19 Mar 10:43
756f573
Compare
Choose a tag to compare

@whatwg-node/node-fetch@0.7.14

Patch Changes

  • 2225af7
    Thanks @ardatan! - Use URL as the constructor name as some
    instrumentations like NewRelic needs it to be

March 17, 2025

17 Mar 15:43
645bd8d
Compare
Choose a tag to compare

@whatwg-node/promise-helpers@1.3.0

Minor Changes

March 17, 2025

17 Mar 13:04
c654f0a
Compare
Choose a tag to compare

@whatwg-node/node-fetch@0.7.13

Patch Changes

  • #2182
    a45e929
    Thanks @ardatan! - Use Array.fromAsync when possible to collect
    values

  • Updated dependencies
    [a45e929]:

    • @whatwg-node/promise-helpers@1.2.5

@whatwg-node/promise-helpers@1.2.5

Patch Changes

  • #2182
    a45e929
    Thanks @ardatan! - - Name functions in iterateAsync for more
    readable traces
    • fakePromise accepts MaybePromise as an input

March 06, 2025

06 Mar 15:43
382c7e1
Compare
Choose a tag to compare

@whatwg-node/server@0.10.1

Patch Changes

March 05, 2025

05 Mar 11:40
26abbb0
Compare
Choose a tag to compare

@whatwg-node/promise-helpers@1.2.4

Patch Changes

  • a448fd1
    Thanks @ardatan! - Do not consider fake promises as real promises

March 05, 2025

05 Mar 10:27
e09387b
Compare
Choose a tag to compare

@whatwg-node/promise-helpers@1.2.3

Patch Changes

  • #2068
    516bf60
    Thanks @EmrysMyrddin! - Fix return type of the callback of
    iterateAsync. The callback can actually return null or undefined, the implementation is
    already handling this case.

@whatwg-node/server@0.10.0

Minor Changes

  • #2068
    516bf60
    Thanks @EmrysMyrddin! - Add new Instruments API

    Introduction of a new API allowing to instrument the graphql pipeline.

    This new API differs from already existing Hooks by not having access to input/output of phases.
    The goal of Instruments is to run allow running code before, after or around the whole process
    of a phase
    , including plugins hooks executions.

    The main use case of this new API is observability (monitoring, tracing, etc...).

    Basic usage

    import Sentry from '@sentry/node'
    import { createServerAdapter } from '@whatwg-node/server'
    
    const server = createServerAdapter(
      (req, res) => {
        //...
      },
      {
        plugins: [
          {
            instruments: {
              request: ({ request }, wrapped) =>
                Sentry.startSpan({ name: 'Graphql Operation' }, async () => {
                  try {
                    await wrapped()
                  } catch (err) {
                    Sentry.captureException(err)
                  }
                })
            }
          }
        ]
      }
    )

    Multiple instruments plugins

    It is possible to have multiple instruments plugins (Prometheus and Sentry for example), they will
    be automatically composed by envelop in the same order than the plugin array (first is outermost,
    last is inner most).

    import { createServerAdapter } from '@whatwg-node/server'
    
    const server = createServerAdapter(
      (req, res) => {
        //...
      },
      { plugins: [useSentry(), useOpentelemetry()] }
    )
    sequenceDiagram
      Sentry->>Opentelemetry: ;
      Opentelemetry->>Server Adapter: ;
      Server Adapter->>Opentelemetry: ;
      Opentelemetry->>Sentry: ;

    Custom instruments ordering

    If the default composition ordering doesn't suite your need, you can manually compose instruments.
    This allows to have a different execution order of hooks and instruments.

    import { composeInstruments, createServerAdapter } from '@whatwg-node/server'
    
    const { instruments: sentryInstruments, ...sentryPlugin } = useSentry()
    const { instruments: otelInstruments, ...otelPlugin } = useOpentelemetry()
    const instruments = composeInstruments([otelInstruments, sentryInstruments])
    
    const server = createServerAdapter(
      (req, res) => {
        //...
      },
      { plugins: [{ instruments }, sentryPlugin, otelPlugin] }
    )
    sequenceDiagram
      Opentelemetry->>Sentry: ;
      Sentry->>Server Adapter: ;
      Server Adapter->>Sentry: ;
      Sentry->>Opentelemetry: ;

Patch Changes

@whatwg-node/server-plugin-cookies@1.0.5

Patch Changes

March 03, 2025

03 Mar 02:25
70b4590
Compare
Choose a tag to compare

@whatwg-node/promise-helpers@1.2.2

Patch Changes

  • #2123
    2ca563a
    Thanks @ardatan! - Use Node 16 at least to prevent breaking change
    on dependent Tools packages

@whatwg-node/server@0.9.71

Patch Changes

  • #2117
    6631a27
    Thanks @ardatan! - Fix the error
    The Request.url getter can only be used on instances of Request when the adapter is used with
    Express on Bun
  • Updated dependencies
    [2ca563a]:
    • @whatwg-node/promise-helpers@1.2.2

February 25, 2025

25 Feb 20:10
6bc11f4
Compare
Choose a tag to compare

@whatwg-node/promise-helpers@1.2.1

Patch Changes

  • a587b3d
    Thanks @ardatan! - Fix the termination of the loop in iterateAsync