-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
revert #841 #919
revert #841 #919
Conversation
42eb96d
to
1e64cf7
Compare
@Archmonger I think we can go forward with the rename after this. |
@@ -122,7 +122,7 @@ def Wrapper(): | |||
def PrintView(): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -122,7 +122,7 @@ def Wrapper(): | |||
def PrintView(): | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to still be unresolved?
@@ -30,6 +30,7 @@ def get_node_depth(node: Node) -> int: | |||
|
|||
def register_sections_as_label(app: Sphinx, document: Node) -> None: | |||
docname = app.env.docname | |||
print(docname) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unneeded print?
@@ -66,7 +67,7 @@ def register_sections_as_label(app: Sphinx, document: Node) -> None: | |||
domain.labels[name] = docname, labelid, sectname | |||
|
|||
|
|||
def setup(app: Sphinx) -> dict[str, Any]: | |||
def setup(app: Sphinx) -> Dict[str, Any]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to use typing.Dict
here.
{ | ||
"style": { | ||
"position": "absolute", | ||
"backgroundColor": "red", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we convert styles to snake_case
?
@@ -15,9 +15,11 @@ def handle_reset(event): | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tons of backgroundColor
references in the docs. We might want them to be background_color
.
@@ -115,8 +115,8 @@ async def handle_event(): | |||
second_event_did_execute.set() | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
html.label( | ||
{}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.rst
has been updated with any significant changes.