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
undefinedearly responses. You can now setrequest.earlyResponseand it will respond with anundefinedresponse. 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
Varysupport (#1253) Breaking Change - Add in support to skip encoding when
Cache-Control: no-transformis used (#1252) breaking Change
http-content-negotiation
No change
http-cors
- The default
originis nowundefined, defaulting to a secure state. Breaking Change - Remove options (requestHeaders, requestMethods) to set request headers that are unused by the browser.
Vary: originnow applied when more than one possible origin.
http-error-handler
No change
http-event-normalizer
No change
http-header-normalizer
rawHeadersis 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
qswithnode: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