Skip to main content

Upgrade 6.x -> 7.x

aka "Lambda goes durable"

Version 7.x of Middy no longer supports Node.js versions 20.x. You are highly encouraged to move to Node.js 24.x.

Notable changes

  • Add support for Durable Functions, caused breaking changes to streamifyResponse.
  • LLRT can now be used when using executionModeStandard (default) & executionModeDurableContext
  • Works with new multi-tenant executions
  • Works with new Managed Instance executions

Core

  • Add support for Durable Functions. Will lack support for timeout abort signal at time of release.
  • Deprecate streamifyResponse option for executionMode Breaking Change
import middy from '@middy/core'

const lambdaHandler = (_event, _context) => {
// ...
}
export const handler = middy({ streamifyResponse: true })
.handler(lambdaHandler)

changes to

import middy, { executionModeStreamifyResponse } from '@middy/core'

const lambdaHandler = (_event, _context) => {
// ...
}
export const handler = middy({ executionMode: executionModeStreamifyResponse })
.handler(lambdaHandler)

Util

  • Added in extra utils to support durable context

Middleware

appconfig

No change

cloudwatch-metrics

No change

do-not-wait-for-empty-event-loop

  • Add in support for DurableContext

error-logger

No change

event-normalizer

No change

http-content-encoding

  • Add in zstd support

http-content-negotiation

No change

http-cors

No change

http-error-handler

No change

http-event-normalizer

No change

http-header-normalizer

No change

http-json-body-parser

No change

http-multipart-body-parser

No change

http-partial-response

No change

http-response-serializer

No change

http-router

Updated to handle mixed dynamic/static route priority #1484 Breaking Change

http-security-headers

  • Update poweredBy to always remove, can be disabled Breaking Change
  • Update xssProtection to reflect new best practice (exclude, or 0) Breaking Change

http-urlencode-body-parser

No change

http-urlencode-path-parser

No change

input-output-logger

  • Add in support for DurableContext
  • Add in option executionContext to allow logging of tenantId
  • Renamed option awsContext to lambdaContext Breaking Change

rds-signer

No change

s3-object-response

No change

secrets-manager

No change

service-discovery

No change

sqs-partial-batch-failure

No change

ssm

No change

sts

No change

validator

No change

warmup

No change

ws-json-body-parser

No change

ws-response

No change

ws-router

No change

Notes

None