Skip to content

Latest commit

 

History

History
1382 lines (825 loc) · 55 KB

CHANGELOG.md

File metadata and controls

1382 lines (825 loc) · 55 KB

Changelog

All notable changes to this project will be documented in this file. See standard-version for commit guidelines.

v1.11.1

compare changes

🩹 Fixes

  • ws: Resolve pathname for matching (4f211f8)

📖 Documentation

🏡 Chore

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.11.0

compare changes

🚀 Enhancements

  • Add utilities for server sent events (#586)
  • response: Add sendIterable util (#655)
  • Handler resolver (#669)
  • Websocket support (#671)

🩹 Fixes

  • serveStatic: Ensure etag header is set before sending 304 response (#653)

📖 Documentation

  • Add basic jsdocs for utils (c8aa150)
  • Fix typo (#668)
  • Fix typos (#665)
  • Fix typo (#662)
  • Fix typos (#661)
  • Fix import name (#658)
  • examples/from-expressjs-to-h3: Add node middleware usage (#663)
  • Refine function usages (#667)
  • Remove unwanted console.log (#675)
  • Add jsdoc examples (#672)
  • Update jsdocs example for route utils (#673)

🏡 Chore

❤️ Contributors

v1.10.2

compare changes

🩹 Fixes

  • proxy: Ignore incoming accept header (#646)

❤️ Contributors

v1.10.1

compare changes

🩹 Fixes

  • setResponseHeaders: Fix types to allow partial header names (#607)
  • setCookie: Allow cookies with the same name but different options (#606)
  • getRequestWebStream: Reuse buffered body if available (#616)
  • getSession: Use semaphore lock for unseal operation (#612)
  • getRequestIP: Use first address of x-forwarded-for header (#618)
  • Avoid setting default content-type for responses with 304 status (#641)

💅 Refactors

  • Use H3Event.node.res for internal types (#626)

📖 Documentation

  • Fix getRequestHeaders signuture (#613)
  • Fix typo in examples (#631)

🏡 Chore

✅ Tests

❤️ Contributors

v1.10.0

compare changes

🚀 Enhancements

  • validate: Provide validate error in data (#594)

🩹 Fixes

  • readRawBody: Check req.rawBody before req.body (#604)

📖 Documentation

  • Add h3-compression to community packages (#524)
  • Add examples (#539)

🌊 Types

  • Add generics to isError and update DataT default generic param (#582)
  • setResponseHeaders: Add autocompletion for header names (#601)

🏡 Chore

🤖 CI

  • Fix nightly release job conditional (#587)

❤️ Contributors

v1.9.0

compare changes

🚀 Enhancements

  • Support auto complete for http header names (#542)
  • Add getValidatedRouterParams util (#573)
  • decode option for getRouterParam (#556)
  • Add getRequestFingerprint util (#564)

🩹 Fixes

  • sendNoContent: Preserve custom status code if already set (#577)

📖 Documentation

  • Add @intlify/h3 to community packages (#559)
  • Improve jsdocs (#574)
  • Add package pronunciation (#569)

🌊 Types

  • Add generics to H3Error data and createError (#566)

🏡 Chore

❤️ Contributors

v1.8.2

compare changes

🩹 Fixes

  • getRequestProtocol: Conditionally check connection?.encrypted (#532)

🏡 Chore

❤️ Contributors

  • Pooya Parsa (@pi0)
  • Michael J. Roberts

v1.8.1

compare changes

🩹 Fixes

  • Use safe property checks (#521)

💅 Refactors

  • Use native Headers and Response for legacy polyfills (#523)

📖 Documentation

  • Typo for getValidatedQuery (164f68e)

🏡 Chore

✅ Tests

  • proxy: Add additional test to make sure json response is sent as is (#512)

❤️ Contributors

v1.8.0

compare changes

🚀 Enhancements

  • router: Expose event.context.matchedRoute (#500)
  • web: Add fromWebHandler (#490)
  • Support fromPlainHandler (bc2ca33)
  • Util getRequestIP (#503)
  • defineRequestMidleware, defineResponseMiddleware and rename object synctax hooks (#507)

🩹 Fixes

  • 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: Use sendNoContent for null handling (a72a4b8)
  • event: Rename event.body to event.rawBody (563313d)
  • Cleanup event interface (#506)
  • Rename beforeResponse to onBeforeResponse (7cebec2)

🏡 Chore

🎨 Styles

  • Format all repo with prettier (ffab809)

❤️ Contributors

v1.8.0-rc.3

compare changes

🚀 Enhancements

  • Object-syntax event handlers (#485)
  • event: Add default stringify with method and url for better dx (#493)
  • Support react pipeable streams (#494)

🩹 Fixes

  • 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)

📖 Documentation

  • Fix deleteCookie description (#487)

🏡 Chore

  • Update dependencies (21a2c6c)
  • Update playground (7cb2de6)
  • Update listhen (7fc1d8b)
  • Add valibot to community packages (#491)

🎨 Styles

  • Format with prettier v3 (da225b9)

❤️ Contributors

v1.8.0-rc.2

compare changes

🚀 Enhancements

  • app: Handle bigint return types (#474)
  • Preserve and make error cause accessible (#479)
  • Platform agnostic serveStatic utility (#480)
  • app: onRequest, onBeforeResponse and onAfterResponse global hooks (#482)
  • plain and web adapters (#483)

🩹 Fixes

  • app: Handle directly node.res.end() returned value (7b18fa0)
  • stream: Improve node.js readable stream check (cdd2680)
  • proxy: Merge overridden 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 response (#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)

💅 Refactors

  • app: Extract handler returned response handling (#473)
  • event: Always normalize event.method (7585861)
  • Deprecate getMethod to prefer event.method (bc202c0)
  • event: Use sendWebResponse for event.respondWith (#481)

🏡 Chore

  • Remove extra log in tests (06d1bc1)

✅ Tests

  • proxy: Remove external request to speedup (d4f5440)
  • Add evetHandler wrapper (d351ba9)

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.8.0-rc.1

compare changes

🩹 Fixes

  • Revert #452 (#452)

🏡 Chore

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.8.0-rc.0

compare changes

🚀 Enhancements

  • Support web streams (#432)
  • Add event.method and event.headers (#429)
  • Support blob responses (#422)
  • Web responses with streaming support (#436)
  • readBody: Validate requests with application/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 and getValidatedQuery utils (#459)
  • Add removeResponseHeader and clearResponseHeaders utils (#427)
  • Add event handler generics for typed request body and query (#417)

🩹 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 response (#453)
  • proxy: Avoid decoding request body as utf8 (#440)
  • readMultipartFormData: Handle utf8 encoding for name and filename (#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)

💅 Refactors

  • app:: Split return type conditions (#434)
  • Use event.path instead of event.node.req.url for internal utils (#438)
  • Type event.node.req.originalUrl (6c87d87)
  • Alias isEventHandler to isEvent (#452)

📖 Documentation

  • Update link to how it works (3dd2376)
  • Split readme into subsection and document missing helpers (#428)
  • Improve nightly release usage section (#468)

🏡 Chore

  • Ignore eslint warning (4c609b2)
  • release: V1.7.1 (7273ab4)
  • Add autofix ci (e359f5f)
  • Online stackblitz playground (#451)
  • Add link to example for nested routers (0968902)
  • Setup nightly releases (#467)

✅ 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)

🤖 CI

  • Use conventional commits for autofix (#470)

❤️ Contributors

v1.7.1

compare changes

🩹 Fixes

  • fetchWithEvent: Allow customizing fetch impl type (#414)

💅 Refactors

  • Improve H3Error (#415)

📖 Documentation

  • Update link to how it works (3dd2376)

🏡 Chore

❤️ Contributors

v1.7.0

compare changes

🚀 Enhancements

  • proxy: Support onResponse callback (#368)
  • useSession: Support custom session id generator (#390)
  • event.handled flag (#410)

🩹 Fixes

  • types: Type for get router parameter utils (#400)
  • proxy: Split cookie headers properly with native node fetch (#408)
  • readRawBody: Handle body as object (#403)
  • router: Send 204 with empty string in preemptive mode instead of 404 (#409)
  • cache, proxy, response: Avoid sending handled events (#411)

📖 Documentation

  • Add event as first arg for proxyRequest (3e5f427)

🏡 Chore

❤️ Contributors

v1.6.6

compare changes

🩹 Fixes

  • getRequestURL: Normalize double slashes (b5d2972)
  • getRequestURL: Make x-forwarded-host support opt-in (2fce169)
  • event: Normalize event.path (981c89f)

🏡 Chore

✅ Tests

  • Add tests for getRequestURL (d510483)

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.6.5

compare changes

🩹 Fixes

  • readRawBody: Resolve cached promise before normalizing buffer (2e472e8)

🏡 Chore

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.6.4

compare changes

🩹 Fixes

  • readRawBody: Always return buffer without encoding (19d133d)

❤️ Contributors

  • Pooya Parsa (@pi0)

v1.6.3

compare changes

🩹 Fixes

  • readBody, readRawBody: Handle raw body as buffer (#366)

📖 Documentation

  • Missing parentheses (#362)

🏡 Chore

❤️ Contributors

v1.6.2

compare changes

🩹 Fixes

  • setResponseStatus: Mark code type as optional (#359)
  • Sanitize utils and sanitize all response code and messages (#358)

❤️ Contributors

v1.6.1

compare changes

🩹 Fixes

  • Sanitize statusMessage of disallowed chars (#357)

❤️ Contributors

v1.6.0

compare changes

🚀 Enhancements

  • Expose splitCookiesString utility (#343)
  • getRequestHost, getRequestProtocol and getRequestURL utils (#351)

🩹 Fixes

  • clearSession: Accept partial session config (#328)
  • useSession: Add types for data property (#346)
  • fetchWithEvent: Handle undefined init (c84c811)

🏡 Chore

  • Replace deprecated methods in test and jsdocs (#341)
  • Fix lint error (#342)
  • readme: Update badges (7afa753)
  • readme: Use correct link (a5e9fcd)
  • Update dev dependencies (f0075c7)

❤️ Contributors

v1.5.0

compare changes

🚀 Enhancements

  • Add cors utils (#322)
  • proxy: Support cookieDomainRewrite and cookiePathRewrite (#313)

🩹 Fixes

  • proxy: Separate multiple cookie headers (#319)

📖 Documentation

  • Update build status badge url (#331)

🌊 Types

  • Export MultiPartData (#332)

🏡 Chore

  • Improve lint npm script (#329)
  • Update ufo dependency (bdca859)

❤️ Contributors

v1.4.0

compare changes

🚀 Enhancements

  • Session support improvements (#325)

❤️ Contributors

v1.3.0

compare changes

🚀 Enhancements

  • fetchWithEvent and getProxyRequestHeaders utils (#323)

🩹 Fixes

  • proxy: Handle consumed responses (#321)
  • proxy: Handle consumed json body (#324)

💅 Refactors

  • session: Use upstream iron-webcrypto (a4b6f0d)

🌊 Types

  • proxy: Req can be url too (e13663b)
  • session: Session data values can be any pojo passing to JSON.stringify (22d116c)

❤️ Contributors

v1.2.1

compare changes

📦 Build

  • Inline iron-webcrypto to remove buffer polyfill (c50505b)

🏡 Chore

❤️ Contributors

v1.2.0

compare changes

🚀 Enhancements

  • Session support (#315)

🩹 Fixes

  • setCookie: Override existing set-cookie header with same name (#316)
  • proxy: Add host to ignored headers (d4f863f)

📖 Documentation

  • Improvements (#297)

✅ Tests

  • Replace useCookies with parseCookies in test (#314)

❤️ Contributors

v1.1.0

compare changes

🚀 Enhancements

  • Utils to get and set response status (c8b4d85)
  • Add readMultipartFormData to parse multipart/form-data (#280)
  • AddsendNoContent utility to create a 204 response (#250)

🏡 Chore

  • Add full mit text for multipart util (42cfb99)

❤️ Contributors

v1.0.2

compare changes

🩹 Fixes

  • Correct types for readRawBody (#277)
  • readBody: Handle top-level arrays in url-encoded data (#278)

💅 Refactors

  • Update @deprecated comment (#245)
  • createRouter: Deprecate misspelled preemptive option (#256)

📖 Documentation

  • Fix deprecated methods (#238)

🏡 Chore

  • Add section to readme for community packages (#262)
  • Update eslint config (0812e81)
  • Format with prettier (a0e21c1)
  • Fix type issue (a9b3187)

✅ Tests

  • Fix legacy middleware test (408f3f2)

❤️ Contributors

1.0.1 (2022-11-15)

1.0.0 (2022-11-15)

⚠ BREAKING CHANGES

  • drop deprecated util aliases

Features

Bug Fixes

  • import type from correct location (#219) (8b89f39)

  • router: throw 404 for intermediate matches (43db151)

  • drop deprecated util aliases (dc8ee81)

0.7.17 (2022-08-30)

Bug Fixes

  • sendRedirect: always encode location uri (01476ac)

0.7.16 (2022-08-23)

Bug Fixes

  • context type for CompatibilityRequestProps (#164) (984a42b)
  • added missing patch router method (#166) (dff2211)

0.7.15 (2022-08-10)

Bug Fixes

  • createError: preserve original error stack (#161) (8213421)
  • don not log errors when onError is provided (#162) (ccc9c7e)

0.7.14 (2022-08-08)

Features

0.7.13 (2022-08-01)

Features

  • send 204 response if null is returned from handler (#154) (dbd465f)
  • sendRedirect: add refresh meta fallback for static generated responses (#153) (606de3b)

0.7.12 (2022-07-21)

Bug Fixes

  • isError: use __h3_error__ class property to detect error (968bfee)

0.7.11 (2022-07-21)

Features

  • createError: support fatal and unhandled (#148) (8579f1c)

Bug Fixes

  • handleCacheHeaders: add max-age to the final object (#142) (991d099)

0.7.10 (2022-06-17)

0.7.9 (2022-06-10)

Features

Bug Fixes

0.7.8 (2022-05-04)

Bug Fixes

  • handle typed H3Response (62aebf8)

0.7.7 (2022-05-04)

Bug Fixes

  • disable typecheck for h3 response (resolves #112) (8db0195)

0.7.6 (2022-04-29)

Bug Fixes

  • types: nullables object props for response (#111) (182b224)

0.7.5 (2022-04-27)

Bug Fixes

0.7.4 (2022-04-14)

Bug Fixes

  • handleCacheHeaders: small improvements (4fb9745)

0.7.3 (2022-04-12)

Features

  • router: allow registering multiple methods at once (#92) (c26bd46)

0.7.2 (2022-04-08)

Features

  • add generic response type support for eventHandler (6fcdc22)

Bug Fixes

  • add missing PATCH method to types (#88) (884460b)

0.7.1 (2022-04-07)

Bug Fixes

  • router: compatibility matched params (07930bc)

0.7.0 (2022-04-07)

⚠ BREAKING CHANGES

  • move router params to event.context.params

  • move router params to event.context.params (6fe32e2)

0.6.0 (2022-04-06)

⚠ BREAKING CHANGES

  • set default path for setCookie to /

Features

  • set default path for setCookie to / (1bd6a45)

0.5.7 (2022-04-06)

Bug Fixes

  • remove ServerResponse from CompatibilityEvent possibilities (b285659)

0.5.6 (2022-04-06)

Features

  • handleCacheHeaders utility (4a71a3f)

Bug Fixes

  • add params to compatibility layer for req (63dd55c)

0.5.5 (2022-04-04)

Features

0.5.4 (2022-04-01)

Bug Fixes

  • throw wrapped error with legacy middleware (27e9477)

0.5.3 (2022-03-31)

Features

  • useBody: support application/x-www-form-urlencoded (73f090b), closes #44

Bug Fixes

  • initialise res.req (#80) (57db02d)
  • revert back support for legacy middleware (b3e4f5b)

0.5.2 (2022-03-31)

Bug Fixes

  • add [h3] prefix to console error (2f4859c)
  • improve writableEnded guard (ba5084c)
  • make console error for thrown unknown errors (1552219)
  • skip built-in error handler if onError provided (2c25aa1)

0.5.1 (2022-03-29)

Features

  • expose toNodeHandle and add backward compat with layer as handle (54a944c)
  • support lazy event handlers (333a4ca)
  • typecheck handler to be a function (38493eb)

Bug Fixes

  • add missing types export (53f0b58)
  • refine toNodeHandle type as we always return promise (1ba6019)

0.5.0 (2022-03-29)

⚠ BREAKING CHANGES

  • All handle exports and properties are renamed to handler with some backward compatibilities.
  • Legacy handlers are promisified by default
  • opt-in using event format using defineEventHandler (#74)

Features

  • app: use node handler signature (c722091)
  • opt-in using event format using defineEventHandler (#74) (cdf9b7c)

Bug Fixes

  • check for null data for stream detection (#69) (70f03fe)

  • router issue with query params (#77) (#78) (229964e)

  • router: req.params compatibility (1d9fca0)

  • use events api for utils with compatibility layer (#75) (2cf0f4b)

0.4.2 (2022-03-16)

Features

Bug Fixes

  • send: add explicit return type (2736b3a)

0.4.1 (2022-03-11)

Features

Bug Fixes

  • allow returning, number and boolean as well (#65) (9a01465)
  • use cookie-es to avoid esm bundling issues (ceedbbc)

0.4.0 (2022-03-09)

⚠ BREAKING CHANGES

  • update repo

Features

0.3.9 (2022-01-18)

Bug Fixes

  • don't lowercase routes when normalizing layers (#60) (5bb05ce)

0.3.8 (2021-12-04)

Bug Fixes

  • useBody: allow body with DELETE method (resolves #50) (bd90f66)

0.3.7 (2021-12-01)

Bug Fixes

  • unenv uses req.body prop (a31d12f)

0.3.6 (2021-12-01)

Features

  • assert method is valid before attempting to read body (92f67f0)

Bug Fixes

  • avoid race-condition for calling useBody on same rew (0633804)
  • handle body with falsy values (6236fc2)

0.3.5 (2021-11-24)

Bug Fixes

  • useBody: support req._body (0d0cd61)

0.3.4 (2021-11-24)

Features

  • useMethod/isMethod/assertMethod (c45278d)
  • add defineHandle and defineMiddleware type helpers (#47) (8260887)

0.3.3 (2021-10-14)

0.3.2 (2021-10-14)

0.3.1 (2021-09-09)

Bug Fixes

  • return 'false' and 'null' values as JSON strings (#33) (5613c54)

0.3.0 (2021-07-27)

⚠ BREAKING CHANGES

  • useAsync is removed. use use instead

Features

  • automatically promisify legacyMiddleware with use (2805d4c), closes #27
  • handle returned errors (closes #28) (991fcff)

0.2.12 (2021-07-02)

Features

0.2.11 (2021-06-23)

Bug Fixes

  • createError fallback to statusMessage (#25) (2f792f5)

0.2.10 (2021-04-21)

Bug Fixes

  • fallback for setImmediate (6cf61f6)

0.2.9 (2021-04-06)

Bug Fixes

  • resolve handle when send was called (fb58e5b)

0.2.8 (2021-03-27)

Bug Fixes

  • app: custom options passed to useAsync (3c328a4)

0.2.7 (2021-03-27)

0.2.6 (2021-03-27)

0.2.5 (2021-02-19)

0.2.4 (2021-01-22)

Bug Fixes

  • always restore req.url for each layer to avoid mutation (aae5787)

0.2.3 (2021-01-20)

Bug Fixes

  • improve internal error handling (b38d450)

0.2.2 (2021-01-20)

Bug Fixes

  • capture stacktrace from createError (1441784)
  • handle thrown errors by each layer (62fd25a)

0.2.1 (2021-01-12)

0.2.0 (2020-12-15)

⚠ BREAKING CHANGES

  • rename useBodyJSON to useBody and unexposed cached value

Features

  • useCookie, useCookies and setCookie utilities (088f413), closes #17
  • appendHeader utility (84be904)
  • rename useBodyJSON to useBody and unexposed cached value (d8d39a0)

0.0.15 (2020-12-12)

Features

Bug Fixes

  • don't override internal flag (a5ee318)
  • hide 404 error (38fb027)
  • preserve error message in console (3002b27)

0.0.14 (2020-12-05)

Bug Fixes

  • app: handle buffer (09c9c6d)
  • utils: avoid setting falsy type (df5e92b)

0.0.13 (2020-12-05)

Bug Fixes

  • enable debug by default (010cdfe)

0.0.12 (2020-11-23)

Features

  • allow chaining use statements (#9) (e30ea79), closes #5

Bug Fixes

  • correctly expose route and middleware types (#10) (bb6cd4c), closes #11 #11
  • ensure correct url is used when used as a sub-app (0e4770a)
  • mark app._handle as private to avoid sub-app detection (1439f35)

0.0.11 (2020-11-21)

Features

0.0.10 (2020-11-20)

Features

  • rewrite with much sexier API (0d3680e)

0.0.9 (2020-11-20)

Features

Bug Fixes

  • throw 404 only when writableEnded is not set (1c42a07)

0.0.8 (2020-11-19)

Bug Fixes

0.0.7 (2020-11-19)

0.0.6 (2020-11-19)

Features

  • add debug option to app (b0891cd)

0.0.5 (2020-11-19)

Features

0.0.4 (2020-11-19)

Features

  • rewrite promisify logic (a40aa81)

Bug Fixes

  • keep top level trailing slash (2fb92ef)
  • stop middleware when writableEnded flag is set (d87d8e5)

0.0.3 (2020-11-19)

Features

0.0.2 (2020-11-19)

Bug Fixes

  • remove dependency on process.env (eb018f5)

0.0.1 (2020-11-18)

Features

  • de-default loazy handles (0cb8c0c)
  • update docs and caller utility (0ef0020)

Bug Fixes

  • app: handle returning promise (2169f92)
  • writable: set writableEnded and writableFinished (7058fdc)