-
Notifications
You must be signed in to change notification settings - Fork 137
[Poll] #356 Implementation #373
Comments
Too many changes in master...hasezoey:r6/outsource and it difficult to follow them for making the correct decision. Also, I try to find what exactly |
If it means that we wont have to extend Typegoose and then do new Foo().getModelForClass, I'm all up for that. |
Removing But if it will be possible to provide both syntaxes in v6: a new without Typegoose class and the old with Typegoose class - it will be great! It provides a more seamless migration for existing apps. |
sorry, but this cant be done without breaking the new one... |
it is now implement in 72a2da7, and i dont know fully what these lines do, but they work |
Outsourcing the functions seems to be the best idea, since it also improves TypeScript class types for client usage, right now if you want to use the class for types in client TypeScript code, you get getModelForClass and setModelForClass in addition of the actual attributes 😢 |
does this help? :) https://artsy.github.io/blog/2018/11/21/conditional-types-in-typescript/ so it means T if S is assignable to class T (extends a class with their constructor “returning” T) otherwise S |
i later commits to r6/master, i understood it a bit more, but its still a bit of magic to it... |
i will close this because the implementation will stay how it currently is in 6.0.0 currently released under
@nodkz it could be considered that 6.0.0 is now in "beta" |
@nodkz in version 6.0.0-22 the functions are re-added with a deprecation warning (and just as a pass-through to the new syntax) |
so
feature/4
will be integrated in 6.0.0, but now i wanted to ask what would be better:-> this would mean that it is still included in the class which could be problematic in .create({} as Class)
-> this would mean that it couldnt be called from the class, but wouldnt have the problem above
progress on this feature can be seen on https://github.com/hasezoey/typegoose/tree/r6/outsource
(i cant really decide this on my own)
-> for now i will outsource it
The text was updated successfully, but these errors were encountered: