v1.8.0 - Towards the Edge of the Web!
note
Checkout the blog article for release notes and more information.
🚀 Enhancements
- Support Web Streams (#432)
- Add
event.method
andevent.headers
(#429) - Support blob responses (#422)
- Web responses with streaming support (#436)
readBody
: Validate requests withapplication/json
content type (#207)- event: Support
event.url
(#455) event:event.body
with readable stream (#457)event:event.request
getter to access web request (#454)- Add
readFormData
util (#421) - proxy: Stream request body with
streamRequest
option (#374) readValidatedBody
andgetValidatedQuery
utils (#459)- Add
removeResponseHeader
andclearResponseHeaders
utils (#427) - Add event handler generics for typed request body and query (#417)
- app: Handle Bigint return types (#474)
- Preserve and make error cause accessable (#479)
- Platform agnostic
serveStatic
utility (#480) - app:
onRequest
,onBeforeResponse
andonAfterResponse
global hooks (#482) plain
andweb
adapters (#483)- Object-syntax event handlers (#485)
- event: Add default stringify with method and url for better DX (#493)
- Support react pipeable streams (#494)
- router: Expose
event.context.matchedRoute
(#500) - web: Add
fromWebHandler
(#490) - Support
fromPlainHandler
(bc2ca33) - Add
getRequestIP
util (#503) defineRequestMidleware
,defineResponseMiddleware
and rename object synctax hooks (#507)
🩹 Fixes
- proxy: Handle responses with no content (#433)
- Split
set-cookie
value when handling web responses (#445) - defineLazyEventHandler: Infer return type (#442)
- proxy: Respect
fetchOptions.method
over incoming request method (#441) - Append
set-cookie
headers in web reponse (#453) - proxy: Avoid decoding request body as utf8 (#440)
- readMultipartFormData: Handle utf8 encoding for
name
andfilename
(#416) - event: Do not remove double slashes from query (#462)
- router: Fallback for method-shadowed routes (#461)
- proxy: Transparently forward errors when passing ofetch (#466)
- Keep backward compatibility with
event.node.req.url
(#471) - getRequestPath: Avoid double normalization (0181d33)
- app: Handle directly
node.res.end()
returned value (7b18fa0) - stream: Improve Node.js redable stream check (cdd2680)
- proxy: Merge overriden headers with different case (#476)
- readbody: Accept additional options for urlencoded header (#437)
- app: Throw error when trying to return function or symbol as response (6e58103)
- app: Use default error handler if
onError
does not handles reponse (#478) - proxyRequest: Only attempt to read body if incoming request can contain body (a26579f)
- app: Make sure resolved val is also not undefined before calling hooks (cfe397e)
- app: Use
response.body
instead of initial returned val (0434358) - Make request and response types explicit (#489)
- web: Use
null
for null body responses (#495) - sanitizeStatusCode: Input is optional (67a4132)
- sendNoContent: Avoid overriding status code if event is already handled (3f6d99e)
- router: Use default behavior for no-content handling (e3c9f96)
💅 Refactors
- app:: Split return type conditions (#434)
- Use
event.path
instead ofevent.node.req.url
for internal utils (#438) - Type
event.node.req.originalUrl
(6c87d87) - Alias
isEventHandler
toisEvent
(#452) - app: Extract handler returned response handling (#473)
- event: Always normalize
event.method
(7585861) - Deprecate
getMethod
to preferevent.method
(bc202c0) - event: Use
sendWebResponse
forevent.respondWith
(#481) - app: Use
sendNoContent
for null handling (a72a4b8) event: Renameevent.body
toevent.rawBody
(563313d)- Cleanup event interface (#506)
📖 Documentation
- Update link to how it works (3dd2376)
- Split readme into subsection and document missing helpers (#428)
- Improve nightly release usage section (#468)
- Fix
deleteCookie
description (#487) - Add link to example for nested routers (0968902)
- Add valibot to community packages (#491)
🏡 Chore
- Add autofix ci (e359f5f)
- Online stackblitz playground (#451)
- Setup nightly releases (#467)
- Add
release-rc
script (98d2fa5)
✅ Tests
- proxy: Disable keep alive to run faster (8783ab6)
- proxy: Avoid consuming body in interceptor (b960a74)
- Add polyfills to run all tests against node.js 16 (#456)
- proxy: Remove external request to speedup (d4f5440)
- Add EvetHandler wrapper (d351ba9)
❤️ Contributors
- Pooya Parsa (@pi0)
- Harlan Wilton (@harlan-zw)
- Iain Sproat
- Daniel Roe [email protected]
- Michel EDIGHOFFER [email protected]
- Conner (@Intevel)
- Heb (@Hebilicious)
- Arkadiusz Sygulski [email protected]
- Zhiyuanzmj
- Ngob [email protected]
- Emīls Gulbis (@emilsgulbis)
- Tobias Diez [email protected]
- Javad Mnjd (@jd1378)
- Hebilicious (@Hebilicious)
- Valentin Dzhankhotov [email protected]