Replies: 2 comments 7 replies
-
Why not implement a few variants (in a cross-compatible and extensible way) and let the user/team choose according to general preference and particular usecase? This may aid transitioning from other frameworks and allow for the "wisdom of the crowd", at some peril of syntactic cacophony. |
Beta Was this translation helpful? Give feedback.
-
Agreed. If jimbaker needs a specific python interface, he could always make a third party VDOM generator. But the JSX syntax doesn't seem to relate to our Python syntax to be honest. It would be fun to play around with a JSX alternative at some point though. We might want to work on a PySX syntax highlighter in the future? Or to be honest, jinja could be a pretty good drop-in replacement.
As mentioned in the previous discussion, the new interface is less visually HTML-like and harder to read/write/translate/modify. There are better ways to do this IMO.
Reminder that if we decide to stay on the old syntax, we probably want to allow raw dashes Is it still worth considering alternative syntaxes? And do we want to have that debate in this or another thread? I've updated the interface guidelines with the new direction. |
Beta Was this translation helpful? Give feedback.
-
There's been a lengthy discussion about changes to how HTML elements are constructed. I'd like to take a step back and consider the initial motivations for the changes, what assumptions may have been unfounded, correct them, and then move forward from there.
Let's take a look at the issue that spawned these changes. It states that...
In short, this issue anticipates a future in which most code written for IDOM use a JSX-like syntax. As such, it posits that in that future IDOM would need a way to help enforce or encourage component authors to handle children in some standardized way. As part of doing that, we would make the standard HTML constructors have the same signature that we would expect user-authored components to have when used with this hypothetical JSX syntax. The issue proposes that the signature for these constructors should be:
I see a number of different ways in which the assumptions of this issue may have been wrong. Those being that...
html.*(...)
element declarations in the first place.If we can agree that these were false assumptions then it probably makes sense to revert the changes from #841 with the exception of those that allow attribute names to be snake_case. From there, we can have a separate debate about whether there is a better way to declare HTML elements in pure Python.
Beta Was this translation helpful? Give feedback.
All reactions