StarpTech
released this
03 Oct 12:01
·
756 commits
to master
since this release
We rewrote the extension / middleware lifecycle and the plugin system.
Extension lifecycle
- Removed async/await support in extensions due to performance and simplicity.
- Removed support for generator functions.
- Call
send
multiple times has no side effects. - First replied error is set others are ignored.
- First replied value is sent others are ignored.
- Request lifecycle is not aborted on business errors.
- Removed
req.locals
.
Middleware
next
has to be called explicit in the middleware.- Removed support for generator functions.
- Pass
reply
interface instead of the rawresp
object. - Removed
req.locals
.
Plugin
- New Plugin signature
function(hemera, options, done)
. - Plugin name is passed in options
export.options = { name: 'myPlugin' }
and is required. exports.attributes
was removed.- You can register
.use()
plugins in plugins the order is resolved correctly. - Enjoy all benefits of the Avvio module. We use it to bootstrap plugins asynchronously.
- Introduce
.decorate(name, fn, [deps,])
to expose data in plugins or on root.
Act
- Removed support for generator functions.
Add
- Removed support for generator functions.
Performance
- Increased by ~35% benchmark
General
- Removed circuit breaker implementation. We will investigate in a plugin.
- Emit
clientResponseError
orserverResponseError
only for middleware, extensions or fatal errors not when an error is replied by the user. - Removed
expose
and use prototype baseddecorations
. - Use Avvio to bootstrap plugins asynchronously.
- Graceful shutdown routine as a separate plugin.
- Use prettier with standardjs linting rules.
- Added more unit tests.