report better error for attrs that cannot be serialized#1008
report better error for attrs that cannot be serialized#1008rmorshea merged 13 commits intoreactive-python:mainfrom
Conversation
|
We might also want to validate event handlers too. Need to ensure they're either coroutines or callable. |
ce115b2 to
d6329be
Compare
Event handlers are already extracted from attributes based on whether they are callable or not. |
e20da5c to
73296af
Compare
also misc changes to config options to make this eaiser in particular ability to specify options as parents
781e4f8 to
e83eb47
Compare
I currently don't see any warnings if I put in a string as an event handler. from reactpy import component, html, run
@component
def test():
return html.div({"on_click": "do nothing"}, "Hello World")
run(test) |
|
Also I don't see how this PR resolves #437 |
This is strictly about ensuring that attributes are JSON serializable. Know what values are allowed for each attribute on each HTML element would need to be done in a follow-up PR. |
In debug mode, users will get an error if they attempt to pass non-JSON-serializable props to a JS components. They'd get that error without debug mode too, but in debug mode you get a more helpful one. |
Issues
closes: #930
closes: #437
Summary
In
reactpy.core.vdom.vdomcheck if attributes are JSON serializable when in debug mode.Also misc changes to config options to make this easier in particular ability to specify options as parents.
Checklist
changelog.rsthas been updated with any significant changes.