Skip to content

Releases: jeremyben/reflet

@reflet/express@2.0.0

01 Aug 11:17
Compare
Choose a tag to compare

@reflet/express 2.0 : The Maturation 🚀

A few breaking changes to make reflet even more flexible:

  • a configurable final handler instead of a default global error handler.
  • a more programmable Send decorator.

A few ones to make reflet more maintainable:

  • Router decorator is now mandatory on registered classes (global routes can still be added within the child Application class).
  • New reflet package with HTTP primitives is required as peer dependency: @reflet/http.

And a few other features to improve your dev experience:

  • New ScopedMiddlewares decorator to isolate same path router middlewares.
    ...

Migration Guide: https://github.com/jeremyben/reflet/blob/master/express/MIGRATION.md

Documentation: https://github.com/jeremyben/reflet/blob/master/express/README.MD

Full Changelog: https://github.com/jeremyben/reflet/blob/master/express/CHANGELOG.md

@reflet/express@1.6.0

05 Aug 22:52
Compare
Choose a tag to compare
  • Application class to apply decorators globally:
@Send()
@Use(express.json())
class MyApp extends Application {
  @Get('/healthcheck')
  healthcheck() {
    return { success: true }
  }
}

const app = new MyApp()
app.register([UserController])
app.listen(3000)
  • Router.Children decorator to register nested controllers in a declarative way:
@Router('/album')
@Router.Children(() => [TrackController])
class AlbumController {}

@Router('/:albumId/track', { mergeParams: true })
class TrackController {}
  • Router.Dynamic decorator to share a child router with multiple parents.
@Router('/foo')
@Router.Children(() => [{ path: '/items', router: ItemsController }])
class FooController {}

@Router('/bar')
@Router.Children(() => [{ path: '/elements', router: ItemsController }])
class BarController {}

@Router.Dynamic()
class ItemsController {}