Skip to content

Releases: hemerajs/hemera

[email protected]

20 Mar 17:27
Compare
Choose a tag to compare
[email protected] Pre-release
Pre-release

Removed dependencies lodash, hoek and fastparellel and use built-in functions.

[email protected]

19 Mar 20:09
Compare
Choose a tag to compare
[email protected] Pre-release
Pre-release

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:

Breaking changes:

  • Removed Reply.end()
  • Removed hemera.root property
  • Removed Hemera.reply() in favor of hemera.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, remove hemera.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 when hemera.use() is called
  • We break the support of simple return values in add or middlewares without 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-joi Remove post validation
  • Remove support for hemera-nsq and hemera-controlplane
  • hemera-plugin you can skip the creation of a plugin scope with scoped:false

Bug fixes

  • Fixed issue in add middleware. Passed errors didn't lead to cancellation

[email protected]

11 Mar 18:39
Compare
Choose a tag to compare

Breaking changes

  • Use of callback-style with act(...) won't return a promise anymore rather undefined
  • Use of promise-style with act(...) will return to a fulfilled promise a context object with two properties data and context. On a rejection, only the error is returned.
    • data message response
    • context hemera 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.context

After with callback

hemera.act({
  topic: "math",
  cmd: "add"
}, function (err, resp) {
	// code ...
})

[email protected]

10 Mar 11:21
Compare
Choose a tag to compare
  • Refactor tracing
  • Fixed tracing propagation

[email protected]

10 Mar 11:22
Compare
Choose a tag to compare
  • 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_EXPECTEDMSG and HEMERA_CONTEXT tags

[email protected]

08 Mar 19:58
Compare
Choose a tag to compare
  • Implement onAdd extensions #188
  • Expose matchedAction which represent the matched action behind the pattern

[email protected]

07 Mar 19:14
Compare
Choose a tag to compare
  • Add promise support for close method
  • Stop emitting close errors rather pass them via callback or promise style

[email protected]

07 Mar 10:46
Compare
Choose a tag to compare
  • Upgrade to latest NATS driver
  • Upgrade Pino logger
  • Implement expectedMessages$ flag #185
  • Update docs
  • Make request-reply sid inside act-context public

[email protected]

28 Feb 12:24
Compare
Choose a tag to compare

Add promise support for hemera.ready() when no callback is passed.

[email protected]

17 Feb 16:27
Compare
Choose a tag to compare
  • Upgrade nats-hemera dependencies
  • Upgrade dev-dependencies from Repository