Skip to content

Releases: liamtan28/dactyl

Patch: DI Fixes

18 Aug 13:57
Compare
Choose a tag to compare
Patch: DI Fixes Pre-release
Pre-release

Fixes including:

  • Memleak in request cache
  • using wrong recursive resolution key for cached dependencies
    Introduced:
  • Controller scopes

Introduced DI

16 Aug 11:59
Compare
Choose a tag to compare
Introduced DI Pre-release
Pre-release

The major delivery for this release is rudimentary DI. We are looking for contributors in this space currently.

The dactyl DependencyContainer has been written for this framework and implemented. It allows autoinjection of registered dependencies via the constructor. It also supports 3 scopes, SINGLETON, TRANSIENT, and REQUEST.

Remember, this is all in alpha and thus should not be used in production systems. The DI implementation does require some more work, including addressing:

  • Prevent circular graph not relying on max dependency levels
  • TRANSIENT dependencies causing some issues when the same TRANSIENT is required multiple times in the tree
  • Potential memory leaks, particularly around end of lifetimes of REQUEST scoped dependencies. The cached dependencies get
    dumped, but the UUID for each request still potentially remains in the cache map.

First major alpha release: all baseline components

02 Jun 08:17
Compare
Choose a tag to compare

v0.1.0-alpha

This release introduces the baseline Dactyl API and bootstrapper. All components available are denoted in the repo, but in summary:

  1. Controller.ts - function decorator responsible for assigning controller metadata
  2. Application.ts - application class able to register controllers, and start the webserver
  3. HttpException - throwable exception inside controller actions, Application will then handle said errors at top level and send the appropriate HTTP status code and message. There is also a list of included predefined HttpException classes, see below
  4. HttpStatus.ts - function decorator responsible for assigning default status codes for controller actions
  5. Method.ts - @Get, @Post, @Put, @Patch, @Delete function decorators responsible for defining routes on controller actions

For following - Arg.ts

  1. @Param decorator maps context.params onto argument in controller action (returns whole params object if no key specified)

  2. @Body decorator maps context.request async body onto argument in controller action (returns whole body object if no key specified)

  3. @Query - maps context.url.searchParams onto argument in controller action (returns whole query object if no key specified)

  4. @Header - maps context.headers onto argument in controller action (returns whole header object if no key specified)

  5. @Context - return whole Oak RouterContext object

  6. @Request - return whole Oak Request object

  7. @Response - return whole Oak Response object

  8. Router.ts - It is recommended that you use the Application to bootstrap, but you can use the Router
    class directly. This is a superclass of Oak's router, and exposes additional methods for mapping Controller definitions onto routes.