-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Removed Abstract<T> argument type from ServiceIdentifier cause BC break #1629
Comments
Hey @helios-ag Please provide a minimum reproduction code of the issue. |
hi @notaphplover output for
|
Ok, I see the issue here. Basically, tsoa has the following export interface IocContainer {
get<T>(controller: { prototype: T }): T;
get<T>(controller: { prototype: T }): Promise<T>;
} Since As said in other issues, there're good reasons to remove Let's see an ancient code example: interface Foo {
bar: string;
}
function MyAncientJavscriptClass(this: Foo): void {
this.bar = 'baz';
}
MyAncientJavscriptClass.prototype.getBar = function (this: Foo): string {
return this.bar;
}; if we ask typescript which is interface MyAncientJavscriptClassProto {
getBar(): string;
} The prototype does not expose any of In container.bind({ prototype: { foo: 'bar' } }).toSelf(); is inferring I would suggest you to ask in the I'll close the issue now, but feel free to continue discussing in this thread. If there's something I'm missing I am open to change my mind and reconsider my position, but the way I see this, replacing |
hi @notaphplover |
Hey @helios-ag, All the bug fixes are breaking changes, they alter the code base so a wrong behavior becomes the expected behavior. When I put on your shoes I can understand your position, it can be really frustrating to bump a library version and find these not so pleasant surprises. But this kind of special breaking changes trigger patch updates instead of major ones. On the other hand, I do believe this is a bugfix. |
hi @notaphplover, got your position here |
Is there an existing issue for this?
Current behavior
We use inversify with tsoa framework, and after recent update from 6.0.3 to 6.1.1 Inversify introduced BC break
https://github.com/inversify/InversifyJS/blob/master/src/interfaces/interfaces.ts#L244
Tsoa use definition of container to be compatible with inversify's container
get
methodhttps://github.com/lukeautry/tsoa/blob/master/packages/runtime/src/interfaces/iocModule.ts#L2
Steps to reproduce
Upgrade from 6.0.x to 6.1.x
And container can't be compiled due to incompatibility of signatures
Expected behavior
Container compiles as previously
Possible solution
Add
Abstract<T>
(or{prototype: T}
which is the same) type to ServiceIdentifier in common packagePackage version
6.1.0
Node.js version
22.11
In which operating systems have you tested?
Stack trace
No response
Other
Related issue lukeautry/tsoa#1717
The text was updated successfully, but these errors were encountered: