Skip to content

v5.0.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@Romakita Romakita released this 23 Dec 12:09
· 4097 commits to production since this release

5.0.0 (2018-12-23)

Note: npm publish has failed to pack the v5.0.0 (problem with an old released one year ago). The official npm version is the 5.0.1.

chore

  • di: Remove method ServerLoader.getSettingsService (59ae2b8)
  • di: remove OnInjectorReady interface (a47a60f)
  • di: Remove static method InjectorService.construct (1215d3c)
  • di: Remove static method InjectorService.emit (834f1dc)
  • di: Remove static method InjectorService.factory (68d065e)
  • di: Remove static method InjectorService.get (abc70c4)
  • di: Remove static method InjectorService.has (628e455)
  • di: Remove static method InjectorService.invoke (6b0305d)
  • di: Remove static method InjectorService.invokeMethod (f75bd75)
  • di: Remove static method InjectorService.load (37b1de8)
  • di: Remove static method InjectorService.service (407a487)
  • di: Remove static method InjectorService.set (17679c3)
  • mvc: Remove FilterService (66f0ff0)
  • mvc: Remove MiddlewareService (a465f1f)
  • mvc: Remove RouterController (62f147b)

Features

  • testing: Make sure injectbootstrap can be called from strict context (204e15e)
  • testing: Promisify the inject function. (58fbaed)
  • testing: Promisify the bootstrap function (f2885a9)
  • testing: Promisify the loadInjector function

BREAKING CHANGES

You have to install as dependencies the @tsed/di packages:

$ npm install --save @tsed/di

Note: @tsed/common export all symbols from @tsed/di


  • testing: inject(MyServer)() now returns a Promise.

Change

beforeEach(inject([MyService, Done], (myService: MyService, done: Done) => {
   myService.doSomething().then(done);
}))

to

beforeEach(async () => {
    let myService
    await inject([MyService], (_myService_: MyService) {
       myService = _myService_
    })();
   // other custom logic

   await myService.doSomething();
})

or

beforeEach(inject([MyService], async (myService: MyService) {
    await myService.something();
}));
  • testing: boostrap(MyServer) now returns a Promise.

Change

beforeEach(done => bootstrap(MyServer)(done))

to

beforeEach(async () => await bootstrap(MyServer)())

or

beforeEach(bootstrap(MyServer))
  • mvc: Remove MiddlewareService. Use InjectorService instead of.
  • di: Remove static method ServerLoader.getSettingsService. Use ServerLoader.settings insteadof
  • di: Remove OnInjectorReady interface. Use OnInit instead of.
  • di: Remove static method InjectorService.invoke. Create a new instance of InjectorService and use injector.invoke instead of.
  • di: Remove static method InjectorService.invokeMethod. Create a new instance of InjectorService and use injector.invokeMethod instead of.
  • di: Remove static method InjectorService.set. No alternative
  • di: Remove static method InjectorService.has. Create a new instance of InjectorService and use injector.has instead of.
  • di: Remove static method InjectorService.load. Create a new instance of InjectorService and use injector.load instead of.
  • di: Remove static method InjectorService.factory. Use registerFactory instead of.
  • di: Remove static method InjectorService.service. Use registerService instead of.
  • di: Remove static method InjectorService.construct. No alternative.
  • di: Remove static method InjectorService.get. Create a new instance of injector and use injector.get() instead of.
  • di: Remove static method InjectorService.emit. Create a new instance of injector and use injector.emit() instead of.
  • mvc: Remove RouterController. Use ExpressRouter insteadof.
  • mvc: Remove FilterService. Use InjectorService instead of.