Skip to content
Compare
Choose a tag to compare
@StarpTech 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 raw resp 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

General

  • Removed circuit breaker implementation. We will investigate in a plugin.
  • Emit clientResponseError or serverResponseError only for middleware, extensions or fatal errors not when an error is replied by the user.
  • Removed expose and use prototype based decorations.
  • Use Avvio to bootstrap plugins asynchronously.
  • Graceful shutdown routine as a separate plugin.
  • Use prettier with standardjs linting rules.
  • Added more unit tests.