-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
report better error for attrs that cannot be serialized #1008
report better error for attrs that cannot be serialized #1008
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.vdom
check 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.rst
has been updated with any significant changes.