Since the frontend sends the events arguments to the server as JSON, I think it can be a great idea to add pydantic as a condition dependency (meaning that the library will only add these features if pydantic is installed).
If pydantic is present, JSX will automatically validate the arguments of the event function and unpack them while also converting the input arguments to their expected types.
This makes integration much more seamless and allows developers to easily define server side events.
This, of course, will require JSX to read the event's signature and type annotations.
Since the frontend sends the events arguments to the server as JSON, I think it can be a great idea to add
pydantic
as a condition dependency (meaning that the library will only add these features ifpydantic
is installed).If
pydantic
is present, JSX will automatically validate the arguments of the event function and unpack them while also converting the input arguments to their expected types.This makes integration much more seamless and allows developers to easily define server side events.
This, of course, will require JSX to read the event's signature and type annotations.