New Version 5.0.0-rc.1
I'm really happy to announce the new Hemera 5 release!
This release is a ground-breaking refactoring of the core. The goal was to simplify but also to make the lifecycle of extensions and middlwares more predictable.
In summary:
- Refactor extension lifecycle and handling
- Refactor plugin management
- Simplify payload validator and codec interface
- Brand new Documentation with https://docusaurus.io/
Breaking changes:
- Removed
Reply.end() - Removed
hemera.rootproperty - Removed
Hemera.reply()in favor ofhemera.reply.next()to send multiple responses in a row - Removed configuration properties
crashOnFatal,shouldCrash. The developer is responsible to catch fatal errors - Removed
CodecPipeline - Removed
encoder,decoder. We provide setter functions for client and server encoding - Removed support to register multiple plugins at once with
hemera.use - Removed
plugin$, plugins property, removehemera.setOption(),hemera.setConfig()methods - Removed functionality to to send a response inside
serverPreResponse. This was confusing because the payload is already set at this point - Load plugins only on
hemera.ready()not whenhemera.use()is called - We break the support of returning values in
addormiddlewareswithout the use of callback or resolved promises
New features:
- Implement schemaCompiler to archive better abstraction for payload validators
- Support for async schemaCompiler
- Encapsulate extensions, codec and schemaCompiler
- Provide setter functions for client and server encoding
Modified packages
hemera-joiRemove post validation- Remove support for
hemera-nsqandhemera-controlplane hemera-pluginyou can skip the creation of a plugin scope withscoped:false
Bug fixes
- Fixed issue in add middleware. Passed errors didn't lead to cancellation
