-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Pre RFC / Feature Request: (De)structuring #553
Comments
<Button @variant="primary" as | ( Icon Image ) ( Spinner ) |>
<Icon />
<Image />
<Spinner />
</Button> |
I thought |
or we can finally drop |
I know that's a troll, but, for others who may not know: that would introduce ambiguity with what this question/issue is about.
to reduce |
Svelte use mustache and ‘{‘ |
We don't use angle bracket components in our project yet, so I'm not sure if this conflicts with anything, but what about dropping the curlies? {{!-- After --}}
<Button @variant @size this.onClick>
{{@text}}
</Button> Basically the shorthand property value feature, just consider |
This already means positional params though. |
Right, my bad, forgot about positional params, we never use them for our components 😅 |
I don't think we have positional params for <AngleBrackets, do we? |
Not with the Glimmer Component manager, but we can make component managers that support positional params. I've been wanting to dig in to this for control flow, for things like ember-animated, or other control-flow logic (maybe like with async-data loading at the component level for managing intermediate / placeholder state). There is a write up on all that here: https://github.com/tildeio/ember-control-flow-component Though, maybe I still misunderstand, and maybe not having positional in angle brackets is a real limitation, and not just a choice to enhance clarity in the modern era?. idk. |
yup, I was wrong about the positional thing in angle brackets: Thanks @rwjblue and @locks! <3 Further important info from @locks:
|
Svelte does not use mustache. |
@locks https://github.com/sveltejs/svelte/blob/master/src/compiler/parse/state/mustache.ts It's kinda Mustache Why we need to |
This was my first thought when wanting to be able to remove the redundancy. Would be sexy. However would also be confusing for new people which is why a more JS like syntax should be used (if anything) imo. |
Leaving this open for now since it's referenced in @NullVoxPopuli's meta issue. |
As far as I know, there is no syntactic meaning in glimmer for
{ }
(single curlies).So, without diving in at trying to implement this myself, it seems like we have room to implement something like the following:
and
Thoughts?
The text was updated successfully, but these errors were encountered: