djhtmx
djhtmx copied to clipboard
This makes the HTMX Component a pydantic.BaseModel
The implications are:
- Rename
Component.template_name
->Component._template_name
- Move the logic
Component.__init__
->Component.mount
The__init__
is now handled by pydantic
I like the idea, because now when I create a base HTMX component I have to repeat its __init__
arguments in all subclasses. So, +1; however, this is breaking change, so I would make it another Component
class and deprecate the current one.
I will work on this proposal.
The README needs to be updated.
The README needs to be updated.
I'm on the process of doing all of this. I went for the breaking change version, but even breaking the import which I find more dev-friendly because it won't even allow you to run the server while developing because an ImportError.
This is still not ready yet. It will take some time to complete.