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
refactor plugin protocol #1176
refactor plugin protocol #1176
Conversation
Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, plugins are now generic on both the source data type and the transform type.
I assume this is to allow us to make plugins that transform into msgspec structs?
I know that I'd prefer my DTOs to be msgspec structs and parsed directly from the request buffer, but this will allow users to have a choice.
This plays into a redesign I was already considering for the DTO refactor. At the moment, DTO instances are pydantic models, but they probably need to be their own type, and hold a reference to a thing that does the ser/de and validation, be that a pydantic model, or msgspec struct or whatever, and what that thing is will depend on the type of plugin the dto factory is given.
E.g, if a DTO factory type is given a plugin that is narrowed to pydantic base model, then it will produce a ser/de object that is a pydantic model, if it is given a plugin narrowed to msgspec structs, then it will produce a struct for its ser/de object.
Before this, I was not confident about meeting the 20th deadline (not just for the DTO refactor, but for everything I want to have in 2.0), but I think will be a positive redesign.
Co-authored-by: Peter Schutt <peter@topsport.com.au>
Co-authored-by: Peter Schutt <peter@topsport.com.au>
5c73f13
to
6194d3b
Compare
PR Checklist
CONTRIBUTING.rst
?