Conversation
42eb96d to
1e64cf7
Compare
|
@Archmonger I think we can go forward with the rename after this. |
| text, set_text = idom.hooks.use_state(print_buffer.getvalue()) | ||
| print_buffer.set_callback(set_text) | ||
| return idom.html.pre(text, class_name="printout") if text else idom.html.div() | ||
| return idom.html.pre({"class": "printout"}, text) if text else idom.html.div() |
There was a problem hiding this comment.
"class" needs a revert to "class_name". Also confirm throughout the docs we aren't missing any of those situations.
There was a problem hiding this comment.
| return idom.html.pre({"class": "printout"}, text) if text else idom.html.div() | |
| return idom.html.pre({"class_name": "printout"}, text) if text else idom.html.div() |
There was a problem hiding this comment.
This appears to still be unresolved?
docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py
Outdated
Show resolved
Hide resolved
51aa05c to
f1bf70c
Compare
|
I'd like to get this out, so I'm going to merge and do a pre-release |
|
I'll do a post-merge review tomorrow. If there's any issues we can handle it in a separate release. |
| text, set_text = idom.hooks.use_state(print_buffer.getvalue()) | ||
| print_buffer.set_callback(set_text) | ||
| return idom.html.pre(text, class_name="printout") if text else idom.html.div() | ||
| return idom.html.pre({"class": "printout"}, text) if text else idom.html.div() |
There was a problem hiding this comment.
This appears to still be unresolved?
|
|
||
| def register_sections_as_label(app: Sphinx, document: Node) -> None: | ||
| docname = app.env.docname | ||
| print(docname) |
|
|
||
|
|
||
| def setup(app: Sphinx) -> dict[str, Any]: | ||
| def setup(app: Sphinx) -> Dict[str, Any]: |
There was a problem hiding this comment.
No need to use typing.Dict here.
| { | ||
| "style": { | ||
| "position": "absolute", | ||
| "backgroundColor": "red", |
There was a problem hiding this comment.
Should we convert styles to snake_case?
| return html.div( | ||
| html.button( | ||
| "Set Color", on_click=handle_click, style={"background_color": color} | ||
| {"on_click": handle_click, "style": {"backgroundColor": color}}, "Set Color" |
There was a problem hiding this comment.
Tons of backgroundColor references in the docs. We might want them to be background_color.
| return idom.html.div( | ||
| idom.html.button(on_click=block_forever), | ||
| idom.html.button(on_click=handle_event), | ||
| idom.html.button({"onClick": block_forever}), |
There was a problem hiding this comment.
onClick -> on_click
There's a few instances of unconverted values in the tests. This might indicate the conversion script isn't working in some edge cases.
| return html.form( | ||
| {"on_submit": handle_submit, "style": {"display": "inline-grid"}}, | ||
| html.label( | ||
| {}, |
There was a problem hiding this comment.
There's a handful of these empty dicts in this PR.
I recommend doing a search through this diff page for {}
|
Been testing this out in Conreq. I have a couple of comments
|
|
Unfortunately I don't think there's a good great way handle that case you're experiencing. That first posarg could also be a child rather than a props dict. I think we can just produce a more helpful error. |
|
Yeah no problem. To be honest it probably doesn't need the extra robustness, since as far as I can tell I'm the only one "stress testing" IDOM. The error improvement would be a good addition though |

closes: #920
and reverts changes from #841 as per discussion in #916
but preserve ability to declare attributes with snake_case
Checklist
Please update this checklist as you complete each item:
changelog.rsthas been updated with any significant changes.