You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some new feature require a breaking change for all projects based on v7:
useDefineForClassFields
useDefineForClassFields in tsconfig must be configured to false. Changing this option can change the runtime behavior. Latest v7 support twice configuration but v8 doesn't support useDefineForClassFields totrue because inject/constant/value use Reflect.defineProperty to declare property.
Reflect.defineProperty resolve the problem when you trying to get the injected value using decorators:
classMyService{
@Constant("my.value")value: string;
@Inject()client: Client;constructor(){console.log(this.value)// undefined in v7, in v8 value is definedconsole.log(this.client)// undefined in v7, in v8 value is defined}}
It's time to on a full ESM project! Maintaining code compliant with CommonJS and ESM in v7 is very complicated.
Now the ESM ecosystem is stable. Ts.ED repository will move on full ESM.
Migrate @tsed/graphql on apollo v4
Apollo v4 introduce a lot of breaking change. The new @tsed/apollo, @tsed/typegraphql will be available with the v8
See #2493
New features
Angular style injection
V8 add the angular style injection using simple function:
Replace platform-log-middleware by platform-log-request
@tsed/platform-log-request is a new module introduced in v8 alpha and replace the @tsed/platform-log-middleware which is not cross platform compatible.
This new module support WWW platform (common) and Serverless platform. It provide new options which gives you control over the logger information and better customization depending on the log level. It's a little more powerful than the old module and is lighter in terms of code.
Attaching more data from the $ctx instance to each log request will be more simpler:
constloggerSettings={alterLog(level: string,data: Record<string,unknown>,$ctx: PlatformContext){switch(level){case"info":
return{
...data,// add you extra datatenant_id: $ctx.request.params.tenant_id}}returndata;}}
@Configuration({logger: loggerSettings})
Why ?
Some new feature require a breaking change for all projects based on v7:
useDefineForClassFields
useDefineForClassFields
in tsconfig must be configured tofalse
. Changing this option can change the runtime behavior. Latest v7 support twice configuration but v8 doesn't supportuseDefineForClassFields
totrue
because inject/constant/value useReflect.defineProperty
to declare property.Reflect.defineProperty
resolve the problem when you trying to get the injected value using decorators:See PR: #2812
Remove CommonJs support
It's time to on a full ESM project! Maintaining code compliant with CommonJS and ESM in v7 is very complicated.
Now the ESM ecosystem is stable. Ts.ED repository will move on full ESM.
Migrate @tsed/graphql on apollo v4
Apollo v4 introduce a lot of breaking change. The new @tsed/apollo, @tsed/typegraphql will be available with the v8
See #2493
New features
Angular style injection
V8 add the angular style injection using simple function:
Replace platform-log-middleware by platform-log-request
@tsed/platform-log-request
is a new module introduced in v8 alpha and replace the@tsed/platform-log-middleware
which is not cross platform compatible.This new module support WWW platform (common) and Serverless platform. It provide new options which gives you control over the logger information and better customization depending on the log level. It's a little more powerful than the old module and is lighter in terms of code.
Attaching more data from the
$ctx
instance to each log request will be more simpler:by default this module generate log as follows:
Other Stuff
@tsed/typeorm
package (v0.3.x doesn't need. dedicated package)@tsed/vite-ssr-plugin
(replaced by @tsed/vike)Remove@Ignore
decorator (post pone)The text was updated successfully, but these errors were encountered: