github unjs/h3 v0.8.0

latest releases: v1.13.0, v1.12.0, v1.11.1...
2 years ago

compare changes

⚠️ Breaking changes

H3 API and exports are updated in order to reduce dependency on Node.js and future possibilities.

  • All handlers should be defined with eventHandler() wrapper otherwise a warning will be shown suggesting this change for you.
  • h3 app instance created by createApp is not a Node.js listener with (req, res) => {} signuture anymore. You can convert h3 app into a Node.js listener using toNodeListener(app).
  • Compatibility api to support mixed req.event and res.event is dropped. If you had custom utils depending on this, you might need to change them.
  • Node.js/Express-style middleware with (req, res, next?) = {} signuture are not longer automatically converted to event handler format. You can convert them using new fromNodeMiddleware((req, res) => {}) utility.
  • Some exported TypeScript interfaces and types are renamed or removed reflecting this change.

🚀 Enhancements

  • Add writeEarlyHints utility (#184)

🩹 Fixes

  • readBody, readRawBody: Use global symbol (#174)
  • sendRedirect: Only encode required chars in meta tag (a9b992e)
  • writeEarlyHints: Call callback if not supported too (10eab1b)
  • router: Make router handler non preemtive by default (#194)
  • error: Remove default statusMessage from errors (#195)
  • router: Parse url using URL for pathname (#196)

💅 Refactors

  • ⚠️ Reduce Node.js dependency (#178)

📖 Documentation

  • Add sendStream to the utils list (d58fad8)

📦 Build

  • Add package.json to subpath exports (#186)

❤️ Contributors

  • Alexander Lichter
  • Christopher King
  • Daniel Roe
  • Pooya Parsa

Don't miss a new h3 release

NewReleases is sending notifications on new releases.