fastify-decorators

Set of Typescript decorators to build Fastify server with controllers, services and hooks

MIT License

Downloads
26.2K
Stars
281
Committers
8

Bot releases are visible (Hide)

fastify-decorators - Latest Release

Published by L2jLiga 12 months ago

Added

  • ECMAScript Decorators support
  • CommonJS build

Changed

  • [BREAKING] Minimal TypeScript version is 5.2.0
  • [BREAKING] Minimal Node.js version is 18.12.0 LTS
fastify-decorators -

Published by L2jLiga about 1 year ago

Fixed

  • application does not start up when service with initializer is loaded but not instantiated (issue 877)
fastify-decorators -

Published by L2jLiga almost 2 years ago

Added

  • Injectables holder object in order to provide own classes/singletons at startup (issue #835)

Fixed

  • Initializer was called multiple times (issue #834)
  • Proxy mess up objects which are not services (issue #834 (comment))
  • Service destructor is called when service is imported but not initialized (issue #786)
fastify-decorators -

Published by L2jLiga about 2 years ago

Fixed

  • Do not mutate parent controller methods in case of inheritance
fastify-decorators -

Published by L2jLiga about 2 years ago

Added

  • FastifyInstance available for all initialization hooks

Fixed

  • Parent controller routes mutation
fastify-decorators -

Published by L2jLiga about 2 years ago

Added

  • [core] option to specify controller tags (#759)
  • [simple-di] option to provide custom FastifyInstance in tests (#800, #801)
  • [simple-di] overall DI plugin improvements

Fixed

  • [core] properly handle controllers with inherited handlers (#802)
  • [simple-di] properly handle useDefineForClassFields TypeScript flag
  • [simple-di] inability to access primitive property from service when service has Request or Reply injected
fastify-decorators -

Published by L2jLiga about 2 years ago

Added

  • FastifyRequest and FastifyReply injection option (backport #555)
  • Option to use custom FastifyInstance in controller/service tests (#801)

Fixed

  • Undefined when extending from abstract class (#802)
fastify-decorators -

Published by L2jLiga about 2 years ago

Fixed

  • Tags from controller not applied to routes when handler has schema object
fastify-decorators - v3.13.0

Published by L2jLiga about 2 years ago

Added

  • new option classLoader, allows to implement own DI logic instead of fastify-decorators provides. See Using custom class loader for more details.
  • new Controllers option tags, allows to specify set of tags for all methods in controller, useful for grouping methods in swagger
fastify-decorators -

Published by L2jLiga over 2 years ago

Added

  • Fastify v4 support

Fixed

  • Unable to use @Inject when useDefineForClassFields enabled in tsconfig (#750)
  • @Inject does not work when reflect-metadata not present (#752)

Removed

  • Experimental plugin APIs
fastify-decorators -

Published by L2jLiga over 2 years ago

Added

  • [core] Fastify v4 alpha and rc builds to plugin supported list
  • [core] Bootstrap accepts native import.meta.url for autoload
  • [core] Bootstrap accepts path-like
fastify-decorators - v3.11.0

Published by L2jLiga over 2 years ago

Changed

  • Bootstrap autoload config now accepts PathLike instead of just string. This is useful for ESM projects by simplifying code:

    before:

    import 'reflect-metadata';
    import { fastify } from 'fastify';
    import { bootstrap } from 'fastify-decorators';
    import * as path from 'path';
    import { fileURLToPath } from 'url';
    
    export const app = fastify();
    
    app.register(bootstrap, {
      directory: path.dirname(fileURLToPath(import.meta.url)),
    });
    

    after:

    import 'reflect-metadata';
    import { fastify } from 'fastify';
    import { bootstrap } from 'fastify-decorators';
    
    export const app = fastify();
    
    app.register(bootstrap, {
      directory: import.meta.url,
    });
    
fastify-decorators -

Published by L2jLiga almost 3 years ago

Added

  • [core] Run tests with Node.js 17 in CI
  • [core] New appInit hook executed before application starts Controllers/Handlers loading
  • [simple-di] Option to inject FastifyRequest and FastifyReply into services

Changed

  • [core] appInit, appReady and appDestroy hooks now can access FastifyInstance
  • [simple-di] configureControllerTest and configureServiceTest plugins option now accepts Maps and Sets

Fixed

  • [plugins] Corrected badges for plugins
  • [simple-di] Export FastifyInstanceToken
  • [simple-di] Ensure FastifyInstance available at startup
  • [simple-di] Ensure configureServiceTest injects FastifyInstance
  • [simple-di] Removed redundant proxy creation when configuring controller test
fastify-decorators -

Published by L2jLiga almost 3 years ago

Added

  • Initialization hooks for plugin ecosystem
  • Plugin for integration with TypeDI

Changed

  • BREAKING: minimal supported Node.js version is v12.13.1
  • BREAKING: moved dependency injection functionality into separate package
  • BREAKING: removed CommonJS build
  • BREAKING: minimal TypeScript version officially supported is 4.0
fastify-decorators -

Published by L2jLiga over 3 years ago

Added

  • Option to specify global prefix
fastify-decorators -

Published by L2jLiga over 3 years ago

Fixed

  • Logo is not visible on npmjs
fastify-decorators -

Published by L2jLiga over 3 years ago

Added

  • Experimental plugins APIs
  • repository.directory field to package.json

Changed

  • Inline CJS source maps
  • Provide TypeScript 3.4 compatible typings by default
  • Documentation minor updates
fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • @Destructor decorator for services graceful shutdown
fastify-decorators -

Published by L2jLiga almost 4 years ago

Fixed

  • Missed CJS files for fastify-decorators/testing (#113)
fastify-decorators -

Published by L2jLiga almost 4 years ago

Added

  • Added option to specify plugins when configuring controllers/services tests
  • Publish library as dual package (ES Modules + CommonJS)
Package Rankings
Top 2.96% on Npmjs.org
Badges
Extracted from project README's
Fastify decorators npm version npm License: MIT Node.js CI codecov
Related Projects