Replies: 4 comments 3 replies
-
I don't think I have a strong opinion here, or at least not on aesthetic grounds. My main interest in this topic is if this new syntax would allow the application of prettier or similar tools to indent/auto-format our components. @davidodentwald has done some work on this with Being able to apply prettier would be a huge win from this feature, if that is the case! |
Beta Was this translation helpful? Give feedback.
-
I went ahead and did it! |
Beta Was this translation helpful? Give feedback.
-
Hi @jpsca Firstly, introducing a breaking change solely for aesthetic reasons that doesn't simplify the syntax is problematic. That such large changes can be introduced without an intermediate version that raised deprecation warnings, makes me question a bit whether to fork my own branch of jinjaX to ensure I can stay updated while not suddenly have my codebase break down. Again, I use JinjaX a lot and I like it, it's just my opinion as a user. Please reconsider using this syntax. |
Beta Was this translation helpful? Give feedback.
-
I don't know why I'm so obsessed with this topic, but wouldn't this be super easy and plain? <Element num=2 text="Hello" var=foo /> Basically Python syntax without the commas. The only workaround would be needed for expressions consisting of multiple parts like in the "Example :class" above. This probably happens rarely and we could use parentheses |
Beta Was this translation helpful? Give feedback.
-
Current Status
The current syntax uses single curly braces to indicate that a component attribute/property/argument is actually an expression, instead of a literal string:
The single curly braces are used for parsing the values. This would be translated internally to:
Proposal
The single curly brace can be confusing in a template full of Jinja's double curly braces (
{{
).So, what I'm thinking is to change the syntax for passing values to components by using Vue.js syntax: quoting everything but prefixing the name of the expression attributes with a colon (
:
). The example above would be written like this instead:5 votes ·
Beta Was this translation helpful? Give feedback.
All reactions