Releases: middyjs/middy
Releases · middyjs/middy
3.0.2
3.0.1
3.0.0
Checkout UPGRADE.md
to see what are the main breaking changes and how to migrate to this new version if coming from 2.x
.
Version 3.x of Middy no longer supports Node.js versions 12.x. You are highly encouraged to move to Node.js 16.x.
With the Node.js version change all packages are now ECMAScript Modules along side CommonJS Modules.
Notable changes
- New WebSocket middlewares
- HTTP & WebSocket Routers!
- Better error handling
- Timeout error handling
- Errors now use
{ cause }
for better context
Additions
- New middleware (
http-content-encoding
,http-router
,service-discovery
,ws-json-body-parser
,ws-response
,ws-router
) core
- Added
.handler()
method to allow easier understanding of the execution cycle - lambdaHandler can now be passed an
AbortController
signal - internal events can now be monitored using
Proxy
- Added
util
getInternal
error now includescause
set to an array of Errors- Catch when
X-Ray
is applied outside of handler invocation scope
Breaking Changes
core
- The order
onError
being called is now reversed to matchafter
- If you only use
@middy/*
middlewares no change should be required - If you have custom error handling middleware or other custom middleware that
return response
, additional testing is high recommended
- If you only use
- Deprecate
applyMiddleware()
and__middlewares
- The order
util
normalizeHttpResponse
now takesrequest
and mutates responsegetCache
will return{}
instead ofundefined
when not found
- Deprecated
setToEnv
option from all middleware - Will now throw error if not an http event in
http-event-normalizer
- Change default charset from
binary
/latin1
toutf-8
withinhttp-multipart-body-parser
- Renamed
default
option todefaultContentType
to improve maintainability inhttp-response-serializer
- Deprecate
expectCt
inhttp-security-headers
sqs-partial-batch-failure
completely rewritten- Renamed
default
option todefaultContentType
http-response-serializer
normalizeHttpResponse
now takesrequest
and mutates response- Change where errors are stored, from
request.error.details
torequest.error.cause
invalidator
Removed
s3-key-normalizer
in favour ofevent-normalizer
sqs-json-body-parser
in favour ofevent-normalizer
Maintenance
- Better error reporting when dealing with Promise arrays
Full Changelog: 2.5.7...3.0.0
2.5.7
Fix publishing transpiling error in 2.5.6
. Thanks to @maximepichou and @rreubenreyes for reporting.
2.5.5
What's Changed
ssm
response errors are now caught and thrown- remove deprecated zh mapping in
validator
@metrue in #764 - Add TS getOrigin to
http-cors
@lucasvieirasilva in #775 - Add flag to disable i18n in
validator
@randomhash in #771
Full Changelog: 2.5.4...2.5.5
2.5.6
What's Changed
fix: add types for non-callback use case #788 @markcarroll
Full Changelog: 2.5.5...2.5.6
2.5.4
What's Changed
- docs: fix typo by @nitinrathi in #752
- Add
middy-event-loop-tracer
,middy-console-logger
andmiddy-invocation
plugins into README by @serkan-ozal in #753 - Move
middy-event-loop-tracer
,middy-console-logger
andmiddy-invocation
middlewares intoVersion 2.x
section in README by @serkan-ozal in #754 - Add
middy-profiler
middleware into community middlewares section in README by @serkan-ozal in #755 - Pass TContext to the onError handler definition by @jbialobr in #761
- feat/types/remove-aws-xray-sdk-deps by @J4YF7O in #749
New Contributors
- @nitinrathi made their first contribution in #752
- @serkan-ozal made their first contribution in #753
- @jbialobr made their first contribution in #761
- @J4YF7O made their first contribution in #749
Full Changelog: 2.5.3...2.5.4
2.5.3
What's Changed
- Fix the return value of PluginHookPromise type by @omer-to in #735
- http-json-body-parser: Add rawBody to event by @domdomegg in #741
New Contributors
- @domdomegg made their first contribution in #741
Full Changelog: 2.5.2...2.5.3
2.5.2
2.5.1
- #704TypeScript: Align types with aws-lambda @denovodavid