Upgrade 5.x -> 6.x
aka "The return of CJS, kinda"
Version 6.x of Middy no longer supports Node.js versions 18.x. You are highly encouraged to move to Node.js 22.x.
Notable changes
- Support for
--experimental-require-module
. Introduced into nodejs 20.17, this allows for the import of ESM into CJS codebases, making the migration to ESM easier. See blog post from AWS (https://aws.amazon.com/blogs/compute/node-js-22-runtime-now-available-in-aws-lambda/) on usage.
Core
- Add in mechanise to handle
undefined
early responses. You can now setrequest.earlyResponse
and it will respond with anundefined
response. The existing method will continue to work as expected.
Util
No change
Middleware
appconfig
No change
cloudwatch-metrics
No change
do-not-wait-for-empty-event-loop
No change
error-logger
No change
event-normalizer
No change
http-content-encoding
- Add in
Vary
support (#1253) Breaking Change - Add in support to skip encoding when
Cache-Control: no-transform
is used (#1252) breaking Change
http-content-negotiation
No change
http-cors
- The default
origin
is nowundefined
, defaulting to a secure state. Breaking Change - Remove options (requestHeaders, requestMethods) to set request headers that are unused by the browser.
Vary: origin
now applied when more than one possible origin.
http-error-handler
No change
http-event-normalizer
No change
http-header-normalizer
rawHeaders
is no longer attached toevent
. Breaking Change
http-json-body-parser
No change
http-multipart-body-parser
No change
http-partial-response
No change
http-response-serializer
- deprecate use of
event.requiredContentType
. Breaking Change
http-router
No change
http-security-headers
- Add in support for
Content-Security-Policy-Report-Only
(#1248) - Add in support for
Reporting-Endpoints
(#1249)
http-urlencode-body-parser
- replace use of
qs
withnode:querystring
. Complex nested object are no longer supported. Breaking Change
http-urlencode-path-parser
No change
input-output-logger
No 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