-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
ui: Add optional name="" attribute to slots so you can name the slots using it (as opposed to positional params) #6740
Conversation
Pretty soon we would like to move to XML/Angle Bracket style components. As they are XML-y it means you can't use positional parameters anymore (every 'argument' for the component requires it to use an XML-like attribute). This adds a `name=""` attribute to both block-slot and yield-slot components so we can use attributes to specify the name. We prefer using attributes from now on, whilst the positional parameter is still available yet deprecated so we can move over at whatever speed fits. We also did the same with the block params positional parameter. As a final note this entire in repo addon is a fork of `ember-block-slots`
5de9c2e
to
c54d0bc
Compare
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.
Looks good! FWIW I don't think the computed macros are getting cut in Glimmer, they'd just move to decorators, but it doesn't bother me that you're not using it here. I'd be more inclined if it were usable in more than one spot.
Thanks @meirish , re: computed macros - yeah for sure. Although I am concerned about the ticking timebomb with this and a move to Glimmer components 😬. I'm pretty sure none of this will work with a move to Glimmer components so I'm kinda pretending that problem isn't there for the moment and hoping it will go away at some point, preferably through some sort of slotting support in Glimmer. I know there is an RFC for this somewhere. Anyhoo thanks for the review! You'll probably see a gradual (or maybe in a single PR) change throughout our templates to use this |
Here's a tracking issue for named blocks in glimmer if you want to follow it: emberjs/rfc-tracking#44. I wouldn't fret this too much though, you can keep components that use block slots in the old style for now, it's not going away anytime soon. |
Pretty soon we would like to move to XML/Angle Bracket style components. As they are XML-y it means you can't use positional parameters anymore (every 'argument' for the component requires it to use an XML-like attribute). This adds a `name=""` attribute to both block-slot and yield-slot components so we can use attributes to specify the name. We prefer using attributes from now on, whilst the positional parameter is still available yet deprecated so we can move over at whatever speed fits. We also did the same with the block params positional parameter. As a final note this entire in repo addon is a fork of `ember-block-slots`
Pretty soon we would like to move to XML/Angle Bracket style components. As they are XML-y it means you can't use positional parameters anymore (every 'argument' for the component requires it to use an XML-like attribute). This adds a `name=""` attribute to both block-slot and yield-slot components so we can use attributes to specify the name. We prefer using attributes from now on, whilst the positional parameter is still available yet deprecated so we can move over at whatever speed fits. We also did the same with the block params positional parameter. As a final note this entire in repo addon is a fork of `ember-block-slots`
Pretty soon we would like to move to XML/Angle Bracket style components. As they are XML-y it means you can't use positional parameters anymore (every 'argument' for the component requires it to use an XML-like attribute). This adds a `name=""` attribute to both block-slot and yield-slot components so we can use attributes to specify the name. We prefer using attributes from now on, whilst the positional parameter is still available yet deprecated so we can move over at whatever speed fits. We also did the same with the block params positional parameter. As a final note this entire in repo addon is a fork of `ember-block-slots`
Hey there, This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days. If you are still experiencing problems, or still have questions, feel free to open a new one 👍. |
Pretty soon we would like to move to XML/Angle Bracket style
components. As they are XML-y it means you can't use positional
parameters anymore (every 'argument' for the component requires it to
use an XML-like attribute).
This adds a
name=""
attribute to both block-slot and yield-slotcomponents so we can use attributes to specify the name. We prefer using
attributes from now on, whilst the positional parameter is still
available yet deprecated so we can move over at whatever speed fits.
We also did the same with the block params positional parameter.
As a final note this entire in repo addon is a fork of
ember-block-slots
We've specifically not used
or
here for the same reasons as jQuerytrigger
vsclick
,hover
,keyup
etc etc. The ember team seem to be going through a similar reduction of API lately so we would like to follow that approach. If anyone feels strongly I'd happily switch inor
instead.There is no implementation right now, we'll either do this as we go along, or we'll do a few separate PRs when time allows/bit-by-bit.