Releases: hemerajs/hemera
Releases · hemerajs/hemera
Release list
nats-hemera@5.0.0-rc.2
Removed dependencies lodash, hoek and fastparellel and use built-in functions.
nats-hemera@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 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 these errors - Removed
CodecPipeline - Removed
encoder,decoder. We provide setter functions for client and server encoding - Remove support to register multiple plugins at once with
hemera.use - Remove
plugin$, plugins property, removehemera.setOption(),hemera.setConfig()methods - Remove 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 simple return values in
addormiddlewareswithout the use of callback or 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
nats-hemera@4.0.0
Breaking changes
- Use of callback-style with
act(...)won't return a promise anymore ratherundefined - Use of promise-style with
act(...)will return to a fulfilled promise a context object with two propertiesdataandcontext. On a rejection, only the error is returned.datamessage responsecontexthemera instance with the right meta$, context$ and trace$ informations.
Migration Guide
Don't mix callback and promise style and work in case of promise with the result object
Before
const result = await hemera.act({
topic: "math",
cmd: "add"
}, async function (err, resp) {
// code ...
})After with promise
const result = await hemera.act({
topic: "math",
cmd: "add"
})
// code ...
result.data
result.contextAfter with callback
hemera.act({
topic: "math",
cmd: "add"
}, function (err, resp) {
// code ...
})nats-hemera@3.5.1
- Refactor tracing
- Fixed tracing propagation
hemera-jaeger@2.0.0
- Support of custom parent span via
context$ - Remove hemera version from span tags
- Use pattern as span operation name
- Add
HEMERA_OP_TYPE,HEMERA_ACT_EXPECTEDMSGandHEMERA_CONTEXTtags
nats-hemera@3.5.0
- Implement
onAddextensions #188 - Expose
matchedActionwhich represent the matched action behind the pattern
nats-hemera@3.4.0
- Add promise support for
closemethod - Stop emitting
closeerrors rather pass them via callback or promise style
nats-hemera@3.3.0
- Upgrade to latest NATS driver
- Upgrade Pino logger
- Implement
expectedMessages$flag #185 - Update docs
- Make request-reply
sidinside act-context public
nats-hemera@3.2.0
Add promise support for hemera.ready() when no callback is passed.
nats-hemera@3.1.9
- Upgrade nats-hemera dependencies
- Upgrade dev-dependencies from Repository